Introduction to Pepper and ROS
This guide assumes that ROS has already been installed on your workstation PC. To set started, you need to ensure that additional packages are installed. Some of these packages may already be installed but it is worth the check.
Dependencies
The packages required are: naoqi_libqi
, naoqi_libqicore
and naoqi_bridge_msgs
and these can be installed by the following:
sudo apt-get install naoqi_libqi naoqi_libqicore naoqi_bridge_msgs
These packages can be built from source but apt-get
is recommenced.
If you want to build from source, you can do the following.
Change directory into your ROS workspace.
cd ~/caktin_ws/src
Afterwards you will need to clone the repository:
git clone https://github.com/ros-naoqi/naoqi_driver.git
Make sure that you have all of the dependicies installed with the package:
rosdep install -i -y --from-paths ./naoqi_driver
To build the package you can then run these commands:
source /opt/ros/$ROS_DISTRIB/setup.sh
cd ~/catkin_ws && catkin_make
If you followed the ROS installation guide you should already have your catkin package sourced but double check by looking into the ~/.bashrc
:
cat ~/.bashrc | grep catkin
This line should be returned:
source ~/catkin_ws/devel/setup.bash
If not then make sure that it is added to the ~/.bashrc
.
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
You can then connect to your robot by running:
roslaunch naoqi_driver naoqi_driver.launch nao_ip:=<yourRobotIP> [network_interface:=<eth0|wlan0|vpn0>] [username:=<name>] [password:=<passwd>]
Pepper and Python
Now that Pepper is fully integrated with ROS, it is time to look at launching a python version of Pepper. Python is one of the chosen languages to control robotic systems using ROS. For this to work, you will need to find the official NAOqi SDK.
After this you need to install the Pepper bring-up package but in order to execute the python bridge you will need to run the following command:
roslaunch pepper_bringup pepper_full_py.launch nao_ip:=<RobotIP> roscore_ip:=<roscoreIP>
If you do not have pepper_bringup
then this can be installed by running:
sudo apt-get install ros-$ROS_DISTRIB-pepper-.*
Running RVIZ with Pepper
When using ROS, one of the best tools at your disposal is RVIZ.
RVIZ is in installed with ROS and so to run RVIZ simply ensure that your setup.bash
is sourced before running:
rosrun rviz rviz
This is the basic launch for RVIZ without any configuration file. To get a custom configuration file loaded to work with Pepper, it can be found in the catkin workspace.
sThe pre-defined RVIZ configuration shows the basic displays for Pepper such as the TF, RobotModel, Camera, LiDARs and Sonars. You can load it through the tool bar at the location below:
~/catkin_ws/src/pepper_robot/pepper_description/config/pepper.rviz