ROS Tutorial: Difference between revisions

From ISRWiki
Jump to navigation Jump to search
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Note: ''this tutorial is under construction''.
Note 1: ''this tutorial is under construction''.
 
Note 2: ''for the '''past distribution of ROS C-Turtle''', please review [http://mediawiki.isr.ist.utl.pt/wiki/ROS_C_Turtle this link]''


= Install ROS =
= Install ROS =
Line 5: Line 7:
To start using ROS meta operating system for robots, we recommend to follow the next steps:
To start using ROS meta operating system for robots, we recommend to follow the next steps:


#  First you must install ROS. There already exist a very good tutorial to do so, and when you reach the part where you have to decide which version of ROS you want to install, we recommend to select the BASE edition. "Base: ROS plus robot-generic stacks (e.g. navigation, visualization". The tutorial is in here([http://www.ros.org/wiki/cturtle/Installation/Ubuntu Install ROS Tutorial]).
#  First you must install ROS. There already exist a very good tutorial to do so, and when you reach the part where you have to decide which version of ROS you want to install, we recommend to select the '''"Desktop-Full Install"'''. An easy to follow tutorial on how to install ROS is in here([http://www.ros.org/wiki/diamondback/Installation/Ubuntu ROS Installation]).
#  To get a quick and good tutorial for beginners see this page ([http://www.ros.org/wiki/ROS/Tutorials BEGINNERS TUTORIAL]). We recommend to read at least the beginners tutorials.
#  To get a quick and good tutorial for beginners see this page ([http://www.ros.org/wiki/ROS/Tutorials BEGINNERS TUTORIAL]). We recommend to read at least the beginners tutorials.
#  To start adding stacks FIRST CHECK if the STACK you want is in [http://www.ros.org/wiki/StackList THIS List], If it is, you can install it easily by the next command, but be careful, because unfortunately, not all stacks in the list (but most of them) can be installed by the following method. The shadow_robot STACK it's one of them. You can install a specific ROS stack in the previous list just replacing underscores with dashes of the stack name with the following:
#  To start adding stacks please read next section.
 
sudo apt-get install ros-cturtle-STACK-NAME
 
if your installation fails, then read the next section.


= 3rd Party Stacks & Packages installations =
= 3rd Party Stacks & Packages installations =
Line 80: Line 78:
Ok, now you can try your STACK.
Ok, now you can try your STACK.


== 3rd Party from Bazar Repository ==
== From Bazar (bzr) Repository ==


bla bla bla ...
First, make sure that you have the bazar installed in your pc
sudo apt-get install bzr


= Kinect Stack=
Then prepare the directory where you want to install the STACK.
 
mkdir -p $HOME/Ros_Stacks/
cd $HOME/Ros_Stacks/


ROS Kinect is an open source project focused on the integration of the Microsoft Kinect sensor with ROS. The kinect ROS stack contains low-level drivers, visualization launch files, and PCL/OpenCV tutorials/demos.
Get the SOURCE code, that is the link of the web-page, example


== Install Drivers ==
SOURCE="lp:sr-ros-interface"
STACK="shadow_robot"
bzr branch $SOURCE
mv sr-ros-interface/shadow_robot .
rm -r sr-ros-interface


To Install the Kinect STACK, You first need installed the following stacks
Export the PATH to $ROS_PACKAGE_PATH
export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH
echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc


* [http://www.ros.org/wiki/perception_pcl perception_pcl]
finally, build the STACK
* [http://www.ros.org/wiki/point_cloud_perception point_cloud_perception]
roscd $STACK
rosmake --rosdep-install


To know how to install them, please read [http://mediawiki.isr.ist.utl.pt/wiki/ROS_Tutorial#From_ROS-PKG:_SVN_Repository ROS-PKG: SVN Repository]
== From Mercurial (hg) Repository ==


As you will see, Kinect STACK is in the GIT repository, so, First install the git and also the easy install tool from ROS, in terminal enter the following:
First, make sure that you have the Mercurial installed in your pc
  sudo apt-get install python-setuptools git-core
  sudo apt-get install mercurial
sudo easy_install -U rosinstall


Now, download the source code by typing in terminal:
Then prepare the directory where you want to install the STACK.
  mkdir -p $HOME/Ros_Stacks/
  mkdir -p $HOME/Ros_Stacks/
  cd $HOME/Ros_Stacks/
  cd $HOME/Ros_Stacks/
wget http://github.com/ros-pkg-git/kinect/raw/master/kinect.rosinstall --no-check-certificate
rosinstall $HOME/Ros_Stacks/kinect-devel /opt/ros/cturtle kinect.rosinstall
Now, to set up your environment.
source $HOME/Ros_Stacks/kinect-devel/setup.bash
Build ROS-kinect:
. $HOME/Ros_Stacks/kinect-devel/setup.sh
rosmake kinect --rosdep-install
Now install kinect and visualilzation
sudo apt-get install ros-cturtle-kinect ros-cturtle-visualization
'''Now plug in Kinect to USB port ''' and open up permissions on usb port by entering in Terminal the following:
sudo chmod 777 -R /dev/bus/usb


Using udev rules, your computer will always be setup to use the kinect. This only needs to be done once. In Lucid, paste the following into /etc/udev/rules.d/53-kinect.rules Hint: use sudo.
Get the SOURCE code, that is the link of the web-page. As a example , we install the [http://www.ros.org/wiki/control '''control STACK''']
 
  STACK="control"
sudo gedit /etc/udev/rules.d/53-kinect.rules
  SOURCE="https://bitbucket.org/sglaser/control"
 
And copy the next text into the file and save it.
# /etc/udev/rules.d/53-kinect.rules
# make kinect device mount with writing permissions
#(default is read only for unknown devices)
  # ATTR{product}=="Xbox NUI Motor"
  SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE="0666"
   
   
  # ATTR{product}=="Xbox NUI Audio"
  cd $HOME/Ros_STACKS
  SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE="0666"
  hg clone $SOURCE
# ATTR{product}=="Xbox NUI Camera"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE="0666"


Now '''Make sure the kinect is disconnected from your computer''' and run:  
Export the path
  sudo service udev reload
export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH
  echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc


Then '''reconnect your kinect''' and wait at least 10 seconds (camera initialization). Permissions should be normal (read/write).
Finally, build the Stack
roscd $STACK
rosmake --rosdep-install


To test if the Kinect is publishing in ROS, type:
= Kinect Stack=
rxgraph


'''In a new terminal''' Launch the Kinect by entering:
ROS Kinect is an open source project focused on the integration of the Microsoft Kinect sensor with ROS. The kinect ROS stack contains low-level drivers, visualization launch files, and PCL/OpenCV tutorials/demos.
. /opt/ros/cturtle/setup.sh
roslaunch kinect_camera kinect_with_tf.launch


Now to Launch the Visualization, create the file /tmp/kinect.vcg
== Install Drivers ==
gedit /tmp/kinect.vcg


...and copy the following text:
In the C-Turtle distribution, the use of Kinect was done trough the Kinect Stack, now, in Diamondback, it is done by the [http://www.ros.org/wiki/ni ni STACK]. let us see how to install it.
Background\ ColorR=0
Background\ ColorG=0
Background\ ColorB=0
Fixed\ Frame=/kinect_depth
Target\ Frame=<Fixed Frame>
Camera.Alpha=0.5
Camera.Enabled=1
Camera.Image\ Topic=/kinect/rgb/image_raw
Camera.Transport\ Hint=raw
Camera2.Alpha=0.5
Camera2.Enabled=1
Camera2.Image\ Topic=/kinect/depth/image_raw
Camera2.Transport\ Hint=raw
Grid.Alpha=0.5
Grid.Cell\ Size=1
Grid.ColorR=0.5
Grid.ColorG=0.5
Grid.ColorB=0.5
Grid.Enabled=1
Grid.Line\ Style=0
Grid.Line\ Width=0.03
Grid.Normal\ Cell\ Count=0
Grid.OffsetX=0
Grid.OffsetY=0
Grid.OffsetZ=0
Grid.Plane=0
Grid.Plane\ Cell\ Count=50
Grid.Reference\ Frame=<Fixed Frame>
Point\ Cloud2.Alpha=0.5
Point\ Cloud2.Billboard\ Size=0.001
Point\ Cloud2.Color\ Transformer=Flat Color
Point\ Cloud2.Decay\ Time=0
Point\ Cloud2.Enabled=1
Point\ Cloud2.Position\ Transformer=XYZ
Point\ Cloud2.Selectable=1
Point\ Cloud2.Style=2
Point\ Cloud2.Topic=/kinect/depth/points2
Point\ Cloud2..Flat\ ColorColorR=1
Point\ Cloud2..Flat\ ColorColorG=1
Point\ Cloud2..Flat\ ColorColorB=1
Point\ Cloud2..IntensityAutocompute\ Intensity\ Bounds=1
Point\ Cloud2..IntensityMax\ ColorR=1
Point\ Cloud2..IntensityMax\ ColorG=1
Point\ Cloud2..IntensityMax\ ColorB=1
Point\ Cloud2..IntensityMax\ Intensity=4096
Point\ Cloud2..IntensityMin\ ColorR=0
Point\ Cloud2..IntensityMin\ ColorG=0
Point\ Cloud2..IntensityMin\ ColorB=0
Point\ Cloud2..IntensityMin\ Intensity=0
Tool\ 2D\ Nav\ GoalTopic=move_base_simple/goal
Tool\ 2D\ Pose\ EstimateTopic=initialpose
Camera\ Type=rviz::OrbitViewController
Camera\ Config=2.88559 6.26704 6.20208 0.118644 2.18674 -0.179489
Property\ Grid\ State=selection=Camera2.Enabled.Camera2.Image Topic;expanded=.Global Options,Point Cloud2.Enabled,Camera.Enabled,Camera2.Enabled;scrollpos=0,0;splitterpos=330,660;ispageselected=1
[Display0]
Name=Grid
Package=rviz
ClassName=rviz::GridDisplay
[Display1]
Name=Point Cloud2
Package=rviz
ClassName=rviz::PointCloud2Display
[Display2]
Name=Camera
Package=rviz
ClassName=rviz::CameraDisplay
[Display3]
Name=Camera2
Package=rviz
ClassName=rviz::CameraDisplay


Close the rxgraph and now '''in a new Terminal''' Launch the visualization software RVIZ. Notice that the default launch for rviz is set to display 3 Cameras. '''If when starting, the window seems to take a lot of memory (and most probably it will), you can release memory by UNCHECKING the Cameras in the left table as shown in the figure'''.
First, we need to have installed the following STACKS. To know how to install them, please read [http://mediawiki.isr.ist.utl.pt/wiki/ROS_Tutorial#3rd_Party_Stacks_.26_Packages_installations 3rd Party stacks installation].
. /opt/ros/cturtle/setup.sh
rosrun rviz rviz -d /tmp/kinect.vcg&


[[Image:Kinect.png]]
* [http://www.ros.org/wiki/camera_drivers camera_drivers]
 
* [http://www.ros.org/wiki/perception_pcl perception_pcl]
That's it. You can kill processes and unplug the Kinect.
* [http://www.ros.org/wiki/perception_pcl_addons perception_pcl_addons]
 
== Test Demos ==


bla bla
[http://www.ros.org/wiki/openni_kinect openni_kinect]


= Shadow Robot Stack =
= Shadow Robot Stack =
Line 243: Line 151:
In this section we present some useful steps to install the [http://www.ros.org/wiki/shadow_robot shadow_robot STACK], although this stack is still under development, installation steps should be similar in future releases.
In this section we present some useful steps to install the [http://www.ros.org/wiki/shadow_robot shadow_robot STACK], although this stack is still under development, installation steps should be similar in future releases.


To Install the Kinect STACK, You first need installed the following stacks:
To Install the full shadow_robot STACK, You first need installed the following stacks:
 
* [http://www.ros.org/wiki/bosch_drivers bosch_drivers]
* [http://www.ros.org/wiki/pr2_common pr2_common]
* [http://www.ros.org/wiki/pr2_mechanism pr2_mechanism]
* [http://www.ros.org/wiki/trajectory_msgs trajectory_msgs PACKAGE] (use roscd trajectory_msgs to check if is already installed)
* [http://www.ros.org/wiki/control control] (it's in Mercurial Repository)
* [http://www.ros.org/wiki/pr2_controllers pr2_controllers]
* [http://www.ros.org/wiki/pr2_simulator# pr2_simulator]


Because the developer of this STACK Ugo Cupcic recommend it, instead of just installing the whole STACK at once, we first download the full STACK and then begin installing the [http://www.ros.org/wiki/sr_hand sr_hand PACKAGE], and then, we will add the rest of the packages.
Because the developer of this STACK Ugo Cupcic recommend it, instead of just installing the whole STACK at once (that will give several errors), we first download the full STACK and then begin installing the [http://www.ros.org/wiki/sr_hand sr_hand PACKAGE], then the sr_control_gui PACKAGE, and finally we will add the rest of the packages.


As you will see in the, the shadow_robot STACK and [http://www.ros.org/wiki/sr_hand sr_hand PACKAGE], the repository is in Bazar, so, first make sre that you have the bazar installed.
As you will see in the, the shadow_robot STACK and [http://www.ros.org/wiki/sr_hand sr_hand PACKAGE], the repository is in Bazar, so, first make sre that you have the bazar installed.
Line 272: Line 188:
  echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc
  echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc


Until now, we just downloaded the whole STACK, and as Ugo Cupcic recommended, we will install first the sr_hand PACKAGE, so, to do that, in Terminal enter:
Until now, we just downloaded the whole STACK, and as Ugo Cupcic recommended, '''we will install first the sr_hand PACKAGE''', so, to do that, in Terminal enter:
  PACKAGE="sr_hand"
  PACKAGE="sr_hand"
roscd $PACKAGE
rosmake --rosdep-install
Now, let us procede with the '''sr_control_gui PACKAGE'''
PACKAGE="sr_control_gui"
roscd $PACKAGE
rosmake --rosdep-install
Now, build the '''cyberglove PACKAGE'''
PACKAGE="cyberglove"
roscd $PACKAGE
rosmake --rosdep-install
Now. build the '''dataglove STACK'''. To do so, enter the following in Terminal:
STACK="dataglove"
export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/shadow_robot/$STACK:$ROS_PACKAGE_PATH
echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/shadow_robot/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc
roscd $STACK
rosmake --rosdep-install
Now install the '''dataglove_processing PACKAGE'''
PACKAGE="dataglove_processing"
roscd $PACKAGE
rosmake --rosdep-install
Now build the '''sr_remappers'''
PACKAGE="sr_remappers"
  roscd $PACKAGE
  roscd $PACKAGE
  rosmake --rosdep-install
  rosmake --rosdep-install
Line 298: Line 242:
Now, start the GUI Interface
Now, start the GUI Interface
  rosrun sr_control_gui sr_control_gui
  rosrun sr_control_gui sr_control_gui
''' UPDATE '''
roslaunch sr_hand sr_arm_motor.launch
roslaunch sr_hand rviz_motor.launch
rosrun sr_control_gui sr_control_gui
roslaunch cyberglove cyberglove.launch
roslaunch sr_remappers remapper_glove.launch
'''VER EL TOPIC'''
rostopic echo /srh/shadowhand_data




This is a helpfull link. [http://www.ros.org/doc/api/sr_hand/html/ sr_hand Documentation]
This is a helpfull link. [http://www.ros.org/doc/api/sr_hand/html/ sr_hand Documentation]
'''SETING UP THE CYBERGLOVE'''
print mac adress
hcitool scan
Bind the mac adress to the rfcomm0 ('''00:80:25:12:E7:57''' WCGII-3024)
sudo rfcomm bind rfcomm0 00:80:25:12:E7:57 1


= Cyberglove =
= Cyberglove =


= ROS - OpenRAVE =
= ROS - OpenRAVE =
To see a Complete tutorial of OpenRAVE, please review this link: [http://mediawiki.isr.ist.utl.pt/wiki/OpenRAVE_Tutorial OpenRAVE Tutorial]


= Interfacing Other Robots =
= Interfacing Other Robots =
= Streaming images from USB cameras =
I used the ros-electric-brown-perception DEB package, in combination with ROS Electric Emys, Ubuntu 11.04 and a Logitech webcam.
Once this package is installed, to start the streaming you need to (1) have the roscore running, (2) set one environment variable and (3) run gscam.
  roscore
  roscd gscam
  cd bin
  export GSCAM_CONFIG="v4l2src device=/dev/video0  ! video/x-raw-rgb ! ffmpegcolorspace"
  rosrun gscam gscam
You can display the image stream with image_view:
  rosrun image_view image_view image:=/usb_cam/image_raw
As and alternative to setting the environment variable, you can create a launch file for gscam:
  cd ros/electric/stacks/brown_perception/gscam
  mkdir launch
  nano launch/gscam.launch
The content of the launch file should be:
  <launch>
    <env name="GSCAM_CONFIG" value="v4l2src device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace"/>
    <node pkg="gscam" name="gscam" type="gscam"  output="screen"/>
  </launch>
You can then run this command to start the streaming (this also starts the roscore, should that be needed):
  roslaunch gscam gscam.launch

Latest revision as of 11:06, 19 April 2012

Note 1: this tutorial is under construction.

Note 2: for the past distribution of ROS C-Turtle, please review this link

Install ROS

To start using ROS meta operating system for robots, we recommend to follow the next steps:

  1. First you must install ROS. There already exist a very good tutorial to do so, and when you reach the part where you have to decide which version of ROS you want to install, we recommend to select the "Desktop-Full Install". An easy to follow tutorial on how to install ROS is in here(ROS Installation).
  2. To get a quick and good tutorial for beginners see this page (BEGINNERS TUTORIAL). We recommend to read at least the beginners tutorials.
  3. To start adding stacks please read next section.

3rd Party Stacks & Packages installations

Source code, stacks and packages are stored in different repositories depending on who is developing the code. Must common repositories are the SVN and Bazar, so, downloading and installation are covered in this tutorial, but first, you must know how to identify these data.

When You are interested in a particular software, as showed in the beginners tutorial, you should search for the topic, and eventually, you will find yourself in a web-page similar to the one that is shown in the Figure below.


In the Figure, it is important that you recognize five features:

  1. Application Name (Green). This name, shows the main functionality of the stack. Sometimes has the same name as the STACK name, but is not always the case.
  2. STACK name (Magenta). This is the actual name of the STACK. the others that are at the right side of the STACK name, are the sub-stacks or packages contained in this STACK. So, before considering to install the stack, first check if you have it already installed.
  3. Dependencies (Yellow). Before starting to install this actual STACK, is very recommended that you first have this stack-dependencies installed. Yes, this means that you have to track back all the dependencies until you find one with all dependencies already installed. (Ros Base has install for you many of the most common, so don't worry so much).
  4. Repository (Blue). Acording to the repository, you will proceed to to the installation. In next subsection we will show how to do Downloading an installation of ROS-PKG (SVN) and Bazar repositories.
  5. SOURCE or trunk link (Red). This is the branch for downloading the SOURCE code.


From ROS-PKG: SVN Repository

ROS-PKG is a community repository for developing libraries that are generally robot agnostic. Many of the capabilities frequently associated with ROS, such as a navigation library and rviz visualizer, are developed in this repository. To see the list of stacks of this Repository, pleas go to this page: ROS-PKG STACKS LIST

In this part of the tutorial we will show how to install the Perception_PCL STACK, but steps are the same for any stack from the ROS-PKG Repository. To install any of the stacks here, do the following:

STACK=perception_pcl

First, make sure that you DON'T have this stack or package already installed. In terminal enter:

rosstack find $STACK

In this case, as the stack has been not installed, there will be a reply. In the case that you have it already installed, the result will be the Directory in which you have the stack installed. You can also search if the code is declared as a PACKAGE, so look for it entering in Terminal the following:

rospack find $STACK

In this case, it will complain again. So, what is next step?... ensure that we have already installed the Dependencies. IN THIS SPECIFIC case, Dependancies are:

  • common
  • common_msgs
  • driver_common
  • geometry
  • ros
  • ros_comm

We know in advance that these stacks, are part of the default ROS Base, so you don't have to track back any stack or package, so we can continue.

Make sure you have SVN installed.

sudo aptitude install subversion

Create the Directory where you want to install the stack, and go there..

mkdir -p $HOME/Ros_Stacks/
cd $HOME/Ros_Stacks/

Then you can checkout the SOURCE (trunk link) from the svn repository listed in the wiki. The trunk if you are curious is the default branch of code in a svn repository, as opposed to the experimental branch. So, when you go to the STACK web page, you will see the something like in the Figure above.

You should pay special attention to the Repository and to the Source lines. The Repository line, indicates the name of the STACK and the source indicates the link to experimental stack. What we want, is to get the whole Stack, so, in order to do that, first, copy the link of the SOURCE line but delete everything after the word " https:......../trunk/ ". then in terminal, save it in a variable, for example:

SOURCE="https://code.ros.org/svn/ros-pkg/stacks/perception_pcl/trunk"

Now that we have the STACK name and the SOURCE, we just do the following in Terminal

svn co $SOURCE $STACK

After downloaded, edit your ROS_PACKAGE_PATH in your .bashrc

export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH
echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc

Almost finish. To actually install the stack, you have to enter to the stack directory and install the STACK. to do so, just enter in terminal:

roscd $STACK
rosmake --rosdep-install

Ok, now you can try your STACK.

From Bazar (bzr) Repository

First, make sure that you have the bazar installed in your pc

sudo apt-get install bzr

Then prepare the directory where you want to install the STACK.

mkdir -p $HOME/Ros_Stacks/
cd $HOME/Ros_Stacks/

Get the SOURCE code, that is the link of the web-page, example

SOURCE="lp:sr-ros-interface"
STACK="shadow_robot"

bzr branch $SOURCE
mv sr-ros-interface/shadow_robot .
rm -r sr-ros-interface

Export the PATH to $ROS_PACKAGE_PATH

export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH
echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc

finally, build the STACK

roscd $STACK
rosmake --rosdep-install

From Mercurial (hg) Repository

First, make sure that you have the Mercurial installed in your pc

sudo apt-get install mercurial

Then prepare the directory where you want to install the STACK.

mkdir -p $HOME/Ros_Stacks/
cd $HOME/Ros_Stacks/

Get the SOURCE code, that is the link of the web-page. As a example , we install the control STACK

STACK="control"
SOURCE="https://bitbucket.org/sglaser/control"

cd $HOME/Ros_STACKS
hg clone $SOURCE

Export the path

export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH
echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc

Finally, build the Stack

roscd $STACK
rosmake --rosdep-install

Kinect Stack

ROS Kinect is an open source project focused on the integration of the Microsoft Kinect sensor with ROS. The kinect ROS stack contains low-level drivers, visualization launch files, and PCL/OpenCV tutorials/demos.

Install Drivers

In the C-Turtle distribution, the use of Kinect was done trough the Kinect Stack, now, in Diamondback, it is done by the ni STACK. let us see how to install it.

First, we need to have installed the following STACKS. To know how to install them, please read 3rd Party stacks installation.

openni_kinect

Shadow Robot Stack

Installation

In this section we present some useful steps to install the shadow_robot STACK, although this stack is still under development, installation steps should be similar in future releases.

To Install the full shadow_robot STACK, You first need installed the following stacks:

Because the developer of this STACK Ugo Cupcic recommend it, instead of just installing the whole STACK at once (that will give several errors), we first download the full STACK and then begin installing the sr_hand PACKAGE, then the sr_control_gui PACKAGE, and finally we will add the rest of the packages.

As you will see in the, the shadow_robot STACK and sr_hand PACKAGE, the repository is in Bazar, so, first make sre that you have the bazar installed.

sudo apt-get install bzr

Then prepare the directory where you want to install the STACK.

mkdir -p $HOME/Ros_Stacks/
cd $HOME/Ros_Stacks/

Get the SOURCE code..:

SOURCE="lp:sr-ros-interface"
STACK="shadow_robot"

bzr branch $SOURCE
mv sr-ros-interface/shadow_robot .
rm -r sr-ros-interface

If that fails, this is an alternative way to download the SOURCE code .

wget http://launchpad.net/sr-ros-interface/release1.2/1.2.0/+download/release1.2.tar.gz
tar xvvzf release1.2.tar.gz
mv release1.2/shadow_robot .
rm -r release1.2

Now, export the path to the ROS_PACKAGE_PATH

export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH
echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc

Until now, we just downloaded the whole STACK, and as Ugo Cupcic recommended, we will install first the sr_hand PACKAGE, so, to do that, in Terminal enter:

PACKAGE="sr_hand"
roscd $PACKAGE
rosmake --rosdep-install

Now, let us procede with the sr_control_gui PACKAGE

PACKAGE="sr_control_gui"
roscd $PACKAGE
rosmake --rosdep-install

Now, build the cyberglove PACKAGE

PACKAGE="cyberglove"
roscd $PACKAGE
rosmake --rosdep-install

Now. build the dataglove STACK. To do so, enter the following in Terminal:

STACK="dataglove"
export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/shadow_robot/$STACK:$ROS_PACKAGE_PATH
echo "export ROS_PACKAGE_PATH=$HOME/Ros_Stacks/shadow_robot/$STACK:$ROS_PACKAGE_PATH" >> $HOME/.bashrc
roscd $STACK
rosmake --rosdep-install

Now install the dataglove_processing PACKAGE

PACKAGE="dataglove_processing"
roscd $PACKAGE
rosmake --rosdep-install


Now build the sr_remappers

PACKAGE="sr_remappers"
roscd $PACKAGE
rosmake --rosdep-install

Here there are other useful links:

Start Using NOT FINISHED

This Launchs the Node

roslaunch sr_hand srh_motor.launch 

Now Display the Hand with the RVIZ

roslaunch sr_hand rviz_motor.launch

The RVIZ will not display automatically the Hand, because you have to add it to the display interface, To do this, click on Add at the bottom left of rviz, then select Robot Model. You can also visualize the targets of the hand by using a second robot_model in rviz. Don't forget to specify the correct topics:

  • To display the hand position: set Robot Description to hand_description and TF Prefix to /srh/position (on the left hand side, in the parameters of your robot_model).
  • To display the hand targets: set Robot Description to hand_description and TF Prefix to /srh/target.

Now, start the GUI Interface

rosrun sr_control_gui sr_control_gui


UPDATE

roslaunch sr_hand sr_arm_motor.launch
roslaunch sr_hand rviz_motor.launch
rosrun sr_control_gui sr_control_gui
roslaunch cyberglove cyberglove.launch
roslaunch sr_remappers remapper_glove.launch

VER EL TOPIC

rostopic echo /srh/shadowhand_data


This is a helpfull link. sr_hand Documentation

SETING UP THE CYBERGLOVE

print mac adress

hcitool scan

Bind the mac adress to the rfcomm0 (00:80:25:12:E7:57 WCGII-3024)

sudo rfcomm bind rfcomm0 00:80:25:12:E7:57 1

Cyberglove

ROS - OpenRAVE

To see a Complete tutorial of OpenRAVE, please review this link: OpenRAVE Tutorial

Interfacing Other Robots

Streaming images from USB cameras

I used the ros-electric-brown-perception DEB package, in combination with ROS Electric Emys, Ubuntu 11.04 and a Logitech webcam. Once this package is installed, to start the streaming you need to (1) have the roscore running, (2) set one environment variable and (3) run gscam.

 roscore
 roscd gscam
 cd bin
 export GSCAM_CONFIG="v4l2src device=/dev/video0  ! video/x-raw-rgb ! ffmpegcolorspace"
 rosrun gscam gscam

You can display the image stream with image_view:

 rosrun image_view image_view image:=/usb_cam/image_raw

As and alternative to setting the environment variable, you can create a launch file for gscam:

 cd ros/electric/stacks/brown_perception/gscam
 mkdir launch
 nano launch/gscam.launch

The content of the launch file should be:

 <launch>
   <env name="GSCAM_CONFIG" value="v4l2src device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace"/>
   <node pkg="gscam" name="gscam" type="gscam"  output="screen"/>
 </launch>

You can then run this command to start the streaming (this also starts the roscore, should that be needed):

 roslaunch gscam gscam.launch