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

The standard settings use lots of RAM. If you edit ros_lib/ros.h (or ros_lib/ros/node_handle.h) you can change

  typedef NodeHandle_<ArduinoHardware> NodeHandle;

to what you want the MAX_SUBSCRIBERS, MAX_PUBLISHERS, INPUT_SIZE, and OUTPUT_SIZE to be.

On the pubsub.ino example, the default of <6,6,512,512> which uses 2.0K of dynamic memory (of the 2.5K available on my Atmega32U4) and isn't stable, as the OP mentioned. I changed it to use <2,2,100,100> which uses 1.1K of dynamic memory. Haven't tested it extensively yet, so may need to tune the buffers, but I don't need more than 2 subscribers or publishers (yet).