In Lab 1pre, you have already installed ROS Kinetic. The FoodTutrle simulator for this lab is adapted from the ROS TurtleBot Stage package. Install TurtleBot Stage:
sudo apt install ros-kinetic-turtlebot-stage
sudo apt install ros-kinetic-joint-state-publisher-gui
Clone this repository and set up the environment:
git clone https://github.com/AdaCompNUS/CS4278-5478-MotionPlanning
cd CS4278-5478-MotionPlanning
catkin_make
source devel/setup.bash
If you use the ROS docker, you may need to make a docker commit to save changes.
Check your setup:
roslaunch planner turtlebot_in_stage.launch
You should see RViz and ROS Stage.
The FoodTurtle system consists of three components: the simulator, the planner, and the controller. The code in this repository provides most of these components, including the necessary functions for setting up ROS nodes in the simulator, data communication, and robot control. You will implement the planning algorithm and collision avoidance capabilities by filling in the template labeled # TODO: FILL ME!
in base_planner.py
. We recommend that you use base_planner.py
as a base class and then implement your planners as derived classes.
Launch the simulator and execute the planner:
roscd planner/src
sh run.sh [your map name] start_x start_y start_theta
python your_planner.py --goal 'goal_x,goal_y' --com use_com_1_map_or_not
For example, load map1.png
and set the robot start pose as (x=1, y=1, θ=0):
roscd planner/src
sh run.sh map1.png 1 1 0
Set the robot goal as (x=5, y=5) and run the planner:
python your_planner.py --goal '5,5' --com 0
The flag --com
indicates whether the COM1 map is used, as it requires a special set of environment parameters.
For visualization, we recommend the ROS Stage. RViz provides 2.5-D visualization, but may be noisy due to the asynchronous communication delay of ROS.
A dataset provides 5 maps for evaluation, including 4 hand-crafted maps (map1.png
to map4.png
) and a simplified COM1 level-1 floor plan (com1.jpg
). Each map has a corresponding list of test cases with goals specified here. The robot always starts with the pose (1, 1, 0).
To reduce your work, only map4.png may have a misalignment of less than 10 pixels. You can assume that all other maps are sufficiently accurate.
Evaluate your planners in all test cases under the three models, DSDA, CSDA and DSPA. For DSDA and CSDA, save the control actions in a txt
file and name it {task}_{map}_{goal_x}_{goal_y}.txt
. For DSPA, save the MDP control policy in a json
file and name it {task}_{map}_{goal_x}_{goal_y}.json
.
For example,
- DSDA_map2_5_5.txt for DSDA on map2.png with [5, 5] as the goal.
- CSDA_map3_9_9.txt for CSDA on map3.png with [9, 9] as the goal.
- DSPA_com1_43_10.json for the MDP policy on com1.jpg with [43, 10] as the goal.
You can find the functions to save the results in base_planner.py. Some examples of control files can be found here.
Submit a single zip archive named {MatricNo}-Lab1.zip
, which contains 3 directories:
Code
: your codeControls
: the control files for all testcasesReport
: your report