Page 1 of 5

ROS (Robot Operating System) on RPi

Posted: Fri May 25, 2012 5:50 pm
by mkopack
Found this last night while trying to figure out how to get ROS installed on the Pi... ... spberrypi/

I'm going through the instructions right now and will report back if they work. My first try using the turtlesim.cpp that they provide in the how-to resulted in compile failure, so I'm trying again without changing out the one that comes in ROS.

Re: ROS on RPi

Posted: Fri May 25, 2012 8:07 pm
by jeem
I am definitely interested in this topic. Please keep us informed.

Re: ROS on RPi

Posted: Fri May 25, 2012 9:36 pm
by mkopack
Well, so far no go. It keeps having issues when trying to compile up turtlesim.cpp. Seems like the std::max() function being called in turtlesim.cpp lines 136, 162, 163 can't be found.

I'm running on Raspbian-r3 so I don't know if that's got anything to do with it. Kinda frustrating. I'll have to poke around with it more tonight when I get home from work.

Re: ROS on RPi

Posted: Fri May 25, 2012 9:48 pm
by mkopack
Ok, just noticed that there's a couple of things the ROS install page tells you to do if you're running on a version of Debian > Squeeze (Raspbian is based on Wheezy), so I'll give those a try when I get home tonight.

Re: ROS on RPi

Posted: Sat May 26, 2012 3:06 am
by mkopack
Eh, still no luck. Getting the following error:

[ 92%] Building CXX object ros_tutorials/turtlesim/CMakeFiles/turtlesim_node.dir/src/turtle.cpp.o
/home/mkopack/ros-underlay/ros_tutorials/turtlesim/src/turtle.cpp: In member function ‘bool turtlesim::Turtle::update(double, QPainter&, const QImage&, qreal, qreal)’:
/home/mkopack/ros-underlay/ros_tutorials/turtlesim/src/turtle.cpp:132:58: error: no matching function for call to ‘max(double, qreal)’
/home/mkopack/ros-underlay/ros_tutorials/turtlesim/src/turtle.cpp:132:58: note: candidates are:
/usr/include/c++/4.6/bits/stl_algobase.h:210:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
/usr/include/c++/4.6/bits/stl_algobase.h:254:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)

Anyone have any ideas???

Re: ROS on RPi

Posted: Sat May 26, 2012 4:03 am
by mkopack
Ok, the original author of the instructions got back to me. Turns out he posted the wrong file to replace...

Also, if you follow the directions, make sure you grab that turtle.cpp file, but you need to do a "Save As" because for some reason the site tries to save it as a BMP file. It IS a .cpp though if you do the save as. Just replace the one that ROS downloads when doing it's setup with that one and you should be good to go. I'm cranking right along past that roadblock now.

Will report when I get done.... (Might not be until Monday though as I need to switch to doing grad school project work tomorrow...)

Re: ROS on RPi

Posted: Sat May 26, 2012 5:26 pm
by mkopack
I've gotten quite a bit farther.. but still at another stuck point.

First off, Raspbian sets up /tmp to be a RAMdisk. This causes problems during the install process as there's not enough space to unpack some of the packages used by ROS. I've posted the things I've had to do to get around the problem up on the link I put at the start of this thread, along with a link to the issue that somebody else ran into.

Basically it seems like the new ROS version (Fuerte) hasn't completely been set up for debian correctly...

So, I have to say, if you want to use ROS on the RPi right now, you might be best off trying to use the standard debian build rather than raspbian. It'll be slower, but seems like it's better supported at this point (or at least less install headaches.)

Re: ROS on RPi

Posted: Tue May 29, 2012 12:22 am
by mkopack
OK, so I determined that there's a couple additional packages you need to install..

eigen3: this one is in the raspbian repository: apt-get install libeigen3-dev libeigen3-doc
I had to create a txt file in /usr/include/eigen3/ called "eigen-version.installed" and I put just a line containing 3.0.5 in it (which is the most recent version at this time.)

flann - this one is in the raspbian repository: apt-get install libflann-dev flann-doc
(You might also want to get libflann1.7 libopencv-flann-dev libopencv-flann2.3) ??

