First time here? Check out the FAQ!


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

Does rostopic echo no longer work for arrays?

asked Aug 14 '13

mattadc gravatar image

updated Aug 14 '13

Recently switched to groovy and rostopic doesn't seem to be able to handle arrays anymore. Does anyone know why?

Example for me, from a simple topic with a list of doubles: rostopic echo /robot/joint_states/position[1]

Results in:

Traceback (most recent call last):   File "/opt/ros/groovy/bin/rostopic", line 35, in <module>
    rostopic.rostopicmain()   File "/opt/ros/groovy/lib/python2.7/dist-packages/rostopic/__init__.py", line 1666, in rostopicmain
    _rostopic_cmd_echo(argv)   File "/opt/ros/groovy/lib/python2.7/dist-packages/rostopic/__init__.py", line 1026, in _rostopic_cmd_echo
    _rostopic_echo(topic, callback_echo, bag_file=options.bag)   File "/opt/ros/groovy/lib/python2.7/dist-packages/rostopic/__init__.py", line 692, in _rostopic_echo
    index = submsg_class.__slots__.index(field) ValueError: 'position[1]' is not in list`
Preview: (hide)

Comments

Are you sure that that topic is correct? Can you update this question with the results of rostopic info /robot/joint_states ?

SL Remy gravatar image SL Remy  ( Aug 15 '13 )edit

3 Answers

Sort by » oldest newest most voted
2

answered Aug 15 '13

Dirk Thomas gravatar image

updated Aug 15 '13

It looks like a regression of https://github.com/ros/ros_comm/issues/242

It is fixed in https://github.com/ros/ros_comm/commit/2af3d693645f084086ef0a5c50f9b666ea0fc1fd and will be available with the next ros_comm release (1.9.48).

Preview: (hide)

Comments

Yes, this fixed the problem. Thank!

mattadc gravatar image mattadc  ( Aug 16 '13 )edit
0

answered Aug 15 '13

mattadc gravatar image

updated Aug 15 '13

My topic is correct. It's a standard sensor_msgs/JointState message type, so it does have a field position that's a float64 array.

Output of rostopic info is:

Type: sensor_msgs/JointState

Publishers: * /realtime_loop (http://p1307010:33103/)

I tried the echo of ...position/data[1] and also get an error, but a different one:

Traceback (most recent call last): ...snip...
File "/opt/ros/groovy/lib/python2.7/dist-packages/genpy/message.py", line 532, in _get_message_or_service_class raise ValueError("message type is missing package name: %s"%str(message_type)) ValueError: message type is missing package name: float64[]

Preview: (hide)
0

answered Aug 15 '13

SL Remy gravatar image

This seems as if you expect an array of positions, but according to the the wiki, the array value is in data object .. something like rostopic echo /robot/joint_states/position/data[1] should work (assuming that the namespace is correct.. and that you really expected an array of joint states to be published.. then there's another issue)

Preview: (hide)

Question Tools

Stats

Asked: Aug 14 '13

Seen: 1,584 times

Last updated: Aug 15 '13