View Full Version : rosserial_arduino: helloworld tutorial, "fixing" with ROS_PACKAGE_PATH

09-18-2011, 08:39 AM
I have a 64bit ubuntu 11.04 system with a full ROS install. Some servos--some modified for full rotation, some standard configuration, some sensors, among them a Ping, and an Arduino Diecimila. Once I discovered rosserial, I figured this would be enough to at least "play" with ROS until I can make the investment in more advanced hardware.

I didn't have much trouble making my way through the ROS beginner tutorials, but I'll admit the finer points of some of them could use a little reinforcement. But I decided I could probably try out some of the rosserial_arduino tutorials like Helloworld.

In the first tutorial where the Arduino IDE is configured, I found that the ros_lib folder was NOT in rosserial_arduino/libraries/, but rather rosserial_arduino/src/. But once I found it, I was able to copy it to /sketchbook/libraries/ and continue.

In the next tutorial, (Helloworld) I immediately got a bunch of error messages which seem to be related to include files in the include files not being where they were expected. Or at least, when I use roscd to go to those directories, I end up in /opt/ros/. . .etc/

I've tried modifying the paths and moving files around, but without much luck. But it occurs to me that I'd have to do this for ALL the files in all the tutorials that I wantt to run. (Which might not be such a bad thing as a learning experience. . .)

SO, I'm wondering if I need to change ROS_PACKAGE_PATH in order to configure my ROS and rosserial environment. I'm sure I'm missing some obvious gotcha that would be easy to see if I wasn't so noob.

09-18-2011, 02:11 PM
You need to "rosmake rosserial_arduino" to get the libraries directory. The "src/ros_lib" directory is the source for only the most basic of things, we generate a the message header files during compilation. The header files you find in /opt/ros/ are for regular roscpp (you'll note that they include dozens of Boost C++ headers, which flat out doesn't exist on the Arduino).


09-19-2011, 09:06 AM
That sounds likely--I'm going to review the first part of the beginner tutorials and try that as soon as I get back to my computer. Thanks Fergs.

09-19-2011, 04:55 PM
Well--It's fixed.

What I ended up doing is going through the first few tutorials all over again, duplicating any package installation/configuration instructions with rosserial_arduino--all the way from package creation to building, including installing dependencies--just in case.

One thing I noticed was that from time to time, ROS would forget where my ros_workspace was. I'd have to . setup.sh to get it to work again. (I suspect this may be why rosserial_arduino ended up in my home folder. Now everything is in ros_workspace.

Also, I opened up tomboy notes so I have records of what I did and how.

Unfortunately, I ran into a new problem--I get an error message "Lost sync with device, restarting. . ." when the arduino tries to publish. Apparently that's due to a deficiency of memory in my poor little old diecimila.

SO, that gives me an excuse to go after a mega 2560. . .

Thanks again Fergs!