User Tools

Site Tools


ros

**This is an old revision of the document!**

Table of Contents

ROS

Introduction

Installation

  • Take an overview of the installation instructions from here: http://www.ros.org/wiki/cturtle/Installation/Ubuntu/SVN
  • Install rosinstall:

    sudo easy_install -U rosinstall

  • Create a directory where you want to store ros:

    cd local/src mkdir ros

  • As of 10.08.2010 is better (more stable, sufficiently new) to use cturtle ros distribution.

    rosinstall ros http://www.ros.org/rosinstalls/cturtle_base.rosinstall

  • In the last step rosinstall will try to download and compile cturtle. If you get some errors is because you may be missing some dependencies. Look at the error messages and find out the name of the packages that you have to install in debian, then try rosintall command again until you don't get any errors.
  • Create a file called .bashrc.ros Put inside the following:

    export ROSROOT=${HOME}/local/src/ros/ros ; export PATH=${ROSROOT}/bin:${PATH} ; export PYTHONPATH=${ROSROOT}/core/roslib/src:${PYTHONPATH} ; export OCTAVEPATH=${ROSUP}/ros/core/experimental/rosoct/octave:${OCTAVEPATH} ; #if [ ! “$ROSMASTERURI” ] ; then export ROSMASTERURI=http://leela:11311 ; fi ; if [ ! “$ROSMASTERURI” ] ; then export ROSMASTERURI=http://localhost:11311 ; fi ; export ROSPACKAGEPATH=${HOME}/local/src/ros/stacks:${HOME}/local/src/repositories/oid5; #export ROSSTACKPATH=${ROSROOT}:${ROSUP}/ros-pkg ;
    #source rosstack find ias_semantic_mapping/setup.sh
    NUMCPUS=cat /proc/cpuinfo |grep processor |wc -l let “PARJOBS=${NUMCPUS}+2” export ROSPARALLELJOBS=“-j${PARJOBS}”
    export ROSLANGDISABLE=roslisp:rosjava
    export ROSIP=ip addr show \/sbin/route -n | awk '/UG/ {print $8}'`| awk '/inet /{print $2}' |sed -e 's/\/.*' #export ROS_IP=192.168.137.2 #HOSTNAME=hostname #if [[ "${HOSTNAME}" == "leela" ]] ; then echo "Hola"; else echo "lala" ;fi alias kcart_left="rospack find kbd-cart-cmd/kbd-cart-cmd -p kbd-left -c /lwr/left" alias kcart_right="rospack find kbd-cart-cmd`/kbd-cart-cmd -p kbd-right -c /lwr/right“
    . ${ROS_ROOT}/tools/rosbash/rosbash * Adjust the ROSMASTERURI to point to the computer where the rosmaster that you want to use is. * Inside of your .bashrc add de following line: alias env_ros='source ${HOME}/.bashrc.ros' * Logout and login again to reload your .bashrc * Run env_ros * Now you can use the ros utilities ===== Installing extra ros packages ===== In the ros directory there is a subdirectory called stacks this is where you can put extra packages. You just have to download somehow this packages and put them there. Example: Gstreamer video adquisition: * Search for gstreamer in http://www.ros.org/browse/list.php page. This will show a package called gscam. * cd into the stacks directory cd $ROS_ROOT cd ../stacks * Download the code there: svn co http://brown-ros-pkg.googlecode.com/svn/tags/brown-ros-pkg * Now you can compile the code. rosmake gscam * Rosmake deals with ros dependencies. It will automatically compile any other necessary ros packages that are dependencies. * Rosmake is pretty slow checking dependencies, so if you already compile the program once, and you now that the dependencies are already compiled, then just roscd to the package you need and do make. ===== Gscam ===== Captures images from gstreamer video sources and sends them to a ros topic. * Test your webcam: gst-launch –gst-debug=v4l2:2 v4l2src device=/dev/video1 ! video/x-raw-rgb,width=800,height=600,framerate=30/1 ! ffmpegcolorspace ! xvimagesink * You should see a windows with the webcam image. Close this program. * Start using gscam: export GSCAM_CONFIG=“v4l2src device=/dev/video0 ! video/x-raw-rgb,width=800,height=600,framerate=30/1 ! ffmpegcolorspace ! identity name=ros ! fakesink” rosrun gscam gscam * To look at the image: rosmake imageview rosrun imageview imageview image:=/gscam/imageraw ==== Improving image quality with some cameras ==== With a Logitech webcam C600 one can get better image quality (less noisy) setting the video mode to YUV. In gst-launch: gst-launch –gst-debug=v4l2:5 v4l2src device=/dev/video1 ! video/x-raw-yuv,format=(fourcc)YUY2,width=800,height=600,framerate=15/1 ! ffmpegcolorspace ! xvimagesink For gscam: export GSCAM_CONFIG=“v4l2src device=/dev/video1 ! video/x-raw-yuv,width=800,height=600,framerate=15/1,format=(fourcc)YUY2 ! ffmpegcolorspace ! video/x-raw-rgb ! identity name=ros ! fakesink” the last conversion is necessary because gscam only takes rgb images. Please carefully notice that for the gscam GSCAM_CONFIG export there are no back-slashes for the format “fourcc” part.

ros.1281466232.txt.gz · Last modified: 2021/02/01 05:55 (external edit)