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

alas, Int32 =/= Int32[]

You'll need to define you're publisher to publish arrays (in your case, you can use Int32MultiArray.msg).

In python, (without knowing the contents of self.create_publisher()) that could look something like:

from std_msgs.msg import Int32MultiArray

...

self.publisher = self.create_publisher(
    Int32MultiArray,
    'wheel_settings',
    10)
...

msg = Int32MultiArray()
msg.data = [1, 1, 1]
pub.publish(msg)

alas, Int32 =/= Int32[]

You'll need to define you're your publisher to publish arrays (in your case, you can use Int32MultiArray.msg).

In python, (without knowing the contents of self.create_publisher()) that could look something like:

from std_msgs.msg import Int32MultiArray

...

self.publisher = self.create_publisher(
    Int32MultiArray,
    'wheel_settings',
    10)
...

msg = Int32MultiArray()
msg.data = [1, 1, 1]
pub.publish(msg)