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

Revision history [back]

You have to allocate the arrays, when you're trying to access dim[] and data[] you haven't yet allocated it to have any size or inserted something into it.

E.i.

thing = std_msgs/MultiArrayDimension()
thing.label = "x"
thing.size = 1
thing.stride = 1
arg.layout.dim.append(thing)

You have to allocate the arrays, when you're trying to access dim[] and data[] you haven't yet allocated it to have any size or inserted something into it.

E.i.

thing = std_msgs/MultiArrayDimension()
MultiArrayDimension()
thing.label = "x"
thing.size = 1
thing.stride = 1
arg.layout.dim.append(thing)