|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Tele-operating the Nao using a Microsoft KinectDescription: This tutorial will demonstrate how to use a MS Kinect to Tele-operate the arms of the Nao. This will require no cross-compiling of code.
This part assumes that you are using an ubuntu 32-bit. If you are using ubuntu 64-bit, this is a bit more difficult, instructions are coming soon.
The only thing that you need to install to use the Nao through ROS is the NaoQI python toolkit.
- Download the pynaoqi-python-2.7-naoqi-188.8.131.52-linux32 file from the aldebaran site.
Unpack to some directory <dir>
add <dir> to your pythonpath by adding a line like this to your .bashrc file:
(note, sub the latest version when downloading pynaoqi from aldebaran, and when adding to your pythonpath)
ROS and OpenNI install
Next, you need to install ROS on your system. I recommend that you install from debian packages, there is not much reason to compile the source for the base packages yourself.
Install ros according to instructions on ros.org (this page was written for ros-electric, but later versions should work when released) Dave recommends installing Desktop-Full Install if you have the necessary space (3GB or so).
After that's installed, install the openni stack like so:
sudo apt-get install ros-electric-openni-kinect
which should install the necessary kinect stuff.
Now, you need to install the necessary extra repositories which contain Dave's code for kinect, and the Freiberg repository for the Nao code. Luckily, your good buddy Dave has made this easy for you as well. This can be done using a rosinstall file to set up a workspace. OK, so here's what you do:
sudo apt-get install python-setuptools python-svn ros-electric-joystick-drivers sudo easy_install -U rosinstall
Create a new text file by typing "gedit" in the terminal, and paste the following code in it:
#dependencies for USC code # Nao respository - svn: uri: https://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_stacks/nao_robot local-name: stacks/nao_robot - svn: uri: https://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_stacks/nao_common local-name: stacks/nao_common - svn: uri: https://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_stacks/humanoid_msgs local-name: stacks/humanoid_msgs # USC code - svn: uri: https://usc-ros-pkg.svn.sourceforge.net/svnroot/usc-ros-pkg local-name: stacks/usc-ros-pkg # Yale code - svn: uri: https://yale-ros-pkg.googlecode.com/svn/trunk local-name: stacks/yale-ros-pkg
Save this file with "<somefilename>.rosinstall" to some path, lets say:
Now use the code below to install the repositories in the ".rosinstall" file created in the earlier step:
rosinstall <workspace-name> /path/to/rosinstall/file/<somefilename>.rosinstall ~/opt/ros/fuerte
(note, sub the ros distro which you are using. Shown above is for "fuerte")
For <workspace-name>, I like ~/electric-ros, but pick whatever you want to name it. Make sure to sub your preferred distro for electric.
This will download a whole mess of files, everything you need to do this simple task, plus a lot more. Last I checked, this download was about 152MB of code.
Follow the instructions at the end about adding a setup.bash line to your .bashrc file.
echo "source <workspace-name>/setup.bash" >> ~/.bashrc source ~/.bashrc
next, make the necessary packages:
rosmake tf_to_pose bandit_to_nao openni_skeleton openni_tracker_yale fake_nao humanoid_nav_msgs nao_teleop nao_remote
Now, start up the nao, and connect to it (of course replace NAO_IP with the IP that the Nao states when you press it's chest button):
NAO_IP=192.168.2.2 roslaunch nao_driver nao_driver.launch
in another terminal, load up the controller:
roslaunch dave_yale kinect_nao_control.launch
If you want to use the Kinect to playback motions in real-time, use the following in yet another terminal:
roslaunch dave_yale kinect_tracker.launch
Try out a psi pose:
and then the nao should follow your actions. And you should be good.