Installing ROS from source

146 views
Skip to first unread message

Alan Marshall

unread,
Jul 9, 2017, 9:49:41 AM7/9/17
to BeagleBoard
Hi I installed ROS from source on Debian Stretch 9.0 iot image. I thought I would document it here for anybody who is like me and doesn't have much experience with this. 

Note: I installed the ROS lunar-robot variant - http://www.ros.org/reps/rep-0131.html#variants
Note: You will most likely need an sd card > 4GB

PRE-INSTALL - I had some out of memory errors when building and compiling so I added some swap space. Sources: https://bitcointalk.org/index.php?topic=304389.msg7374545#msg7374545
---------------
free
sudo dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
sudo mkswap /var/swap.img
sudo chown root:disk /var/swap.img
sudo swapon /var/swap.img
free
--------------------------------------------------------------

I mostly followed along with the official documentation for installing from source found here: http://wiki.ros.org/Installation/Source but had to make some changes which I will outline.

-----------------------------------------------------
STEPS:
----------------------------------------------------

1. sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential
2. sudo pip install -U rosdep rosinstall_generator wstool rosinstall
3. sudo rosdep init
4. rosdep update
5. mkdir ~/ros_catkin_ws
6. cd ~/ros_catkin_ws

* MY CHANGES* 
- I had some no OS version errors when following the official documentation for step 9 below so I used the --os=ubuntu:xenial switch. This still has some missing dependencies but builds anyway. I made a note of the missing in case I need to install manually later on.
- I had to use the -DENABLE_PRECOMPILED_HEADERS=OFF switch in step 10 below  

7. rosinstall_generator robot --rosdistro lunar --deps --tar > lunar-robot.rosinstall
8. wstool init -j1 src lunar-robot.rosinstall
9. rosdep install --from-paths src --ignore-src --rosdistro lunar os=ubuntu:xenial -r -y (make copy of missing)
10. sudo ./src/catkin/bin/catkin_make_isolated --install-space /opt/ros/lunar --install -DCMAKE_BUILD_TYPE=Release -DENABLE_PRECOMPILED_HEADERS=OFF

11. source ~/ros_catkin_ws/install_isolated/setup.bash
12. echo $ROS_PACKAGE_PATH
          /home/youruser/catkin_ws/src:/opt/ros/lunar/share
 


middleto...@gmail.com

unread,
May 20, 2018, 9:22:38 AM5/20/18
to BeagleBoard
looks like in step 9 you are missing -- before os=
Reply all
Reply to author
Forward
0 new messages