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

rosserial arduino use PROGMEM in ros_lib

asked 2014-09-22 06:28:41 -0600

Wolf gravatar image

updated 2014-09-24 01:26:11 -0600

Hi all,

as stated here ( ) adruinos usually do not have much SRAM and it is easy to use it all up by using many constant strings

Notice that there's not much SRAM available in the Uno. It's easy to use it all up by having lots of strings in your program.

<sarcasm warning> The nice feature of the arduino IDE in this cases is that it does not fail to compile or upload but only the arduino programm will run 'strangely' </sarcasm warning>

If you run out of SRAM, your program may fail in unexpected ways; it will appear to upload successfully, but not run, or run strangely. To check if this is happening, you can try commenting out or shortening the strings or other data structures in your sketch (without changing the code). If it then runs successfully, you're probably running out of SRAM.

I have observed this behaviour with my arduino code that uses ros_lib. One of the causes is that ros_lib stores for each topic (publish/subscribe) 3 strings ( md5sum, message type name and topic name ). Particularly if I use topics with namespaces if have observed the problem on arduino uno after setting up only 3 or 4 topics.

How the question: Has anyone considered modifying the message generator for Ardunio such that it uses PROGMEM for storing md5sum, topic and stuff? (Or is it even possible?)

The data is static and I think this would significantly reduce the SRAM usage....

Thank you!

Edit 22.09.: anyone?

edit retag flag offensive close merge delete


You might want to try and just report this as an issue over at the ros-drivers/rosserial github repo. Do refer to this post in your issue.

gvdhoorn gravatar image gvdhoorn  ( 2014-09-24 01:45:39 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-25 12:50:35 -0600

Wolf gravatar image

I forked from rosserial and created a REPO that supports PROGMEN usage for the ros relevant constant strings on arduino. There is a pending pull request.

Until then, anybody interested in this can clone into my fork:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-09-22 06:28:41 -0600

Seen: 3,638 times

Last updated: Mar 25 '15