====== Bridging ROS and xAAL ====== {{tag>xAAL howto Nao ROS}} Current status (20180120) : This program is for Nao. A new installation is being done for Pepper [[smarthome:xaal_ros_pepper]]. The program is installed in folder ''~/catkin_ws/src/nao_xaal'' and the latest version is in https://redmine.telecom-bretagne.eu/projects/xaalros/repository ===== Running the demo ===== roscore rosrun openni_tracker openni_tracker roslaunch openni_launch openni.launch Check (optional) rosrun image_view image_view image:=/camera/rgb/image_color To open the web streaming rosrun web_video_server web_video_server and open a browser and go directly to http://0.0.0.0:8080/stream_viewer?topic=/camera/rgb/image_color or see all available images on http://0.0.0.0:8080 Connect the computer and nao on the same network and get their ips and replace by their values in the following command : roslaunch nao_bringup nao_full_py.launch nao_ip:=10.77.3.26 roscore_ip:=10.77.3.109 Run nao_xaal : (Current status 20170330: this does not do anything as Nao does not speak) rosrun nao_xaal controller.py ===== Install ===== - Install [[:ros|ros]]. You will have created a catkin workspace CATKIN_WS (for instance ~/catkin_ws) - Install [[http://wiki.ros.org/web_video_server|web_video_server ROS package]]. In more detail, download the code from https://github.com/RobotWebTools/web_video_server and put the folder (with files package.xml and CMakeLists.txt) in CATKIN_WS/src. Then in CATKIN_WS, run catkin_make. - Install the ros packages for kinect : [[http://wiki.ros.org/openni_tracker|openni_tracker]] and openni_launch - Install ROS packages for NAO with the instructions from http://wiki.ros.org/nao_robot, https://github.com/ros-naoqi/nao_robot, http://wiki.ros.org/nao/Tutorials/Installation - download from [[https://developer.softbankrobotics.com/us-en/downloads/nao-v3|aldebaran]] the Python SDK the compressed file Python 2.7 SDK 1.14.5 Linux 64 and install according to th instructions http://doc.aldebaran.com/1-14/dev/python/install_guide.html. In details : - Set the environnement variable PYTHONPATH to /path/to/python-sdk by doing for example: $ export PYTHONPATH=${PYTHONPATH}:/path/to/python-sdk - check the installation with python import naoqi - ROS packages for the Nao robot sudo apt-get install ros-indigo-driver-base ros-indigo-move-base-msgs ros-indigo-octomap ros-indigo-octomap-msgs ros-indigo-humanoid-msgs ros-indigo-humanoid-nav-msgs ros-indigo-camera-info-manager ros-indigo-camera-info-manager-py sudo apt-get install ros-indigo-nao-robot - Install xAAL - download from http://recherche.telecom-bretagne.eu/xaal/software/ - revert to version 1271 - install all dependencies sudo apt-get install lua5.2* libmnl* libsensors* libjson0 libjson0-dev - go to folder xAAL/code/C/trunk/libxaal and execute make - install pysodium - install libsodium with instructions from https://download.libsodium.org/doc/installation/index.html#integrity-checking by downloading from https://download.libsodium.org/libsodium/releases/ the tar ball and run tar -xv libsodium*tar* cd libsodium* ./configure make && make check sudo make install - download from https://pypi.python.org/pypi/pysodium the pysodium tar and install likewise - Configure the system by inputing the right xaaladdr of the various smart home devices in file ~/catkin_ws/src/nao_xaal/scripts/nao_xaal.conf ===== Troubleshooting ===== ==== Kinect nodes ==== If you get an error like below while launching ''roslaunch openni_launch openni.launch'' [FATAL] [1505723416.829285686]: Failed to load nodelet '/camera/points_xyzrgb_sw_registered` of type `depth_image_proc/point_cloud_xyzrgb` to manager `camera_nodelet_manager' [FATAL] [1505723416.829758876]: Failed to load nodelet '/camera/disparity_depth` of type `depth_image_proc/disparity` to manager `camera_nodelet_manager' [camera/points_xyzrgb_sw_registered-12] process has died [pid 18701, exit code 255, cmd /opt/ros/indigo/lib/nodelet/nodelet load depth_image_proc/point_cloud_xyzrgb camera_nodelet_manager --no-bond rgb/image_rect_color:=rgb/image_rect_color rgb/camera_info:=rgb/camera_info depth_registered/image_rect:=depth_registered/sw_registered/image_rect_raw depth_registered/points:=depth_registered/points __name:=points_xyzrgb_sw_registered __log:=/home/ihsev/.ros/log/551a83f0-9c4b-11e7-8d73-002710a3474c/camera-points_xyzrgb_sw_registered-12.log]. the problem seems to be with memory allocation, Try typing this command in the same terminal where you get this error ''killall XnSensorServer''. then try launching the node again. If the process dies again, ''ctrl+c'' and then type the killall command again (it should say no processes found). Then try launching the node again. Ref : https://answers.ros.org/question/54863/camera_nodelet_manager-1-process-has-died-error-with-kinect/ ==== Speech ==== speech.launch in ''~/catkin_ws/src/nao_robot/nao_apps/launch'' but command ''rosrun nao_apps nao_alife.py'' crashes What worked : I added to file ''nao_full_py.launch'' from ''catkin_ws/src/nao_robot/nao_bringup/launch'' the lines : From the terminal: roscore roslaunch nao_apps speech.launch nao_ip:=10.77.3.26 roscore_ip:=10.77.3.103 network_interface:=wlan0 OU roslaunch nao_bringup nao_full_py.launch nao_ip:=10.77.3.26 roscore_ip:=10.77.3.103 network_interface:=wlan0 rostopic pub /speech -1 std_msgs/String 'hello' ===== References ===== Project report by Yiqiao Chen: {{:report:rappot_final_projet_205_v2.pdf|}}: web_video_server replaced webrtc http://wiki.ros.org/nao/Tutorials http://wiki.ros.org/nao/Tutorials/Installation http://wiki.ros.org/nao_apps