pcl: this exists in the raspbian repository: libpcl1 libpcl1-dev

assimp: this exists in the raspbian repository, but I don't know which version it uses as there's both libassimp and libassimp2. I am going with 2: sudo apt-get install libassimp2-d-dev libassimp2


Unfortunately, I can't figure out how to go about building this one. When I try to do the CMake instructions it just gives me a bunch of errors. I have no idea what I'm doing with CMake....

Anyone able to help?

Re: ROS on RPi

Posted: Wed May 30, 2012 1:25 am
by mkopack
Ok, well, I managed to get the cmake to work:

The ROS instructions tell you to add 2 settings to your .bashrc to point gcc and g++ to versions 4.5. When you go to do cmake for yaml-cpp that screws up cmake. So you have to temporarily remove those and logout/back in, then go to the yaml-cpp/ directory and do cmake /src/build

Once that's done, go into src/build and do: make and when that finishes, sudo make install

Add those 2 lines back into your .bashrc and log out / in.

Unfortunately I'm STILL getting the same error:

mkopack@raspbian:~$ rosdep install -a
Executing script below with cwd=/tmp
export PREFIX=/usr/
if [ -f $PREFIX/include/assimp/assimp-version.installed ]; then
[ 2ed0b9954bcb2572c0dade8f849b9260 = `cat $PREFIX/include/assimp/assimp-version.installed` ]


Executing script below with cwd=/tmp
export PREFIX=/usr/
[ f932cebad87302d8ea0ec1fd39b24d99 = `cat $PREFIX/include/eigen3/eigen-version.installed` ]


Executing script below with cwd=/tmp
set -o errexit
dpkg-query -W -f='${Package} ${Status}\n' yaml-cpp-sourcedep 2>&1 | awk '{\
if ($4 =="installed")
exit 0
print "yaml-cpp-sourcedep not installed"
exit 1}'


yaml-cpp-sourcedep not installed
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rxtools: Cannot locate rosdep definition for [swig-wx]
rosconsole: No definition of [log4cxx] for OS version []
image_rotate: Cannot locate rosdep definition for [opencv2]
image_proc: Cannot locate rosdep definition for [opencv2]
rviz: No definition of [qt4-qmake] for OS [debian]
image_view: Cannot locate rosdep definition for [opencv2]
cv_bridge: Cannot locate rosdep definition for [opencv2]
python_qt_binding: No definition of [python-qt-bindings] for OS [debian]
roslib: No definition of [boost] for OS version []
opencv2: Cannot locate rosdep definition for [opencv2]
gazebo: No definition of [tbb] for OS [debian]
image_geometry: Cannot locate rosdep definition for [opencv2]
cv_markers: Cannot locate rosdep definition for [opencv2]
opende: No definition of [libtool] for OS version []
stereo_image_proc: Cannot locate rosdep definition for [opencv2]
opencv_tests: Cannot locate rosdep definition for [opencv2]
turtlesim: No definition of [qt4-qmake] for OS [debian]
pcl_ros: Cannot locate rosdep definition for [pcl]
depth_image_proc: Cannot locate rosdep definition for [opencv2]
camera_calibration: Cannot locate rosdep definition for [opencv2]
stage: No definition of [libtool] for OS version []

I'm totally stumped. If anyone has ideas, I could really use some help. Otherwise I might have to punt on Raspbian and go back to normal Debian for now.

Re: ROS on RPi

Posted: Thu May 31, 2012 12:06 am
by mkopack
Well, tried to get Fuerte up on Debian and ran into the EXACT same problems...

Giving Electric a try now... gonna take a while to build and install though... Will report once I have something to report!

Re: ROS on RPi

Posted: Thu May 31, 2012 3:40 am
by mkopack
Ok, I can report at least some initial success, and I'll have to test more tomorrow when I get home from work...

The key is, use electric instead of Fuerte. Fuerte has only been out about a month or so, and it obviously has issues with Debian. Electric is about a year old and thus us a lot more mature.

I simply followed these directions:

