3. Problem domain: Traffic network of Dubins cars¶
Often referred to as “the second domain,” the basic setting is navigation in a small network of roads with vehicles that follow unicycle-like dynamics. Every road network is a 4-connected grid, subject to a rigid-body transformation: as such, the segments may not be axis-aligned.
While below we include pointers to the main websites for dependencies, many are available via packages for your OS and may already be installed, especially if you have ROS on Ubuntu 14.04. Supported platforms are described in the Introduction.
There are two major variants of this benchmark: one based in simulation and another on a physical testbed. We begin with preparations appropriate for both.
On Ubuntu, Eigen can be obtained by installing the “libeigen3-dev” deb package (https://packages.debian.org/jessie/libeigen3-dev).
Several ROS packages for the Kobuki by Yujin Robot are required.
fmrb from your copy of the repository, e.g.,
pip install -e .
or get it from PyPI,
pip install fmrb
3.1.3. Dependencies of the physical variant¶
3.1.4. Supplementary prerequisites¶
As for the Problem domain: Scaling chains of integrators, there is code that is relevant but not required for this benchmark.
Teleoperation of the vehicle to be controlled can be achieved using kobuki_keyop ROS package. An example demonstrating a configuration known to work in the simulation variant:
roslaunch dubins_traffic_utils teleop.launch
In the below code,
$FMRBENCHMARK is the absolute path to a copy of the
fmrbenchmark repository on your machine.
3.2.1. Launching a problem instance of the simulation variant¶
Create a catkin workspace.
mkdir -p dubsim_workspace/src
Create symbolic links to the ROS packages in the fmrbenchmark repository required for this example.
ln -s $FMRBENCHMARK/domains/integrator_chains/integrator_chains_msgs
ln -s $FMRBENCHMARK/domains/dubins_traffic/dubins_traffic_msgs
ln -s $FMRBENCHMARK/domains/dubins_traffic/dubins_traffic_utils
ln -s $FMRBENCHMARK/domains/dubins_traffic/dub_sim
ln -s $FMRBENCHMARK/domains/dubins_traffic/e-agents/wander
ln -s $FMRBENCHMARK/examples/dubins_traffic_examples
Build and install it within the catkin workspace.
Because the installation is local to the catkin workspace, before beginning and whenever a new shell session is created, you must first
source command assumes that you are using the Z shell; try
setup.bash if you use Bash.
python $FMRBENCHMARK/domains/dubins_traffic/trial-runner.py -f mydata.json $(rospack find dubins_traffic_utils)/examples/trialsconf/mc-small-4grid-agents2.json
This will cause trial data to be saved to the file
mydata.json in the local directory from where the above command is executed.
The Gazebo server is launched without a GUI frontend, which is also known as running headless. A local viewer can be launched using
The vehicle to be controlled has the ROS namespace
/ego. The e-agents have
namespaces defined in the trials configuration file. In the example
mc-small-4grid-agents2.json used in this tutorial, these are
In a separate terminal, run your controller. For example, assuming your controller
is contained in the package
your_controller with launch file
in a separate terminal, run
roslaunch your_controller foo.launch
You can run an example controller using:
roslaunch dubins_traffic_examples simple.launch
This is a simple controller that sets the ego vehicle’s forward and angular velocity based on the next goal to be visited, and cycles through goals in this manner.
Support code for working with road network descriptions is available in
For example, try
from the directory