Difference between revisions of "Ros"

From ArchWiki
Jump to: navigation, search
(Clarified that current instructions are fuerte-only)
(fix format)
 
(23 intermediate revisions by 12 users not shown)
Line 1: Line 1:
 
[[Category:Mathematics and science]]
 
[[Category:Mathematics and science]]
 +
[[ja:Ros]]
 +
{{Style|Does not conform to [[Help:Style]], poor shell one-liners}}
 +
{{Accuracy|Relies on a horribly written, outdated third-party resource for installation instructions (yaourt, pacman -Sy, etc.)}}
 +
{{Out of date|AUR packages described here either not migrated to AUR4, or do not reflect recent changes such as {{AUR|ros-indigo-desktop}}}}
 
[http://www.ros.org ROS] is an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management.
 
[http://www.ros.org ROS] is an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management.
 +
== Setup Notes - Jade ==
  
With the ROS Fuerte release, it is much easier to get ROS running on an Arch system but still takes some effort. Read the notes below and then go to [http://www.ros.org/wiki/fuerte/Installation/Arch the installation page on the ROS website]
+
For ROS Jade, see [http://wiki.ros.org/jade/Installation/Arch Installation Instructions for jade in Arch Linux].
  
== Setup Notes - Fuerte ==
+
{{Note|
 +
If using gcc in version 6.x or above, log4cxx 0.10 (one of dependencies) will not build. Use SVN version ({{AUR|log4cxx-svn}} in aur) until 0.11 is released.}}
  
With Fuerte, ROS is split into two levels. The core libraries are installed into the system folders ({{ic|/opt/ros/fuerte}}) while the higher-level stacks and packages are installed in the user folders.
+
== Setup Notes - Indigo ==
  
The Arch-specific install page lists the packages (official and AUR) that you will need to install for a full setup.
+
For ROS Indigo, see [http://wiki.ros.org/indigo/Installation/Arch Installation Instructions for Indigo in Arch Linux].
  
{{AUR|ros-core}}, available in the [[AUR]], is the package for the core libraries.
+
== Setup Notes - Hydro ==
  
To build the higher level packages you will need to do some work:
+
For ROS Hydro, see [http://wiki.ros.org/hydro/Installation/Arch Installation Instructions for Hydro in Arch Linux].
  
# Install [[AUR]] packages: {{AUR|ros-on-arch}} {{AUR|pcl-ros}} {{AUR|swig-wx}} {{AUR|qhull-ros}}
+
'''Ogre 1.8'''
# Pull the sources with {{ic|rosinstall}}
+
 
# Patch the sources to compile with GCC 4.7 [https://code.ros.org/trac/ros-pkg/attachment/ticket/5417/ros.patch]
+
You may want to use ogre 1.8 ([https://aur.archlinux.org/packages/ogre-1.8/ aur package])  if you want to use gazebo. In order to compile some hydro packages that requires ogre (like rviz) you can add
# Resolve dependencies with {{ic|rosdep}}
+
this export to the pkgbuild:
# Build with {{ic|rosmake}}
+
 
 +
export PKG_CONFIG_PATH=/opt/OGRE-1.8/lib/pkgconfig/:$PKG_CONFIG_PATH
 +
 
 +
== Setup Notes - Groovy ==
 +
 
 +
ROS Groovy core, comm, and robot variants have meta-packages that should install all the necessary packages: {{AUR|ros-groovy-ros}}{{Broken package link|{{aur-mirror|ros-groovy-ros}}}}, {{AUR|ros-groovy-ros-comm}}{{Broken package link|{{aur-mirror|ros-groovy-ros-comm}}}}, (TODO: robot metapackage). In addition, {{AUR|ros-groovy-rviz}}{{Broken package link|{{aur-mirror|ros-groovy-rviz}}}} (along with its dependencies) has a package.
 +
 
 +
The packages are all available in the maintainer's github: [https://github.com/zootboy/arch-ros-stacks arch-ros-stacks]. Not all packages there are in a working state, so use with caution. Please, report any issues with the packages on their respective AUR pages.
 +
 
 +
== Usage Notes - Groovy ==
 +
 
 +
Due to the fact that Ubuntu and Arch handle the python2/3 binary split differently, catkin_make[_isolated] will not work on its own. To use these commands, create the following aliases in your ~/.bashrc (or equivalent):
 +
alias catkin_make='catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so'
 +
alias catkin_make_isolated='catkin_make_isolated -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so'
 +
 
 +
Without these lines, cmake will default to python 3, which you do not want. It is also possible to simply add the defines into any call of catkin_make[_isolated] (which you have to do if you want to call those commands within a script).
 +
 
 +
For further information on how to use ROS, see the [http://www.ros.org/wiki/ROS/Tutorials ROS Tutorials].
 +
 
 +
== Rebuild when boost is updated ==
 +
When you update a library that ROS depends on, e.g. boost, then you need to rebuild all the packages that link to it. You can search for the packages, with a command similar to the one below. You can use the output from that to rebuild the AUR packages with your favorite AUR helper/wrapper.
 +
 
 +
export LANG=C;grep -r "libboost" /opt/ros/indigo |  awk '{ print $3 }' | grep opt |  pacman -Qo - | awk '{ print $5 }' | tr '\n' ' '
 +
 
 +
Or use the following script that build all ros-indigo-* packages following the dependency tree:
 +
 +
  ros_version="ros-indigo"
 +
 
 +
  pack_file=$1
 +
  if [[ $pack_file == "" ]]; then
 +
pack_file=$(mktemp)
 +
  fi
 +
 
 +
  function contains() {
 +
  for item in $(cat $1); do
 +
      if [ "$2" == "$item" ]; then
 +
          return 0
 +
      fi
 +
  done
 +
  return 1
 +
  }
 +
 
 +
  export built=""
 +
 
 +
  function get_deps() {
 +
    deps=$(pacman -Qi $1 | grep 'Depends On' | tr ' ' '\n' | grep ${ros_version})
 +
    echo $deps
 +
  }
 +
 +
  function build_package() {
 +
  local pack=$1
 +
  local recursion_level=$2
 +
  if contains $pack_file $pack; then
 +
return 0
 +
  fi
 +
printf '%*s' $recursion_level ''
 +
  echo "building $pack "
 +
  deps=$(get_deps $pack)
 +
  for dep in $deps; do
 +
      build_package $dep $(( $recursion_level + 1 ))
 +
  done
 +
yaourt -S $pack --noconfirm
 +
echo "$pack" >> $pack_file
 +
  }
 +
 
 +
  echo "getting list of package built with boost"
 +
  list=$(export LANG=C;grep -r "libboost" /opt/ros/indigo | awk '{ print $3 }' | grep opt | pacman -Qo - | awk '{ print $5 }' | tr '\n' ' ')
 +
 
 +
  for pack in $list; do
 +
    build_package $pack 0
 +
  done

Latest revision as of 14:30, 24 November 2016

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: Does not conform to Help:Style, poor shell one-liners (Discuss in Talk:Ros#)

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Relies on a horribly written, outdated third-party resource for installation instructions (yaourt, pacman -Sy, etc.) (Discuss in Talk:Ros#)

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: AUR packages described here either not migrated to AUR4, or do not reflect recent changes such as ros-indigo-desktopAUR (Discuss in Talk:Ros#)

ROS is an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management.

Setup Notes - Jade

For ROS Jade, see Installation Instructions for jade in Arch Linux.

Note: If using gcc in version 6.x or above, log4cxx 0.10 (one of dependencies) will not build. Use SVN version (log4cxx-svnAUR in aur) until 0.11 is released.

Setup Notes - Indigo

For ROS Indigo, see Installation Instructions for Indigo in Arch Linux.

Setup Notes - Hydro

For ROS Hydro, see Installation Instructions for Hydro in Arch Linux.

Ogre 1.8

You may want to use ogre 1.8 (aur package) if you want to use gazebo. In order to compile some hydro packages that requires ogre (like rviz) you can add this export to the pkgbuild:

export PKG_CONFIG_PATH=/opt/OGRE-1.8/lib/pkgconfig/:$PKG_CONFIG_PATH

Setup Notes - Groovy

ROS Groovy core, comm, and robot variants have meta-packages that should install all the necessary packages: ros-groovy-rosAUR[broken link: archived in aur-mirror], ros-groovy-ros-commAUR[broken link: archived in aur-mirror], (TODO: robot metapackage). In addition, ros-groovy-rvizAUR[broken link: archived in aur-mirror] (along with its dependencies) has a package.

The packages are all available in the maintainer's github: arch-ros-stacks. Not all packages there are in a working state, so use with caution. Please, report any issues with the packages on their respective AUR pages.

Usage Notes - Groovy

Due to the fact that Ubuntu and Arch handle the python2/3 binary split differently, catkin_make[_isolated] will not work on its own. To use these commands, create the following aliases in your ~/.bashrc (or equivalent):

alias catkin_make='catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so'
alias catkin_make_isolated='catkin_make_isolated -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so'

Without these lines, cmake will default to python 3, which you do not want. It is also possible to simply add the defines into any call of catkin_make[_isolated] (which you have to do if you want to call those commands within a script).

For further information on how to use ROS, see the ROS Tutorials.

Rebuild when boost is updated

When you update a library that ROS depends on, e.g. boost, then you need to rebuild all the packages that link to it. You can search for the packages, with a command similar to the one below. You can use the output from that to rebuild the AUR packages with your favorite AUR helper/wrapper.

export LANG=C;grep -r "libboost" /opt/ros/indigo |  awk '{ print $3 }' | grep opt |  pacman -Qo - | awk '{ print $5 }' | tr '\n' ' '

Or use the following script that build all ros-indigo-* packages following the dependency tree:

 ros_version="ros-indigo"
 
 pack_file=$1
 if  $pack_file == "" ; then
	 pack_file=$(mktemp)
 fi
 
 function contains() {
 for item in $(cat $1); do
     if [ "$2" == "$item" ]; then
         return 0
     fi
 done
 return 1
 }
 
 export built=""
 
 function get_deps() {
   deps=$(pacman -Qi $1 | grep 'Depends On' | tr ' ' '\n' | grep ${ros_version})
   echo $deps
 }

 function build_package() {
  local pack=$1
 	local recursion_level=$2
  if contains $pack_file $pack; then
		 return 0
  fi
	printf '%*s' $recursion_level 
  echo "building $pack "
  deps=$(get_deps $pack)
  for dep in $deps; do
     build_package $dep $(( $recursion_level + 1 ))
  done
	yaourt -S $pack --noconfirm
	echo "$pack" >> $pack_file
 }
 
 echo "getting list of package built with boost"
 list=$(export LANG=C;grep -r "libboost" /opt/ros/indigo | awk '{ print $3 }' | grep opt | pacman -Qo - | awk '{ print $5 }' | tr '\n' ' ')
 
 for pack in $list; do
   build_package $pack 0
 done