Difference between revisions of "ROS"
(→Running ROS) |
Ashcharles (Talk | contribs) |
||
(17 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
== Introduction == | == Introduction == | ||
Rob Linsalata of [http://www.willowgarage.com Willow Garage] has posted [http://www.willowgarage.com/blog/2012/12/11/exploring-ros-turtlecore a great demo video] of [http://www.ros.org ROS] running on [https://www.gumstix.com Gumstix Overo COM] and [http://www.irobot.com iRobot Create] platform. Unfortunately it looks like Rob did not get a chance to write up a full tutorial on what it takes to get ROS running on the Gumstix and iRobot setup. So here is how I managed to get ROS Groovy (the latest release as of December 2012) to drive the Create. | Rob Linsalata of [http://www.willowgarage.com Willow Garage] has posted [http://www.willowgarage.com/blog/2012/12/11/exploring-ros-turtlecore a great demo video] of [http://www.ros.org ROS] running on [https://www.gumstix.com Gumstix Overo COM] and [http://www.irobot.com iRobot Create] platform. Unfortunately it looks like Rob did not get a chance to write up a full tutorial on what it takes to get ROS running on the Gumstix and iRobot setup. So here is how I managed to get ROS Groovy (the latest release as of December 2012) to drive the Create. | ||
+ | |||
+ | If you are looking for Player instead, look at [http://playerstage.sourceforge.net/wiki/Cross_Compile_Player_with_Openembedded_and_bitBake these instructions] | ||
+ | |||
+ | == Prebuilt Image == | ||
+ | You can download the image resulting from this guide from [https://s3-us-west-2.amazonaws.com/linaro/GumstixLinaroROS_20130204_2.gz here] and its [https://s3-us-west-2.amazonaws.com/linaro/md5sum MD5SUM]. | ||
== Prerequisites == | == Prerequisites == | ||
Line 10: | Line 13: | ||
* 1 Gumstix Overo COM with WiFi | * 1 Gumstix Overo COM with WiFi | ||
* 1 Gumstix Turtlecore Expansion board | * 1 Gumstix Turtlecore Expansion board | ||
− | * 1 MicroSD Card ( | + | * 1 MicroSD Card (8GB or larger recommended) |
== Installation == | == Installation == | ||
Line 89: | Line 92: | ||
# Again, in a new terminal while roscore and the driver program are running, you can do the following to make the Create roll forward!!: | # Again, in a new terminal while roscore and the driver program are running, you can do the following to make the Create roll forward!!: | ||
#: $ rosservice call /tank 1 100 100 && sleep 0.5 && rosservice call /brake 1 | #: $ rosservice call /tank 1 100 100 && sleep 0.5 && rosservice call /brake 1 | ||
+ | |||
+ | == Issues and Workarounds == | ||
+ | |||
+ | It is discovered that the original image released (in Jan. 2013) cannot bring-up WiFi when used with expansion boards with an Ethernet port. Here is the workaround if you are already using the image: | ||
+ | # Remove network-manager.conf and networking.conf from /etc/init directory, and 70-persistent-net.rules from /etc/udev/rules.d | ||
+ | # Follow [[Overo_Wifi]] | ||
+ | # This will disable the GUI network manager. However you can easily bring up your wireless interface with command 'ifup wlan0'. | ||
+ | # Additionally if you would like to auto-connect on boot, configure the interface in /etc/wpa_supplicant.conf as 'auto' as below: | ||
+ | auto wlan0 | ||
+ | iface wlan0 inet dhcp | ||
+ | pre-up wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B | ||
+ | down killall wpa_supplicant | ||
+ | The Prebuilt Image section of this article already contains the updated image as well (published Feb. 2013). | ||
+ | |||
+ | == References == | ||
+ | *[http://pharos.ece.utexas.edu/wiki/index.php/Writing_A_Simple_Node_that_Moves_the_iRobot_Create_Robot Writing A Simple Node that Moves the iRobot Create Robot - Pharos Testbed Wiki] | ||
+ | *[http://pharos.ece.utexas.edu/wiki/index.php/Using_ROS_Electric_to_Tele-Operate_an_iRobot_Create_Robot Using ROS Electric to Tele-Operate an iRobot Create Robot - Pharos Testbed Wiki] | ||
+ | *[http://ros.org/wiki/groovy/Installation/Source Installing on Ubuntu from source - ROS.org] | ||
+ | *[http://ros.org/wiki/TurtleCore Turtlecore - ROS.org] |
Latest revision as of 15:01, 1 April 2016
Contents
Introduction
Rob Linsalata of Willow Garage has posted a great demo video of ROS running on Gumstix Overo COM and iRobot Create platform. Unfortunately it looks like Rob did not get a chance to write up a full tutorial on what it takes to get ROS running on the Gumstix and iRobot setup. So here is how I managed to get ROS Groovy (the latest release as of December 2012) to drive the Create.
If you are looking for Player instead, look at these instructions
Prebuilt Image
You can download the image resulting from this guide from here and its MD5SUM.
Prerequisites
- 1 Development computer running Ubuntu (I used 12.04)
- 1 Gumstix Overo COM with WiFi
- 1 Gumstix Turtlecore Expansion board
- 1 MicroSD Card (8GB or larger recommended)
Installation
Get an Operating System
First thing you probably want to do is to install Linaro on an Overo COM. Linaro is a variant of Ubuntu and is designed for embedded application. So follow that link and get a Linaro image flashed into your MicroSD. The next part is where the challenge arises. Willow Garage does not provide ARM binaries. They only provide precompiled packages for your everyday computers running Intel or AMD CPUs. So we have to compile ROS from scratch for ARM architecture. Setting up a cross compilation environment is not a simple task, so I decided to do it natively on an Overo (even it means letting it compile over night).
ROS Native Compilation
- Get all libraries and tools
- $ sudo apt-get install python-pip build-essential python-yaml cmake subversion wget python-setuptools mercurial git-core python-yaml libapr1-dev libaprutil1-dev libbz2-dev python-dev python-empy python-nose libgtest-dev python-paramiko libboost-all-dev liblog4cxx10-dev pkg-config libqt4-dev qt4-qmake
- Some of the ROS tools need to come from PIP as I wasn't able to get them through Aptitude
- $ pip install rospkg rosdep rosinstall catkin-pkg wstool
- Initialize dependencies
- $ sudo rosdep init
- $ rosdep update
- Now we create a catkin workspace and initialize to build core ROS packages
- $ mkdir -p ~/ros_core_ws
- $ cd ~/ros_core_ws
- $ wstool init src https://raw.github.com/gist/4129582/e8889c0fc3af2f95892190e0fabc2bd535208355/base.rosinstall
- Build catkin and install it. catkin is the low-level build system of ROS
- $ ./src/catkin/bin/catkin_make
- $ ./src/catkin/bin/catkin_make install
- Setup catkin build environment
- $ source ~/ros_core_ws/install/setup.bash
- Now we create and initialize a workspace to put all our ROS packages
- $ mkdir ~/ros
- $ cd ~/ros
- $ rosws init . ~/ros_core_ws/install/
- Current ROS distribution does not recognize Linaro. We have to patch the os detection file.
- $ vim /usr/local/lib/python2.7/dist-packages/rospkg/os_detect.py
- Add the following bold faced changes
- OS_UBUNTU='ubuntu'
- OS_LINARO='linaro
- OsDetect.register_default(OS_UBUNTU, LsbDetect("Ubuntu"))
- OsDetect.register_default(OS_UBUNTU, LsbDetect("Linaro"))
- There are a couple dependencies required before we can compile iRobot's Create ROS package
- $ roslocate info kdl > kdl.rosinstall
- $ rosws merge kdl.rosinstall
- $ rosws update
- $ rosdep install kdl
- $ rosmake kdl
- $ roslocate info bullet > bullet.rosinstall
- $ rosws merge bullet.rosinstall
- $ rosws update
- $ rosdep install bullet
- $ rosmake bullet
- If the last step fails indicating that a packaged named bullet was not found, try updating dependency map before running rosmake
- $ rosdep update
- And build geometry package, the last dependency
- $ roslocate info geometry > geometry.rosinstall
- In the geometry package's rosinstall file, switch the branch name to fuerte_devel. For some reason the default branch does not work.
- $ vim geometry.rosinstall
- //version: tf_rework
- version: fuerte_devel
- $ rosws merge geometry.rosinstall
- $ rosws update
- $ rosdep install geometry
- $ rosmake geometry
- $ vim geometry.rosinstall
- Finally we can install iRobot's ROS package
- $ roslocate info irobot_create_2_1 > irobot_create_2_1.rosinstall
- $ vim irobot_create_2_1.rosinstall
- $ rosws merge irobot_create_2_1
- $ rosws update
- $ rosmake irobot_create_2_1
Running ROS
- We have everything in place to drive the Create around. To start the core services of ROS, do the following:
- $ cd ~/ros
- $ . ./setup.sh
- $ roscore
- The iRobot Create is connected to ttyO0 on Gumstix Turtlecore. So make the change:
- $ rosparam set /brown/irobot_create_2_1/port /dev/ttyO0
- Now we can start the driver program in another terminal:
- $ rosrun irobot_create_2_1 driver.py
- Again, in a new terminal while roscore and the driver program are running, you can do the following to make the Create roll forward!!:
- $ rosservice call /tank 1 100 100 && sleep 0.5 && rosservice call /brake 1
Issues and Workarounds
It is discovered that the original image released (in Jan. 2013) cannot bring-up WiFi when used with expansion boards with an Ethernet port. Here is the workaround if you are already using the image:
- Remove network-manager.conf and networking.conf from /etc/init directory, and 70-persistent-net.rules from /etc/udev/rules.d
- Follow Overo_Wifi
- This will disable the GUI network manager. However you can easily bring up your wireless interface with command 'ifup wlan0'.
- Additionally if you would like to auto-connect on boot, configure the interface in /etc/wpa_supplicant.conf as 'auto' as below:
auto wlan0 iface wlan0 inet dhcp pre-up wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B down killall wpa_supplicant
The Prebuilt Image section of this article already contains the updated image as well (published Feb. 2013).