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

Arduino IDE does not find msg header

asked 2014-08-12 23:10:27 -0500

jcicolani gravatar image

I'm trying to learn rosserial_arduino. I've worked through the tutorials and am now going back and walking through them with my own code. My initial test code will use rosserial_arduino to turn 8 LEDs on and off. I've created the package (arduino) and a custom message called 8Leds.msg. I added the lines per the tutorials to package.xml and CMakeLists.txt. I source my files and run catkin_make. Everything seems to compile properly and the 8Leds.h file is created in devel/include/arduino. However, when I try to compile the sketch for the arduino I get this error:

In file included from light_8_leds_test.ino:2:0: /home/jcicolani/catkin_ws/devel/include/arduino/8Leds.h:42:18: fatal error: string: No such file or directory compilation terminated.

I don't get it. It's even showing the exact path and file name.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-08-13 01:30:51 -0500

Wolf gravatar image

You need to run the following again everytime you changed/added msg files in your workspace:

  cd <sketchbook>/libraries
  rm -rf ros_lib
  rosrun rosserial_arduino .


Note that your arduino code needs to be compiled against the headers in your <sketchbook>/libraries folder, not against those in your catkin workspace....

edit flag offensive delete link more

answered 2014-08-13 01:32:15 -0500

Andromeda gravatar image

updated 2014-08-13 01:33:49 -0500

Navigate to your sketchbook folder and try to compile the libraries for arduino again. Simply do again the following steps (like in this tutorial).

cd <sketchbook>/libraries    
rm -rf   ros_lib   
rosrun rosserial_arduino .

You have created the msg files for ROS but they must be compiled for Arduino too. Running the above command you should get them compiled


edit flag offensive delete link more


I ran the commands. However, I am now getting: * Warning: failed to generate libraries for the following packages: * map_msgs arduino

All of the help I've seen in my Google and ROS Answers searches to date say to ignore the map_msgs (fine, not using it anyway) but there is nothing on troubleshooting what causes it or how to track down the problem for custom messages.

jcicolani gravatar image jcicolani  ( 2014-08-13 13:17:36 -0500 )edit

ignore it. I use without problems rosserial_arduino and I get always the message about map_msgs

Andromeda gravatar image Andromeda  ( 2014-08-13 13:36:42 -0500 )edit

Map_msgs isn't the problem. It also failed to generate the libraries for my custom messages, which I need.

jcicolani gravatar image jcicolani  ( 2014-08-13 13:56:11 -0500 )edit

Do you mean, that after running the python-script again doesnt create any folder with your message definition in your ~/sketchbok/libraries ? You should see in ros_lib a new flder with the same name of your custom msg. Inside there are the .h files

Andromeda gravatar image Andromeda  ( 2014-08-14 01:20:38 -0500 )edit

Question Tools


Asked: 2014-08-12 23:10:27 -0500

Seen: 1,664 times

Last updated: Aug 13 '14