User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

ROS (Robot Operating System) on RPi

Fri May 25, 2012 5:50 pm

Found this last night while trying to figure out how to get ROS installed on the Pi...

http://answers.ros.org/question/34501/h ... 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.

jeem
Posts: 11
Joined: Sat Nov 19, 2011 11:40 am
Contact: Website

Re: ROS on RPi

Fri May 25, 2012 8:07 pm

I am definitely interested in this topic. Please keep us informed.
http://www.jeremy-nicola.info

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Fri May 25, 2012 9:36 pm

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.

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Fri May 25, 2012 9:48 pm

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.

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Sat May 26, 2012 3:06 am

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???

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Sat May 26, 2012 4:03 am

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...)

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Sat May 26, 2012 5:26 pm

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 answers.ros.org 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.)

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Tue May 29, 2012 12:22 am

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

Yaml-cpp: http://code.google.com/p/yaml-cpp/

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?

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Wed May 30, 2012 1:25 am

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:

[email protected]:~$ rosdep install -a
Executing script below with cwd=/tmp
{{{
#!/bin/bash
export PREFIX=/usr/
if [ -f $PREFIX/include/assimp/assimp-version.installed ]; then
[ 2ed0b9954bcb2572c0dade8f849b9260 = `cat $PREFIX/include/assimp/assimp-version.installed` ]
else
false
fi

}}}

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

}}}

Executing script below with cwd=/tmp
{{{
#!/bin/bash
set -o errexit
dpkg-query -W -f='${Package} ${Status}\n' yaml-cpp-sourcedep 2>&1 | awk '{\
if ($4 =="installed")
exit 0
else
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.

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Thu May 31, 2012 12:06 am

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!

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Thu May 31, 2012 3:40 am

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:

http://www.ros.org/wiki/electric/Installation/Debian

(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!!!!

User avatar
speculatrix
Posts: 51
Joined: Thu Apr 05, 2012 8:29 am
Location: France
Contact: Website

Re: ROS on RPi

Thu May 31, 2012 6:52 pm

Just a thought, but if this is running reliably, would you be willing to post an image somewhere of Debian + ROS?

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Thu May 31, 2012 7:10 pm

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

User avatar
speculatrix
Posts: 51
Joined: Thu Apr 05, 2012 8:29 am
Location: France
Contact: Website

Re: ROS on RPi

Fri Jun 01, 2012 8:11 am

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).

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Fri Jun 01, 2012 11:51 am

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...)

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Sun Jun 24, 2012 10:58 pm

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:

http://www.ros.org/wiki/electric/Installation/Debian

This will fail while doing the step:

rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_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 "http://packages.ros.org/cgi-bin/gen_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...

User avatar
mentar
Posts: 17
Joined: Wed Jul 04, 2012 11:47 am
Location: London
Contact: Website

Re: ROS on RPi

Wed Jul 04, 2012 11:52 am

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!

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: ROS on RPi

Wed Jul 04, 2012 4:22 pm

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. :)
Ostendo ignarus addo scientia.

User avatar
mentar
Posts: 17
Joined: Wed Jul 04, 2012 11:47 am
Location: London
Contact: Website

Re: ROS on RPi

Thu Jul 05, 2012 12:20 pm

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!

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Thu Jul 05, 2012 1:13 pm

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

User avatar
mentar
Posts: 17
Joined: Wed Jul 04, 2012 11:47 am
Location: London
Contact: Website

Re: ROS on RPi

Tue Jul 10, 2012 11:58 am

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!)

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: ROS on RPi

Tue Jul 10, 2012 3:30 pm

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!

User avatar
mentar
Posts: 17
Joined: Wed Jul 04, 2012 11:47 am
Location: London
Contact: Website

Re: ROS on RPi

Sun Jul 15, 2012 2:30 pm

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
    librviz_tutorial
    rviz_plugin_tutorials
    ogre_tools
    ogre
    laser_filters
    rviz
    pcl_ros
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.

bstag
Posts: 11
Joined: Sun Jul 15, 2012 11:50 pm

Re: ROS on RPi

Sun Jul 15, 2012 11:55 pm

Sure.. I am currently working getting pcl working and opencv just so they all will compile up.

User avatar
mentar
Posts: 17
Joined: Wed Jul 04, 2012 11:47 am
Location: London
Contact: Website

Re: ROS on RPi

Mon Jul 16, 2012 11:48 am

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!

Return to “Automation, sensing and robotics”