-
Notifications
You must be signed in to change notification settings - Fork 89
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
controller_manager_->update uses a new timepoint #4
Comments
yea, that's a really good point! |
this compiles but could you check if it fixes the issue? thanks! |
Intuitively I would think that it works, and it is also how I've done it in my ur_modern_driver ( https://github.com/ThomasTimm/ur_modern_driver/blob/master/src/ur_ros_wrapper.cpp#L573 ) But apparently, and that is why I've raised this issue, that solution gave someone problems ( ros-industrial-attic/ur_modern_driver#44 ). I don't know what system @nikhilkalige uses, but maybe the implicit conversion from the An alternative solution would be to use |
Interesting. Let me know - when I'm back on hardware (and not theory/simulations) I can test this PR myself but I'm not sure when that will be. |
Using |
So, I think @miguelprada figured out why someone has issues with the solution I'm using in the ur_modern_driver and which you also suggested. CLOCK_MONOTONIC and CLOCK_REALTIME does not reference the same point in time, so when the absolute value acquired with CLOCK_MONOTONIC is converted to a ros::Time value, that timestamp is way off. I'm not sure I understand exactly how the two timing values for the controller->update() call is used (which is partly why I raised this issue), but I am guessing they don't need to be based off of the same time scale. The solution is thus pretty simple; Call
|
I've written some |
I've updated the PR to simply save the ros::time for use in the update loop... |
I didn't think about the ´read´ command needing the elapsed_time. Then I guess that PR should solve this issue. |
In the control loop in https://github.com/davetcoleman/ros_control_boilerplate/blob/jade-devel/src/generic_hw_control_loop.cpp#L69 a timestamp is fetched in line 72 with clock_gettime(), but when you call the update function in line 92, a new timestamp is used.
The read-function in-between on line 89 is not realtime safe, so you risk an arbitrary big difference between these two timestamps.
Would it not be more correct to reuse the current_time timestamp in the call to update, especially if the duration of the read-call is varying?
The text was updated successfully, but these errors were encountered: