Skip to content
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

Merged
merged 4 commits into from
Jan 15, 2020
Merged

Xodr offset transformation #217

merged 4 commits into from
Jan 15, 2020

Conversation

klemense1
Copy link
Contributor

No description provided.

@klemense1 klemense1 requested a review from patrickhart January 14, 2020 17:19
Copy link
Collaborator

@patrickhart patrickhart left a 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

@@ -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;
Copy link
Collaborator

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;

@@ -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);
Copy link
Collaborator

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);

@@ -177,6 +177,24 @@ inline T length(const Line &line) {
return bg::length<T>(line.obj_);
}

inline Line rotate(const Line &line, float hdg) {
Copy link
Collaborator

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();
Copy link
Collaborator

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?

Copy link
Contributor Author

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

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();
Copy link
Collaborator

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.

}

inline Line translate(const Line &line, float x, float y) {
namespace trans = boost::geometry::strategy::transform;
Copy link
Collaborator

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.

return line_rotated;
}

inline Line translate(const Line &line, float x, float y) {
Copy link
Collaborator

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) {

Comment on lines +97 to +98
geometry::Line transformed_line = translate(rotated_line, x, y);
reference_line_ = transformed_line;
Copy link
Collaborator

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"])
Copy link
Collaborator

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?

@klemense1 klemense1 closed this Jan 15, 2020
@klemense1 klemense1 reopened this Jan 15, 2020
@klemense1 klemense1 merged commit 46c0133 into master Jan 15, 2020
@klemense1 klemense1 deleted the xodr_offset_transformation branch January 15, 2020 12:48
tin1254 pushed a commit that referenced this pull request Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants