In this tutorial, we present an example of using DESPOT with real-robots via ROS. We present a slightly modified version of the Laser Tag problem: a robot tries to find and tag a target which intentionally runs away inside an known environment. The robot is equiped with a noisy laser-range sensor to measure distances in eight directions. Initially, the robot is aware of neither the target's location nor its own location. In each step, the robot can move to the four adjacent positions. When the robot is adjacent to the target, it can call 'Tag' to terminate a successful pursuit. The simulation consists of two holonomic robots (KUKA Youbot) inside a Gazebo environment resembling the problem world described in DESPOT paper (Page 20) [1].
[1] N. Ye, A. Somani, D. Hsu, and W. Lee. DESPOT: Online POMDP planning with regularization. J. Artificial Intelligence Research, 58:231–266, 2017.
Copyright © 2014-2017 by National University of Singapore.
Tested Operating Systems:
Ubuntu 14.04 |
---|
Dependencies: DESPOT, ROS Indigo+, Boost 1.55+, Gazebo 2+
Install ROS Indigo.
We recommend the ros-indigo-desktop-full
version which includes Gazebo.
Install the latest DESPOT using CMakeLists. Make sure that DESPOT binaries and header files are installed.
$ cd <latest_despot_repo>
$ git checkout API_redesign # temporary, will be merged into master
$ mkdir build; cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ../
$ make
$ sudo make install
Install BOOST libraries with sudo apt-get install libboost-all-dev
If you haven't sourced your ROS environment, run:
$ source /opt/ros/indigo/setup.bash OR <existing_workspace>/devel/setup.bash
Setup a fresh catkin workspace for despot_tutorials:
$ mkdir -p ~/despot_ws/src
$ cd ~/despot_ws/
$ catkin_make
$ source devel/setup.bash
Clone the repository:
$ cd ~/despot_ws/src
$ git clone https://github.com/AdaCompNUS/despot_tutorials.git
Compile:
cd ~/despot_ws
catkin_make -DCMAKE_BUILD_TYPE=Release
Launch the Gazebo environment and robot controllers:
$ roslaunch laser_tag laser_tag.launch R1_noise:=0.5
On a separate terminal, run the POMDP planner:
$ rosrun laser_tag pomdp_planner
You should see a 3D 7x11 grid world with two Youbots. The green robot should chase the red robot until 'Tag' is called. The R1_noise
parameter specifies the gaussian noise (standard deviation in meters) of the green robot's laser range finder.
In general, to use DESPOT with real-world systems:
DSPOMDP
class. LaserTag
and its parent class BaseTag
in laser_tag.h and base/base_tag.h.)World
abstract class. LaserTagWorld
in laser_tag_world.h and laser_tag_world.cpp.)
Connect
and Initialize
functions in World
to estabilish connections with your system and intitialize it if possible.ExecuteAction
function in World
to send actions to your system and receive observations from it in the formats specified in your POMDP model (e.g: ACT_TYPE
& OBS_TYPE
parameters).Planner
class. MyPlanner
in main.cpp.)
InitializeModel
and InitializeWorld
functions.ChooseSolver
.InitializeDefaultParameters
.runPlanning
function in Planner
.