Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Note: rostopic echo can actually print individual fields. The grep should not be needed, nor a custom node.

See the rostopic echo documentation:

echo <topic-name/field>

Display specific fields in a message.

$ rostopic echo /my_topic/field_name

Note: rostopic echo can actually print individual fields. The grep should not be needed, nor a custom node.

See the rostopic echo documentation:

echo <topic-name/field>

Display specific fields in a message.

$ rostopic echo /my_topic/field_name

And see #q54895 for a previous question about this.

For JointState:

rostopic echo /joint_states/position

should work

I made a node (using the rospy tutorial) to subscribe to /joint_states and I want the.py script to print() just the position list for use outside ROS, not the whole topic.

rostopic echo can actually print individual fields. The grep should not be needed, nor a custom node.

See the rostopic echo documentation:

echo <topic-name/field>

Display specific fields in a message.

$ rostopic echo /my_topic/field_name

And see #q54895 for a previous question about this.

For JointState:

rostopic echo /joint_states/position

should work