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

Sleep accurate duration on ros2_control_node #302

Merged
merged 4 commits into from
Jan 25, 2021

Conversation

youtalk
Copy link
Contributor

@youtalk youtalk commented Jan 21, 2021

Current main loop of the ros2_control_node doesn't cycle under correct update_rate because it ignores the computation time of read, update, and write methods.
This PR fixed the problem.

I know we won't need this PR if #260 would be solved but I need it now.

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one style comment... otherwise LGTM

controller_manager/src/ros2_control_node.cpp Outdated Show resolved Hide resolved
controller_manager/src/ros2_control_node.cpp Outdated Show resolved Hide resolved
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much @youtalk !

@bmagyar bmagyar merged commit fb80431 into ros-controls:master Jan 25, 2021
@youtalk youtalk deleted the accurate-sleep branch January 25, 2021 21:57
mahaarbo pushed a commit to mahaarbo/ros2_control that referenced this pull request Feb 4, 2021
* measure duration

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

* fix lint

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

* Apply suggestions from code review

Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>

* check sleep time is > 0

Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
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.

None yet

3 participants