0
$\begingroup$

Rosanswers logo

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.

Thoughts?


Originally posted by jcicolani on ROS Answers with karma: 3 on 2014-08-12

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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 make_libraries.py .

See: http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup#Install_ros_lib_into_the_Arduino_Environment

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


Originally posted by Wolf with karma: 7555 on 2014-08-13

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

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   make_libraries.py .

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

Regards


Originally posted by Andromeda with karma: 893 on 2014-08-13

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by jcicolani on 2014-08-13:
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.

Comment by Andromeda on 2014-08-13:
ignore it. I use without problems rosserial_arduino and I get always the message about map_msgs

Comment by jcicolani on 2014-08-13:
Map_msgs isn't the problem. It also failed to generate the libraries for my custom messages, which I need.

Comment by Andromeda on 2014-08-14:
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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.