(This was on the base Debian install from 4-19-2012. Haven't tried on Raspbian yet... probably this weekend...)

You SHOULD be good to go though. About the only thing I've had to do so far while starting to go through the tutorials is add my new beginner_tutorials package to the ROS_PACKAGE_PATH environment variable.

So, let's get cracking gang!!!!

Re: ROS on RPi

Posted: Thu May 31, 2012 6:52 pm
by speculatrix
Just a thought, but if this is running reliably, would you be willing to post an image somewhere of Debian + ROS?

Re: ROS on RPi

Posted: Thu May 31, 2012 7:10 pm
by mkopack
To be honest, I wouldn't have a clue how to go about making it... especially since a lot of it gets installed into your user directory, so you really need to build it yourself.

It's really a pretty easy install (for Electric). All I did was:

1) Make a fresh SD card from the Debian 4-19-2012 image
2) created an account
3) added account to /etc/sudoers file
4) installed RPI-update and ran that
5) did a sudo apt-get update
6) did a sudo apt-get upgrade
7) followed the steps on the install page for Electric. That part takes a long time, but most of it is just leaving it go do it's thing...

Re: ROS on RPi

Posted: Fri Jun 01, 2012 8:11 am
by speculatrix
Okay, no worries. I'll have a go at doing this myself, just as soon as my RPi arrives ;)

