awesomebytes / pepper_virtual

13 stars 9 forks source link

pepper_virtual

Tools to simulate a Pepper robot:

MODIFIED VERSION that works (at least on Kinetic in 21/04/2020)

For this modified version (differs from the origin upstream) you'll also need:

Note that the provided launchfiles that have been tested are:

Or their variants that don't need a GPU (for the laser plugin):

And further variants that don't have the arms of the robot which reduce CPU load (useful for navigation tests, specially on underpowered computers). In my machine this used 30% less CPU on gzserver. Note that if you close/don't launch gzclient (the graphical interface of Gazebo) you'll save a lot of CPU too (more than 1 core or 110% CPU in top -c for me):

Installation

This should get your workspace up and running:

mkdir -p pepper_sim_ws/src
cd pepper_sim_ws/src
git clone -b correct_chain_model_and_gazebo_enabled https://github.com/awesomebytes/pepper_robot
git clone -b simulation_that_works https://github.com/awesomebytes/pepper_virtual
git clone https://github.com/awesomebytes/gazebo_model_velocity_plugin
# In case you are missing any of these
sudo apt-get install ros-kinetic-tf2-sensor-msgs ros-kinetic-ros-control ros-kinetic-ros-controllers ros-kinetic-gazebo-ros ros-kinetic-gazebo-ros-control ros-kinetic-gazebo-plugins ros-kinetic-controller-manager ros-kinetic-ddynamic-reconfigure-python
cd ..
catkin_make
source devel/setup.bash
# Launch your preferred simulation here
roslaunch pepper_gazebo_plugin pepper_gazebo_plugin_in_office_CPU.launch

# (On another shell that you sourced the workspace) Check stuff on Rviz
rosrun rviz rviz -d `rospack find pepper_gazebo_plugin`/config/pepper_sensors.rviz

Docker

We provide a docker image which is plattform independent and containerized, meaning it can't interfere with any local ROS installations or other incompatible packages you might have. You have two options to obtain the image:

Pulling it from dockerhub comes with the advantage of having the commited gazebo files, which otherwise have to be loaded when gazebo is started in the container. This happens automatically but takes about 30 seconds. Note that docker, per default, does not have permissions to spawn GUIs on the host system from within the container. There are a few options to address this (more about this described in this fork), but we recommend installing the docker extension "rocker" to take care of this. Then, launch the container, depending on which option you chose earlier:

Alternatively, you can use the start_docker.sh script which will setup a lot of docker flags to enable the utilization of your Nvidia GPU and your X graphical system.

Then, just as above but in the container, do:

# Launch your preferred simulation here
roslaunch pepper_gazebo_plugin pepper_gazebo_plugin_in_office_CPU.launch

In order to start a new shell in the container and, for example open RVIZ, run:

# First, find container ID with: sudo docker ps, then
docker exec -it <CONTAINER-ID> bash
# Launch RVIZ in the second shell in the container:
rosrun rviz rviz -d `rospack find pepper_gazebo_plugin`/config/pepper_sensors.rviz

screenshot of Pepper in Gazebo

You'll find a topic /pepper/laser_2 that unifies the 3 lasers of the robot in 1 topic (by reprojecting the points in a pointcloud and transforming them into base_footprint).

You'll find /pepper/cmd_vel to command the base, for example, using rosrun rqt_robot_steering rqt_robot_steering.

You can also move the joints via the follow_joint_trajectory controllers, for example, using rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller.

Summary of changes in this simulation

If you want to simulate the RGB cameras with different resolutions you must go to pepper_robot/pepper_description/urdf/pepper1.0_generated_urdf/pepperGazebo.xacro (and/or pepperGazeboCPU.xacro) and change the CameraTop_frame <width>640</width> <height>480</height> tags.

Video showing the simulation working

Video of the simulation working