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

Revision history [back]

click to hide/show revision 1
initial version

The most common way to exchange information with a running ROS node is by exchanging messages published to topics. You can find descriptions of the relevant concepts in the start guide and in particular, examples of how to subscribe and publish to topics using Python in the tutorials.

In your particular use-case, you should probably subscribe to the /joint_states topic to receive information about the current state of the robot and then reformat it and send it to the NN in whichever format it expects.

In order to command your robot with the output of your NN you'll need to do a bit more work. The default configuration of the ur_modern_driver uses a configuration expecting complete joint trajectories to be sent to it, and then the driver will take care of commanding the robot to follow that trajectory. Not sure what your NN is producing and how fast. You can definitely abuse the joint trajectory controller by sending single point trajectory messages. Alternatively, you can configure a new controller that accepts 6d joint position commands in a similar way as the joint_group_vel_controller is defined.