Skip to content

readrobotstate

Salvo Virga edited this page Jun 6, 2019 · 15 revisions

Read the robot state

Once you have ROSSmartServo running and connected to a ROS Master, you are able to read the current state of the robot from ROS topics.

The following topics are available :

  • Position of the robot joints on /iiwa/state/JointPosition

  • Torque values of the robot joints on /iiwa/state/JointTorque

  • External torques applied to the robot on /iiwa/state/ExternalJointTorque

  • Current velocities values of the robot joints on /iiwa/state/JointVelocity

  • A combination of joints' positions and velocities on /iiwa/state/JointPositionVelocity

  • ROS's JointState of the robot on /iiwa/state/joint_states

  • Cartesian Pose of robot (or tool) TCP on /iiwa/state/CartesianPose

  • Cartesian Wrench of robot (or tool) TCP on /iiwa/state/CartesianWrench

  • Signal that the robot reached its commanded destination on /iiwa/state/DestinationReached

As for any topic in ROS, you can print out its stream from a command line using rostopic echo, here is an example for the JointPosition topic :
rostopic echo /iiwa/state/JointPosition.
The same applies to any other of the aforementioned topics.

C++ Interface in iiwa_ros

From code, you can simply create a Subscriber within a ROS Node to the topic you want.
You can easily learn that from the ROS Tutorials.

Additionally, we provide helper classes in the iiwa_ros package that handle all the functionalities you might need.
You could directly use these classes in your own ROS package to read from any of the mentioned topics.
Let's see an example that reads from /iiwa/state/CartesianPose:

TBA

iiwa_ros has a bunch of useful classes to use the ROS topics (to read and command the robot) and the ROS services (to change control mode, change velocity/acceleration and get the time left to destination). You should check it out.

Clone this wiki locally