Pepper lab book

Lab book for work on the Robocup@Home Standard Platform League competition which uses the Pepper robot.

I’m asked to look into:
– localisation
– navigation

Earlier experiences with robots tell me that we need a simulator that allows us to easily run tests. And as we don’t yet have a pepper robot a simulator is a good start anyway. Gazebo is a ROS compatible simulator that seems suitable.

Setting up a computer with Ubuntu 16.04.2 LTS and a GPU that can run Gazebo without crashing (a recurring problem with Linux GPU drivers in combination with Gazebo).

Installing “ros kinetic” and reading tutorials:

http://wiki.ros.org/ROS/Tutorials

Searching pepper specific packages:

http://wiki.ros.org/pepper

After installing all pepper packages using:

sudo apt-get install ros-kinetic-naoqi-bridge-msgs ros-kinetic-naoqi-dcm-driver ros-kinetic-pepper-bringup ros-kinetic-pepper-control ros-kinetic-pepper-dcm-bringup ros-kinetic-pepper-description ros-kinetic-pepper-gazebo-plugin ros-kinetic-pepper-meshes ros-kinetic-pepper-moveit-config ros-kinetic-pepper-robot ros-kinetic-pepper-sensors-py ros-kinetic-pepperl-fuchs-r2000

and starting Gazebo:

roslaunch pepper_gazebo_plugin pepper_gazebo_plugin_Y20.launch

and pressing ‘play’ the robot falls on its side and its joints all stay fixed.

Reading the Gazebo ROS tutorials on how to define a robot (the RRBot example):

http://gazebosim.org/tutorials?cat=connect_ros

Removing all ‘apt-get’ installed packages to see if the github repositories have better descriptions (additions that are not yet included in the ‘apt-get’ packages).

cd ~/catkin_ws/src
git clone https://github.com/ros-naoqi/pepper_virtual
git clone https://github.com/ros-naoqi/pepper_robot
git clone https://github.com/ros-naoqi/pepper_dcm_robot
cd ..
catkin_make

it turns out the meshes need to be installed using ‘apt-get’ because of copyright issues:

sudo apt-get install ros-kinetic-pepper-meshes

Now at least the joints move freely but pepper still falls when pressing ‘play’:

roslaunch pepper_gazebo_plugin pepper_gazebo_plugin_Y20.launch

The controller should be able to fix that:

apt-get install ros-kinetic-controller-manager
roslaunch pepper_control pepper_control_position.launch

but for some reason I get these warnings:

