-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xodr offset transformation #217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, we should discuss how we name CPP/Python functions.
My understanding is that the Google style guide says:
CPP
- Camel-case for normal functions
- Getter and setter should be named with underscore
modules/geometry/line.hpp
Outdated
@@ -177,6 +177,24 @@ inline T length(const Line &line) { | |||
return bg::length<T>(line.obj_); | |||
} | |||
|
|||
inline Line rotate(const Line &line, float hdg) { | |||
namespace trans = boost::geometry::strategy::transform; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using boost::geometry::strategy::transform::rotate_transformer;
modules/geometry/line.hpp
Outdated
@@ -177,6 +177,24 @@ inline T length(const Line &line) { | |||
return bg::length<T>(line.obj_); | |||
} | |||
|
|||
inline Line rotate(const Line &line, float hdg) { | |||
namespace trans = boost::geometry::strategy::transform; | |||
trans::rotate_transformer<boost::geometry::radian, double, 2, 2> rotate(hdg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotate_transformer<boost::geometry::radian, double, 2, 2> rotate(hdg);
modules/geometry/line.hpp
Outdated
@@ -177,6 +177,24 @@ inline T length(const Line &line) { | |||
return bg::length<T>(line.obj_); | |||
} | |||
|
|||
inline Line rotate(const Line &line, float hdg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline Line rotate(const Line& line, float hdg) {
trans::rotate_transformer<boost::geometry::radian, double, 2, 2> rotate(hdg); | ||
Line line_rotated; | ||
boost::geometry::transform(line.obj_, line_rotated.obj_, rotate); | ||
line_rotated.recompute_s(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The length(s) should not change due to a rotation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, just wanted to make sure ... I'll remove it
modules/geometry/line.hpp
Outdated
trans::translate_transformer<double, 2, 2> translate(x, y); | ||
Line line_translated; | ||
boost::geometry::transform(line.obj_, line_translated.obj_, translate); | ||
line_translated.recompute_s(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Length(s) should not change due to translation.
modules/geometry/line.hpp
Outdated
} | ||
|
||
inline Line translate(const Line &line, float x, float y) { | ||
namespace trans = boost::geometry::strategy::transform; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as with the function above.
modules/geometry/line.hpp
Outdated
return line_rotated; | ||
} | ||
|
||
inline Line translate(const Line &line, float x, float y) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline Line translate(const Line& line, float x, float y) {
geometry::Line transformed_line = translate(rotated_line, x, y); | ||
reference_line_ = transformed_line; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reference_line_ = translate(rotated_line, x, y);
@@ -431,7 +452,7 @@ def convert_to_map(self, python_map): | |||
CPP Map -- Map for usage with CPP | |||
""" | |||
for road in self.python_map["roads"]: | |||
new_road = self.create_cpp_road(road) | |||
new_road = self.create_cpp_road(road, self.python_map["header"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if there is no header -- like in many files?
No description provided.