FYI, I do backups of all my SD card-based distros (which I'm using on a couple of BeagleBones) using dd on a Linux laptop. My laptop runs Ubuntu and mounts the SD card as /dev/sdb, so I grab an image of the card & store it in the images directory within my home dir using:

Code: Select all

sudo dd bs=1M if=/dev/sdb of=~/images/imagename.img
Then I can set up a new card with the identical image using:

Code: Select all

sudo dd bs=1M if=~/images/imagename.img of=/dev/sdb
(This entirely overwrites the SD card erasing any existing data on it).

Re: ROS on RPi

Posted: Fri Jun 01, 2012 11:51 am
by mkopack
Oh and I should mention that I still couldn't get it to work on Raspbian, so stick with the normal Debian release for now...

Electric kept wanting libboost-1.42-dev-all, and even though I installed v.1.49 it still kept insisting it needed to find 1.42, and refused to continue. 1.42 doesn't exist in the Raspbian repository, so I gave up...

Installing the serial and ROS-java core stacks now, and will try to get one of the kinect related ones working as well this weekend... (once I knock out my last grad school assignment for the quarter that is...)

Re: ROS on RPi

Posted: Sun Jun 24, 2012 10:58 pm
by mkopack
Ok, so I'm giving this another go on Raspbian today... Fuerte is still no go, but I've managed to get past the issue with Electric where it was looking for a specific version of Boost that wasn't available on Raspbian. Instead I went through the Electric instructions here:

This will fail while doing the step:

rosinstall ~/ros " ... overlay=no"

As it looks for libboost1.42-all-dev

I then went into the ~/ros/ros/rosdep.yaml file. Do a search for boost. You'll see a line for squeeze that specifies libboost1.42-all-dev, but then on the following line, for Wheezy it only has libboost-all-dev. Since Raspbian is more a version of Wheezy than Squeeze, I just changed the Squeeze line to match the Wheezy one.

Then rerun the step:
rosinstall ~/ros " ... overlay=no"

Sit back and wait a LONG while (roscpp alone took over an hour to compile...) Mine is still going but I'll report back after it finishes building. Hopefully I'll be able to get the tutorials to go and if so then I'll install some other stacks...

Re: ROS on RPi

Posted: Wed Jul 04, 2012 11:52 am
by mentar
mkopack thanks for sharing these headaches with us I got my Pi last week and have been itching to use it with ROS for my robotics projects!
Please keep us updated, I'll try to follow your steps over the next few days, and want to get a ready-to-use SD card image for people to get stuck in!

Re: ROS on RPi

Posted: Wed Jul 04, 2012 4:22 pm
by pygmy_giant
Had my Pi a while but have been fannying about as I'm not sure whats the best distro to use - all I want is access to GPIO / I2C via C++ in real time - ROS seems like a good option if you can get it ported. :)

Re: ROS on RPi

Posted: Thu Jul 05, 2012 12:20 pm
by mentar
I've just found instruction on the ROS wiki on how to setup-up ROS on the RPi here may be of help to some, but be warned that it takes a while to install, all the more reason to make an SD card image!

Re: ROS on RPi

Posted: Thu Jul 05, 2012 1:13 pm
by mkopack
Yes, those are the instructions that I tried to follow, this is just a new page that the original author put together (along with contributions from me on getting things working on Raspbian... which largely mimics what I've posted here...)

Basically - if you want Fuerte, you need to stick with the base Debian distro (the one from April.) That kinda sucks because it doesn't support hardfp, which would be useful for things like CV and such.

If you can live with Electric, give the Raspbian image a try.

And yes, it takes a LONG time to install! Even just compiling things in the tutorials will take a while on the RPi.

Good luck guys, and let us know if you manage to make Fuerte work on Raspbian (I've pretty much hit a brick wall.) I really need Fuerte up since we're going to be using it for my new project at work, and I was hoping to use the RPI's at home to help me learn Fuerte and practice some....

Re: ROS on RPi

Posted: Tue Jul 10, 2012 11:58 am
by mentar
I've managed to get past the YAML problem with Raspbian (I replied to your other thread but it's not been approved yet apparently)
At that point I hit a problem with OpenCV libraries, however looking at what others managed to do with OpenCV on Pi was quite limited so I'm not trying to get the bare minimum working so going for the Fuerte Desktop.
The way I see the RPi working is as low-level decision making and HW interfacing through the GPIO port, leaving it up to a remote server to do complicated CV and high level decisions.
After encountering errors on Electric too, I'm now focusing on getting the Fuerte Desktop variant on Raspbian working (There is no ros-base for Electric it seems)
Seems like rosmake expects gcc-4.5 and g++-4.5 and I've found no way of making rosmake use 4.6 as it ignores export CC=gcc-4.5 (if you know please tell me!)

Re: ROS on RPi

Posted: Tue Jul 10, 2012 3:30 pm
by mkopack
Hmm... Yeah, see, for me it's just the opposite..

I was hoping to use the RPI as the "higher level" robotic stuff (well, a couple of them, along with a Pandaboard, although that's even more a headache than the Rpi given the utter lack of community support...)

I wanted to use 1 RPi talking to an Arduino Uno or Mega. Let the Arduino do the low level motor control stuff, sensor reading, etc. Have 1 RPi interacting with that Arduino to expose it as a ROS Node. Then use 1 RPi for doing CV, another for doing path planning. Maybe use the Panda as the Master node, and doing everything else...

I haven't had a lot of time to play with this further lately (doing some home improvement projects around the house, and need to get my 2 competition robots built and programmed this summer before Grad School starts back up in Sept.) But if you make more progress, keep posting it here!

Re: ROS on RPi

Posted: Sun Jul 15, 2012 2:30 pm
by mentar
Ok so after a lot of messing around I have partial success
I've got most of the desktop set installed on Raspbian Wheezy and ROS Fuerte
The tutorials work fine and most of the 147 packages except:
  • collada_urdf
Does anyone want me to put an image up? It's not clean but for those wanting to experiment with ROS on the Pi it could be a good starting point while I or someone else get's the rest of packages to work.

Re: ROS on RPi

Posted: Sun Jul 15, 2012 11:55 pm
by bstag
Sure.. I am currently working getting pcl working and opencv just so they all will compile up.

Re: ROS on RPi

Posted: Mon Jul 16, 2012 11:48 am
by mentar
Ok this is what I have so far: RaspbianFuerteDesktop.img.tar.gz It's a little dirty in that it has some files in the home directory that I was playing around with, but I have managed to compile OGRE finally working my way through RVIZ but assimp is giving me a headache. To install that simply run the following from linux in the directory where you downloaded the file from above

Code: Select all

tar Ozxf RaspbianFuerteDesktop.img.tar.gz | dd of=/dev/sdX
replacing X with the letter of where your SD card is. This will of-course override what you have on it already so you will lose the data. I've also included rosserial which can be used to connect the RPi to an arduino very easily to do the low level stuff that I envisage would get used a lot!