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

Revision history [back]

There are many choices/design decisions to take at this point.

  1. The simplest idea is to publish the distance value as a latched topic. Then, in your second program, please make a subscriber, listening to the published topic. This way, you can easily get the distance value in your second program.
  2. Another approach could be making use of ROS Service. On the first program (node), please make a service server that returns the distance from the object. Then, please create a service client on the second program (node) to get the distance value.

Once you have the distance value, you can execute the move command.