ros-controls / ros_controllers

Generic robotic controllers to accompany ros_control
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
565 stars 525 forks source link

Make ForwardCommandController and ForwardJointGroupCommandController thread-safe #157

Open adolfo-rt opened 9 years ago

adolfo-rt commented 9 years ago

There is currently no synchronization between the non-rt thread that executes the subscriber callback and the rt thread that runs the controller update method. A realtime_tools::RealtimeBuffer could be used to fix this, as is done in other controllers.

The subject was originally brought up in this ros-answers discussion.

adolfo-rt commented 9 years ago

@ipa-fxm you should be aware of this, as I believe you use these controllers.

fmessmer commented 9 years ago

Thanks for the hint... Although we haven't experienced any problem with the current version, I guess #160 fixes this issue.

fmessmer commented 9 years ago

161 fixes it for the forward_command_controllers

However, similar race conditions might occur in other controllers e.g. effort_controllers/JointPositionController as they are using a shared member here