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

Revision history [back]

Okay, there are few things I could suggest. Can you show us the code you're running on your arduino. Have you updated this so that it's listening on the servo topic for std_msgs::Uint16MultiArray messages? Is the error being produced by the rosserial node or the rostopic pub node?

All the MultiArray messages include the layout information which describes the number of dimensions of the arrayed data. You need to specify this on the command line as well.

Hope this helps.

Okay, there are few things I could suggest. Can you show us the code you're running on your arduino. Have you updated this so that it's listening on the servo topic for std_msgs::Uint16MultiArray messages? Is the error being produced by the rosserial node or the rostopic pub node?

All the MultiArray messages include the layout information which describes the number of dimensions of the arrayed data. You need to specify this on the command line as well.

Hope this helps.

UPDATE:

I think I've spotted something, if you're running exactly the following command:

~$  rostopic pub servos std_msgs/UInt16MultiArray '{data:[servo1,servo2]}'

Are you trying to publish the contents of the two topics servo1 & servo2 as a MultiArray message? If so that's not how this works. The UInt16MultiArray stores an array of base Uint16 values not UInt16 messages, so you need to give it literal values as shown below:

~$  rostopic pub servos std_msgs/UInt16MultiArray '{data:[400, 300]}'

You can try this quickly from the command line to see if it works. To make this work with your publish node too you'll need to modify it so it publishes a single std_msgs/UInt16MultiArray message containing the two values instead of two separate UInt16 messages.