ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The standard convention for controllers in the ROS ecosystem is to receive a full geometry_msgs/Twist message and use that to generate actuator commands. There is no standard way of selecting only some fields of the message as valid, while others are ignored. Your suggestion of forwarding velocities via messages between threads indeed sounds troublesome, as various race-conditions could result.

I see some viable approaches, for all some changes in the controller receiving the commands are required:

  • Use geometry_msgs/Twist, set all values you don´t want to set to NaN. Your controller would check for that and only update it´s internals using only the non-NaN fields. Note that this could results in some disastrous results when sending to a controller that does not honor this "ignore NaN" convention.
  • Use separate topics for angular and linear velocities (if you only send linear x, a std_msgs/Float64 would be an obvious choice for example). This requires the addition of a few new subscribers in your controller
  • Wrap geomety_msgs/Twist in a new message that contains additional fields that select which fields are valid and should be used

That´s my ideas, maybe others have others to offer? :)