-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Refactor common functions in smoother and planner #5537
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
Refactor common functions in smoother and planner #5537
Conversation
Signed-off-by: mini-1235 <[email protected]>
Signed-off-by: Maurice <[email protected]>
Signed-off-by: mini-1235 <[email protected]>
theta = atan2(dy, dx); | ||
pt_yaw = tf2::getYaw(path.poses[1].pose.orientation); | ||
if (fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) { | ||
if (!is_holonomic && fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) { |
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.
When writing the unit tests, I find this block confusing 🤕
I don't understand why only idx 2 and idx 1 are checked for the reverse segments, can't the reverse segment be in the middle or the end of the path?
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.
This function is run on path segments that have already been segmented by orientation changes, so we know they should all be in the same direction before this function is called. This is to check whether this already segmented path segment is forward or reversing
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.
Sorry for asking a lot of questions, I will go through the code in Planner and Smoother again once I have done the controller stuffs
theta = atan2(dy, dx); | ||
pt_yaw = tf2::getYaw(path.poses[1].pose.orientation); | ||
if (fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) { | ||
if (!is_holonomic && fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) { |
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.
This function is run on path segments that have already been segmented by orientation changes, so we know they should all be in the same direction before this function is called. This is to check whether this already segmented path segment is forward or reversing
Check out the failing test in CI, otherwise LGTM! |
Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: mini-1235 <[email protected]>
Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: mini-1235 <[email protected]>
Signed-off-by: Maurice <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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 think you said you were going to get back to me with something in #5537 (comment). Is this now ready to merge?
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Description of how this change was tested
Future work that may be required in bullet points
For Maintainers:
backport-*
.