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

Revision history [back]

If I understand you correctly you have a node which controls the servo and listens to the topic servo which has type std_msgs/Uint16. Messages published to this topic will control the position of the servo. Is this correct?

In this case you should be able to create a publisher to this topic within your lidar node which simply publishes a new std_msgs/Uint16 message whenever you need to move the servo. It is best to use two nodes one which directly connects to the servo via the arduino and another which processes the lidar data, and connect them using the topic. This way you keep the different functionality in separate nodes, you don't want to directly control the servo from the same node that's processing the lidar data.

Hope this makes sense.