Mentions légales du service

Skip to content
Snippets Groups Projects

This is the repository for Spring WP6 regarging the Robot Behavior Generator.

Main partners are : Inria Perception

There are two ways for running the WP6 algorithms with the docker images:

  1. Use the docker images avaible on the docker gitlab registry and follow the steps of the wiki to run the WP6 Robot Behavior Demo.
  2. Build the docker images following the Build the docker images steps.

Build the docker images

Two dockers:

  • One on ARI with RTABMAP
  • One on another computer running everything else

On the computer which will run the controller, clone the following repositories and get the submodules:

git clone https://gitlab.inria.fr/spring/wp6_robot_behavior/robot_behavior
cd robot_behavior/
git checkout master
git pull
git submodule update --init
git submodule update --recursive --remote
cd modules/omnicam/
git submodule update --init
git submodule update --recursive --remote
cd ../../src/
git clone https://gitlab.inria.fr/spring/wp7_ari/spring_msgs.git
cd spring_msgs/
git checkout master
git pull
cd ..
git clone https://gitlab.inria.fr/spring/wp6_robot_behavior/py_spring_hri.git
cd py_spring_hri
git checkout main
git pull
cd ../..

Build the behavior_generator docker image using buildkit for a more efficient skipping of lines:

export DOCKER_BUILDKIT=1
docker build -t behavior_generator --target behavior-generator .

Download the wp2_rtabmap docker images from the GitLab Container Registery:

docker pull registry.gitlab.inria.fr/spring/dockers/wp2_rtabmap:latest

Export the wp2_rtabmap docker image from your host to ari:

docker save -o wp2_rtabmap.tar wp2_rtabmap
scp wp2_rtabmap.tar pal@ari-XXc:

and on ARI:

docker load -i wp2_rtabmap.tar

Before running this wp2_rtabmap docker on ARI, follow the steps of the App section (only for the torso_front_camera app) in order to be able to run the rtabmap package on ARI with the right parameters for the torso front camera.

On ARI. First do a map of the scene by running:

docker run --rm --name wp2_rtabmap --network=host --privileged --volume=/home/pal/maps/:/home/ros/maps wp2_rtabmap localization:=False database_path:=/home/ros/maps/running_map.db imu_topic:=/torso_front_camera/imu map_frame_id:=map odom_frame_id:=odom visual_odometry:=false

This step is using rtabmap algorithm to build the map (and not the orb-slam alogirthm provided by PAL).

Move the robot around in the room until the map is large enough. Make sure there is enough light. To move around the robot, you can either use a USB joystick/keyboard or the web joystick gui of PAL. Then stop the container with ctrl-C and rerun with localization:=True to stop increasing the map size:

docker run --rm --name wp2_rtabmap --network=host --privileged --volume=/home/pal/maps/:/home/ros/maps wp2_rtabmap localization:=True database_path:=/home/ros/maps/running_map.db imu_topic:=/torso_front_camera/imu map_frame_id:=map odom_frame_id:=odom visual_odometry:=false

To include the wp2_rtabmap docker as an App launched at the robot startup, see the Robot-Behavior-Integration page in the Wiki.

To run the behavior_generator docker on the experimental machine, type:

docker run --rm -it \
    --name behavior_generator \
    --network=host \
    --privileged \
    --env="ROS_MASTER_URI=http://192.168.0.10:11311" \
    --env="ROS_IP=192.168.0.1" \
    behavior_generator

with 192.168.0.10 the IP address of the ARI robot and 192.168.0.1 the IP address of the experimental machine (for instance, got through ifconfig)

Before running this behavior_generator docker image, be sure that the tracker is running. If it's not the case, refer to Robot-Behavior-Integration/wp3_tracker docker.

To run the behavior_generator docker with other needed containers of WP6 Robot Behavior work package, you can use docker-compose, see the Robot-Behavior-Integration page in the Wiki.

Now, all the nodes are running to execute a robot action. For instance, to join a person (with the id 00580 and timeout of 100 seconds), you can use the provided sample action client:

docker exec -it behavior_generator bash
roslaunch robot_behavior behavior_go_to_body_action_client.launch body_id:=00580 timeout:=100

You can go to a specific position:

docker exec -it behavior_generator bash
roslaunch robot_behavior behavior_go_to_position_action_client.launch go_to_target_pose:='[-3.5, -5.5, 1.57, 0, 1]'

where go_to_target_pose:='[x, y, orientation (rad), global/local map flag (0/1), flag=1]', timeout can also be set.

You can loot at a specific position once:

docker exec -it behavior_generator bash
roslaunch robot_behavior behavior_look_at_position_action_client.launch look_at_position look_at_position:='[-3.5, -5.5, 0, 1]'

where go_to_target_pose:='[x, y, global/local map flag (0/1), flag=1]', timeout can also be set.

You can loot at a specific body once (with the id 00580), timeout can also be set:

docker exec -it behavior_generator bash
roslaunch robot_behavior behavior_look_at_body_action_client.launch body_id:=00580