-
Notifications
You must be signed in to change notification settings - Fork 2
Better trajectory republishing #270
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
base: noetic-devel
Are you sure you want to change the base?
Conversation
sr_utilities_common/scripts/sr_utilities_common/republish_trajectory_v2.py
Outdated
Show resolved
Hide resolved
sr_utilities_common/scripts/sr_utilities_common/republish_trajectory_v2.py
Outdated
Show resolved
Hide resolved
chrisw-shadow
left a comment
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.
jolly good pr
sr_utilities_common/scripts/sr_utilities_common/republish_trajectory_v2.py
Outdated
Show resolved
Hide resolved
sr_utilities_common/scripts/sr_utilities_common/republish_trajectory_v2.py
Outdated
Show resolved
Hide resolved
sr_utilities_common/scripts/sr_utilities_common/republish_trajectory_v2.py
Show resolved
Hide resolved
sr_utilities_common/scripts/sr_utilities_common/republish_trajectory_v2.py
Outdated
Show resolved
Hide resolved
| republisher.publish(data) | ||
|
|
||
| def spin(self): | ||
| while not rospy.is_shutdown(): |
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 loop will attempt to run at full speed forever. Add a rospy.sleep (~1s should be fine)
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.
Proposed changes
Improved the republish_trajectory tool to be more robust to variance in message publishing timings.
The tool is intended to republish the trajectory command msgs being played from a bag file with the timestamp of all commands shifted to be in the present.
The timestamps are shifted to be 10ms in the future from when they are republished to ensure they never arrive late at the trajectory controller.
The old version of the republish node used the time of msg receipt as the new timestamp for all trajectory commands; a method which works but is susceptible to timing variance.
The new version of the node records the msg timestamp and receipt time of the very first message and uses those values to consistently time-shift all msgs. The command msgs are shifted an additional 10ms into the future to ensure they always arrive at the trajectory controller before they are meant to be executed.
Checklist
Before posting a PR ensure that from each of the below categories AT LEAST ONE BOX HAS BEEN CHECKED. If more than one category is applicable then more can be checked. Also ensure that the proposed changes have been filled out with relevant information for reviewers.
Tests
Documentation