[INFO] [1493659972.516635, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[WARN] [1493660002.655930, 89.766000]: Controller Spawner couldn't find the expected controller_manager ROS interface.

The virtual sensors do work, images produced by the cameras:

rosrun image_view image_view image:=/pepper_robot/camera/front/image_raw
rosrun image_view image_view image:=/pepper_robot/camera/bottom/image_raw

depth information is given:

rostopic hz /pepper_robot/camera/depth/points

sonar information is given:

rostopic echo /pepper_robot/sonar_back
rostopic echo /pepper_robot/sonar_front

no laser scanners are found on the virtual robot.

2017-05-03

Don’t forget to install the control dependencies:

sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control

And we also seem to need:

sudo apt-get install ros-kinetic-gazebo-ros-control ros-kinetic-ros-controllers

When running this and pressing “play” the robot keeps its joints fixed and again falls to the ground.

roslaunch pepper_gazebo_plugin pepper_gazebo_plugin_Y20.launch
roslaunch pepper_control pepper_control_position.launch

In addition we get some errors:


[ERROR] [1493839940.039714623, 89.547000000]: A controller named '/pepper_dcm/WheelB_controller' was already loaded inside the controller manager
[ERROR] [1493839941.043294848, 90.387000000]: A controller named '/pepper_dcm/WheelFL_controller' was already loaded inside the controller manager
[ERROR] [1493839942.046338063, 91.256000000]: A controller named '/pepper_dcm/WheelFR_controller' was already loaded inside the controller manager
[ERROR] [1493839943.049357655, 92.135000000]: A controller named '/pepper_dcm/joint_state_controller' was already loaded inside the controller manager

2017-05-04

Installing ros-indigo-desktop-full and all pepper packages on Ubuntu 14.04 LTS. Had to add this to ~/.bashrc:

export LC_NUMERIC=C

and this


cd ~/catkin_ws/src/
git clone https://github.com/roboticsgroup/roboticsgroup_gazebo_plugins
cd ..
catkin_make

to get rid of errors. The Pepper robot doesn’t fall on it side anymore but this still gives errors:

https://github.com/ros-naoqi/pepper_moveit_config

[ERROR] [1493935711.503737635, 104.749000000]: PluginlibFactory: The plugin for class 'moveit_rviz_plugin/MotionPlanning' failed to load. Error: According to the loaded plugin descriptions the class moveit_rviz_plugin/MotionPlanning with base class type rviz::Display does not exist. Declared types are rviz/Axes rviz/Camera rviz/DepthCloud rviz/Effort rviz/FluidPressure rviz/Grid rviz/GridCells rviz/Illuminance rviz/Image rviz/InteractiveMarkers rviz/LaserScan rviz/Map rviz/Marker rviz/MarkerArray rviz/Odometry rviz/Path rviz/PointCloud rviz/PointCloud2 rviz/PointStamped rviz/Polygon rviz/Pose rviz/PoseArray rviz/Range rviz/RelativeHumidity rviz/RobotModel rviz/TF rviz/Temperature rviz/WrenchStamped rviz_plugin_tutorials/Imu

[ERROR] [1493935732.766818945, 120.971000000]: MoveItSimpleControllerManager: Action client not connected: pepper_dcm/Head_controller/follow_joint_trajectory

[ERROR] [1493935752.895225026, 136.031000000]: MoveItSimpleControllerManager: Action client not connected: pepper_dcm/Pelvis_controller/follow_joint_trajectory

[ERROR] [1493935753.594489576, 136.554000000]: Exception while loading move_group capability ‘move_group/MoveGroupPickPlaceAction’: According to the loaded plugin descriptions the class move_group/MoveGroupPickPlaceAction with base class type move_group::MoveGroupCapability does not exist. Declared types are move_group/ApplyPlanningSceneService move_group/ClearOctomapService move_group/MoveGroupCartesianPathService move_group/MoveGroupExecuteService move_group/MoveGroupExecuteTrajectoryAction move_group/MoveGroupGetPlanningSceneService move_group/MoveGroupKinematicsService move_group/MoveGroupMoveAction move_group/MoveGroupPlanService move_group/MoveGroupQueryPlannersService move_group/MoveGroupStateValidationService
Available capabilities: move_group/ApplyPlanningSceneService, move_group/ClearOctomapService, move_group/MoveGroupCartesianPathService, move_group/MoveGroupExecuteService, move_group/MoveGroupExecuteTrajectoryAction, move_group/MoveGroupGetPlanningSceneService, move_group/MoveGroupKinematicsService, move_group/MoveGroupMoveAction, move_group/MoveGroupPlanService, move_group/MoveGroupQueryPlannersService, move_group/MoveGroupStateValidationService

2017-05-18

Installing Ubuntu 14.04 on Dell XPS 15 laptop. Wireless drivers for BroadCom BCM43602 don’t work. With

modprobe brcmfmac

only “Amsterdam Science Park” works, not eduroam/uva. Using the steps Jonathan suggested:

https://github.com/ros-naoqi/pepper_virtual/tree/master/pepper_gazebo_plugin

but still no movement. Manual installing these:

sudo aptitude install ros-indigo-moveit-ros-move-group
sudo aptitude install ros-indigo-moveit-controller-manager
ros-indigo-moveit-simple-controller-manager
ros-indigo-pepper-moveit-config
ros-indigo-moveit-ros-visualization

helps.

2017-05-22
For some reason now it does work (installed new GPU drivers but that should not have helped), I’m moving the left arm but there is no GUI options to select other groups as the moveit manual explains. Make sure to click the “PLAY” button in gazebo otherwise MoveIt doesn’t start.

Found the other groups, “Planning Request” is a sub-menu of “MotionPlanning”. Now I can move:
left-arm
right-arm
left-hand
right-hand

But these give errors:
base
head

2017-05-23
Pepper moves with:

rostopic pub -1 /cmd_vel geometry_msgs/Twist -- '[0.1, 0.0, 0.0]' '[0.0, 0.0, 0.0]'

but it is not the movement that is expected, its moving sideways in a weird way, adding “<legacyMode>false</legacyMode>” doesn’t help. Seems I’m not the only one:

https://groups.google.com/forum/#!topic/ros-sig-aldebaran/GN85jo_2Ano

2017-06-7
Seems like the pepper-gazebo model is not in any state that we could easily use it. Laser scanners are also missing. Now either we spend a lot of time making the simulator work, or we instead use prerecorded data (rosbag) to test things.

2017-06-21
The plan now is to make a dataset with the real robot of all ros topics. This dataset can then be used to test ros gmapping slam package. Looking into working with the real robot:

http://wiki.ros.org/pepper
https://groups.google.com/forum/#!topic/ros-sig-aldebaran/FEtO4Gf9erc

2017-06-28
record: http://wiki.ros.org/rosbag
move: https://github.com/ros-naoqi/pepper_moveit_config
gmapping: http://wiki.ros.org/slam_gmapping/Tutorials/MappingFromLoggedData

2017-07-06
Connecting over a wireed connecton (eth0) and following the tutorial:

http://wiki.ros.org/pepper/Tutorials

after installing the 2.1.4 C++ and 2.1.4 Python NAOqi SDK from:

http://wiki.ros.org/nao/Tutorials/Installation#NAOqi

I could start the pepper_bringup script:


roslaunch pepper_bringup pepper_full.launch nao_ip:=pepper.local roscore_ip:=localhost

and read and visualize images, depth, laser, sonar data from the real robot:

rosrun rviz rviz -d /opt/ros/indigo/share/pepper_bringup/config/pepper.rviz

Moving the robot using moveit proved more difficult,

https://github.com/ros-naoqi/pepper_moveit_config

roslaunch pepper_dcm_bringup pepper_bringup.launch
(hit chest button twice to wake the robot to set stiffness???)
roslaunch pepper_moveit_config moveit_planner.launch

I get these errors and can not move the robot:

[ERROR] [1499367758.659473678]: Please, wakeUp the robot to be able to set stiffness
[WARN] [WallTime: 1499367782.563326] Controller Spawner couldn't find the expected controller_manager ROS interface.

Even though the simulator can move the arms:

roslaunch pepper_moveit_config demo.launch

2017-07-11
Trying to reproduce:

https://arxiv.org/abs/1704.04797

getting vm for VirtualBox:

http://doc.aldebaran.com/2-1/dev/tools/vm-setup.html

install ROS Indigo (Generic, Bare Bones) from source, use pip option:

http://wiki.ros.org/indigo/Installation/Source

I needed to fix pip with:

https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources

I got errors, packages could not be found. This is a workaround, fingers crossed:

sudo emerge –autounmask-write dev-libs/log4cxx
etc-update
# save configuration changes

Had to manually download “gtest-1.5.0.tar.bz2” to /usr/portage/distfiles/:

cd /usr/portage/distfiles
sudo wget http://wallaby.freshx.de/repo/netifaces-0.6.tar.gz
sudo wget ftp://ftp.gnome.org/mirror/archive/ftp.sunet.se/pub/mac/fink/md5/8b2c3c3f26cb53e64a3109d03a97200a/gtest-1.5.0.tar.bz2

sudo -H emerge dev-python/nose dev-python/netifaces dev-python/pyyaml dev-libs/tinyxml dev-libs/log4cxx dev-python/empy dev-python/mock dev-python/coverage dev-cpp/gtest dev-lisp/sbcl
sudo dispatch-conf # now press ‘u’, and run command above again

build console_bridge manually:

cd ~/ros_catkin_ws/src
git clone https://github.com/ros/console_bridge
cd ~/ros_catkin_ws/src/console_bridge
mkdir build
cd build
# change “-std=c++11” to “-std=c++0x” in ../CMakeLists.txt
cmake ..
make
sudo make install

Installing emacs:

cd /usr/portage/distfiles # manual download
sudo wget http://math.sgu.ru/soft/Linux/distributions/gentoo/distfiles/eselect-emacs-1.13.tar.bz2
sudo wget https://src.fedoraproject.org/repo/pkgs/emacs/emacs-23.3a.tar.bz2/f2cf8dc6f28f8ae59bc695b4ddda339c/emacs-23.3a.tar.bz2
sudo wget https://dev.gentoo.org/~ulm/emacs/emacs-23.3-patches-2.tar.bz2
sudo wget https://dev.gentoo.org/~ulm/emacs/emacs-common-gentoo-1.2.tar.gz
sudo wget ftp://ftp.gnome.org/mirror/trisquel/packages/pool/main/libl/liblockfile/liblockfile_1.08.orig.tar.gz
sudo chown portage.portage ./*
sudo emerge app-editors/emacs

2017-07-13
Errors with:

cd ~/ros_catkin_ws/
./src/catkin/bin/catkin_make_isolated –install -DCMAKE_BUILD_TYPE=Release

Had to add line “#define TIXML_USE_STL 1” to /usr/include/tinyxml.h to fix compile error there and program lz4 is required:

cd ~/
mkdir programs
cd programs/
git clone https://github.com/lz4/lz4
cd lz4/
make
sudo make install

cd ~/ros_catkin_ws/
./src/catkin/bin/catkin_make_isolated –install -DCMAKE_BUILD_TYPE=Release

All programs now compile!

Trying to update:

mv indigo-robot-wet.rosinstall indigo-robot-wet.rosinstall.old
rosinstall_generator robot –rosdistro indigo –deps –wet-only –tar > indigo-robot-wet.rosinstall
diff indigo-robot-wet.rosinstall indigo-robot-wet.rosinstall.old
# no updates found, done

Copying things to pepper:

~/opennao-distro => ~/opennao-distro
~/ros_catkin_ws => ~/ros_catkin_ws
/usr/bin/* => ~/local/bin
/usr/lib/* => ~/local/lib
/usr/include/* => ~/local/include
/usr/local/bin/* => ~/local/bin
/usr/local/lib/* => ~/local/lib
/usr/local/include/* => ~/local/include

adding a ~/.bash_profile file with:

# general setting
export PATH=${PATH}:~/local/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/local/lib

# ROS setting
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/ros_catkin_ws/install_isolated/lib
source ~/ros_catkin_ws/install_isolated/setup.bash

some things work:

rospack list

some things don’t:

roscore

2017-07-17
Doing the VM installation again with python virtual environment to try to avoid the python errors.

virtualenv pythonvirt
source pythonvirt/bin/activate
pip install –upgrade virtualenv pip
pip install –upgrade pyconfig
pip install –upgrade netifaces

and now we want to pip without sudo!! to install python packages locally in the virtual environment.

Run “sudo rosdep init” as:

cd ~/pythonvirt/bin
sudo ./rosdep init

and do the whole installation process again.

2017-07-18
When installed we copy to the pepper robot:

tar -czf opennao-distro.tar.gz opennao-distro
tar -chzf pythonvirt.tar.gz pythonvirt # -h dereferences symbolic links
tar -czf ros_catkin_ws.tar.gz ros_catkin_ws
sudo tar -czf usr_bin.tar.gz /usr/bin/
sudo tar -czf usr_include.tar.gz /usr/include/
sudo tar -czf usr_lib.tar.gz /usr/lib/
sudo tar -czf usr_local_bin.tar.gz /usr/local/bin/
sudo tar -czf usr_local_include.tar.gz /usr/local/include/
sudo tar -czf usr_local_lib.tar.gz /usr/local/lib/

then copy to pepper

scp *.tar.gz nao@10.42.0.19:~/ # the ip of pepper, it changes

on pepper unpack:

rm -rf opennao-distro pythonvirt ros_catkin_ws
tar -xf opennao-distro.tar.gz
tar -xf pythonvirt.tar.gz
tar -xf ros_catkin_ws.tar.gz

mkdir -p ~/local/bin
tar -xf ../usr_bin.tar.gz
mv ./usr/bin/* ~/local/bin
tar -xf ../usr_local_bin.tar.gz
mv ./usr/local/bin/* ~/local/bin

mkdir -p ~/local/include
tar -xf ../usr_include.tar.gz
mv ./usr/include/* ~/local/include
tar -xf ../usr_local_include.tar.gz
mv ./usr/local/include/* ~/local/include

mkdir -p ~/local/lib
tar -xf ../usr_lib.tar.gz
mv ./usr/lib/* ~/local/lib
tar -xf ../usr_local_lib.tar.gz
mv ./usr/local/lib/* ~/local/lib
mv ./usr/local/lib/pkgconfig/* /home/nao/local/lib/pkgconfig/

add file ~/.bash_profile with content below so required environment variables are set:

# python virtual environment
source pythonvirt/bin/activate
export PYTHONPATH=~/local/lib/python2.7:${PYTHONPATH}

# general setting
export PATH=${PATH}:~/local/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/local/lib

# ROS setting
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/ros_catkin_ws/install_isolated/lib
source ~/ros_catkin_ws/install_isolated/setup.bash

set the ROS_IP:

export ROS_IP=10.42.0.19

now “roscore” works