-
Notifications
You must be signed in to change notification settings - Fork 122
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
Fix platooning_control #2417
Fix platooning_control #2417
Conversation
@@ -359,7 +359,7 @@ namespace platooning_control | |||
double dx1 = trajectory_points[trajectory_points.size()-1].x - trajectory_points[0].x; | |||
double dy1 = trajectory_points[trajectory_points.size()-1].y - trajectory_points[0].y; | |||
double d1 = sqrt(dx1*dx1 + dy1*dy1); | |||
double t1 = rclcpp::Time((trajectory_points[trajectory_points.size()-1].target_time)).seconds() - rclcpp::Time(trajectory_points[0].target_time).nanoseconds(); | |||
double t1 = rclcpp::Time((trajectory_points[trajectory_points.size()-1].target_time)).seconds() - rclcpp::Time(trajectory_points[0].target_time).seconds(); |
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.
changing from nanosec to sec, has any impact somewhere else?
I dont remember if it does
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 kept this in seconds since were using seconds precision in the earlier implementation and the speed is being calculcated as m/s
double t1 = (trajectory_points[trajectory_points.size()-1].target_time.toSec() - trajectory_points[0].target_time.toSec()); |
But using nanoseconds instead is probably better to do since rounding of mps can have greater impact on mph speed. Updated
This PR also needs https://github.com/usdot-fhwa-stol/carma-vehicle-calibration/pull/127, which updates parameters for pure pursuit Update: The PR above was closed - as logic to handle multiple activated plugins will be added as a separate story. |
Now that the scope of changes has been adjusted for this PR (i.e. not introducing a command timeout), can we please update the PR description, and also mention the two specific fixes that are included in this changeset (changing the control topic for platooning_control and fixing the seconds vs. nanoseconds bug)? |
|
PR Details
This PR adds a fix to the platooning_control node which was recently ported to ros2.
Fixes a bug in delta time calculation for trajectory speed and updates the duration to be in nanoseconds.
Fixes the control topic in the trajectory_executor node to reference updated name of platooning_control package.
Description
Related GitHub Issue
Related Jira Key
https://usdot-carma.atlassian.net/browse/CAR-6012
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: