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

Revision history [back]

You're almost there, but there is a difference between how rosserial constructs vectors to the rest of ROS. rosserial doesn't use std::vector objects, the overhead is too high for the embedded platform so they use simple C pointer and length arrays in instead.

So in your case you need to set the data member as you have but you also need to set the data_length member to 2 in this case. This is explained here.

Hope this helps.