Categories
C/C++ Linux Posts Programming Robotics ROS

ROS: Publishing and Subscribing to Arrays

In ROS (Robot Operating System) it’s really easy to publish variables to be used between nodes running on the same roscore however I was having some difficulty doing the same for arrays. The problem came when there was no real examples of how to use them, so here is a working example of std_msgs/*MultiArray in CPP.

Publishing:

[gist][/gist]

Subscribing:

[gist][/gist]