COMP313P Coursework 1 Term 2, 2018
“Path Planning in a Known World”
Investigating Path Planning Algorithms
COMP313P Assignment 1
Simon Julier (s.julier@ucl.ac.uk), George Dwyer (george.dwyer.14@ucl.ac.uk), Julius Sustarevas (julius.sustarevas.16@ucl.ac.uk)
Revised: 14th February, 2018
Overview
Assignment Release Date: Tuesday 30st January, 2018
Assignment Submission Date: 23:55 Friday 23rd February, 2018
Weighting: 30% of module total
Final Submission Format: each group submits both the source code and a report in PDF format. We’re currently working out the “right way” to do this in moodle.
Assignment Description
In this assignment, you will implement, investigate and optimize a number of discrete different planning algorithms which can be used by a robot (the stdr simulation robot from lab exercise 2) in a warehouse-like environment. The robot will be given a known occupancy grid map of the environment. A ROS node (the_boss) gives the robot a sequence of goal cells that the robot needs to visit in turn. The robot has to plan a path from its current pose to travel through the environment and drive to that goal. Both the structure of the environment and the position of the robot are known perfectly all the time. Both the planner and the robot will collect information on statistics such as travel distance and travel time. As explained below in the materials section, you will be provided with reference code which implements some of the basic (and inefficient) path planning algorithms described in the lecture, as well as a reference (and deliberately inefficient) controller to drive the robot about.
The assignment has two main parts:
- Implement, investigate the properties of the path planning algorithms. This can be carried out independently of STDR. (70% of the assignment mark.)
- Embed your path planning algorithms within a full ROS node and use these to drive the robot around. Explore additional ways to improve the quality of both the path planning and the control of the robot. (30% of the assignment mark.)
The results of both parts of your investigation will be presented in a single report. This will be divided into two separate parts. The rubric gives the allocation of marks within each part separately. The overall mark for the coursework will be given by taking the weighted contributions of each part separately.
Part 1: Investigate Path Planning Algorithms
The goal of this part of the coursework is for you to implement and evaluate a number of path planning algorithms described in the first four weeks of the lectures.
Instrument the path planning algorithms to store information on: the number of cells visited, the total travel length of a planned path, and the total angle the robot has turned through when driving along that path.
Implement the Best-First Algorithm (also known as the Greedy Algorithm) described in Week 02. The solutions should be sorted in order of Euclidean distance to the goal. Cells which are closer to the goal should be searched first.
Implement Dijkstra’s Algorithm described in Week 03.
Implement the A* Algorithm described in Week 04. You will be asked to test a number of different heuristics with a number of different weighting schemes.
COMP313P Coursework 1 Term 2, 2018
You should first implement the following heuristics for the cost-to-come function 𝑔”(𝒙):
- Always 0.
- A non-negative constant value c.
- The Euclidean Distance to the goal.
- The Octile Distance to the goal.
- The Manhattan Distance to the goal.
You should study how the lifo and fifo planners are implemented (see below) and implement your algorithms in a similar way.
Explore the relationship between the choice of heuristic, its admissibility (including changing the weights) and how it changes the performance of the algorithm. You should use your metrics defined above (cells visited, path length, angle turned) to support your arguments. You may also derive further illustrative heuristics to further support your arguments. You may use – or create – any maps of your own, including the ones in comp313p_resources. Any maps developed or used should be described in your report and included with your provided code.
Challenge Problem: What do you think is the optimal heuristic out of all possible heuristics (not just the ones listed above) that A* could use? How do you think A* will behave if you use it? Support your conclusions by implementing and demonstrating the algorithm. Discuss the feasibility of using this heuristic in practice.
Part 2: Implementation in ROS
In this part of the coursework, you will explore the relationship between a path, expressed as a set of cells to be visited, and a robot which needs to drive it. We provide a map and a set of waypoints which represent an idealized set of tasking in an idealized scenario (this map is loaded by roslaunch comp313_cw1 factory_scenario.launch and is shown below in Figure 1). You must use this scenario and set of waypoints in your analysis and discussion. If you wish, you may create additional scenarios to analyse results and discuss properties. If you do so, please describe these additional maps and provide them with the code.
Figure 1: Example output from running roslaunch comp313_cw1 factory_scenario.launch
Instrument the planner and controller to record the distance travelled, the total angle turned, and time required for the robot to drive a path. Make sure that you do not include the time of drawing the graphics in your planning time, because the graphics update can be rather slow.
Compute the performance of the planner, implemented in move2goal_controller, when completing the task. What do you notice about this algorithm?
COMP313P Coursework 1 Term 2, 2018
Implement a low-level controller which moves the robot from its current location to a specified position and orientation of the graph. You may adapt, if you wish, your controller you developed as part of Lab Exercise 02. Note that the interface is a bit different from that encountered in Lab Exerise 02. The helper class controller_base.py provides interfacing code which should be of help.
For the different algorithms evaluated in Part 1, assess their performance on robot motion.
Challenge Problem: How can you improve the controller to increase the speed of the robot as it drives to new waypoints? Implement your proposed improvements and compare the performance of the robot when driving over different paths. Note that we do not look for any fixed percentage in improvement. Rather, we would like a description of why and where you have identified the inefficiencies, and report on how your improvements have improved performance.
Materials Description
All the software provided to support this module is on github. This consist of a catkin workspace which you will initialize and run on your machine.
Installation
Unfortunately, there are bugs with the pre-installed version of stdr which must be resolved first. First, please run:
sudo apt remove ros-kinetic-stdr-simulator
When queries for the password, type ros_user. (Ignore the suggestion to run sudo apt autoremove because this the map server which we want to keep. If you do accidentally delete the map server, reinstall by typing sudo apt install ros- kinetic-map-server.)
The code is in the branch cw1 available in the original repository URL but in a new branch. The safest approach is to create a new catkin_ws and run:
cd <your_cw1_catkin_ws>/src
git clone https://github.com/grdwyer/comp313p.git git checkout cw1
If this was successful, you should see:
Switched to a new branch ‘cw1’
ls -l
-rw-r–r– 1 ucacsjj staff 1512 14 Feb 10:59 LICENSE
drwxr-xr-x 7 ucacsjj staff 224 14 Feb 10:59 comp313p_cw1
drwxr-xr-x 5 ucacsjj staff 160 14 Feb 10:59 comp313p_example drwxr-xr-x 5 ucacsjj staff 160 14 Feb 10:59 comp313p_launch
drwxr-xr-x 8 ucacsjj staff 256 14 Feb 10:59 comp313p_planner_controller drwxr-xr-x 8 ucacsjj staff 256 14 Feb 10:59 comp313p_resources drwxr-xr-x 5 ucacsjj staff 160 14 Feb 10:59 comp313p_the_boss drwxr-xr-x 5 ucacsjj staff 160 14 Feb 10:59 comp313p_time_server drwxr-xr-x 13 ucacsjj staff 416 14 Feb 10:59 stdr_simulator
You should then be able to do:
COMP313P Coursework 1 Term 2, 2018
cd ../..
catkin_make
source ./devel/setup.bash
The code can be run in two modes: standalone and full ROS.
Running Standalone
The standalone mode can be used to address the first part of this coursework and does not require STDR to run. Several standard programs are provided. These can be run from:
rosrun comp313p_planner_controller run_fifo_standalone.py rosrun comp313p_planner_controller run_lifo_standalone.py rosrun comp313p_planner_controller minkowski_sum_tester.py
The first two run provided implementations of the fifo (breadth first search) and lifo (depth first search algorithms). The last test, which uses depth first search, shows how the map obstacles can be expanded to take account of the size of the robot. These calls load the scripts called run_fifo_standalone.py, run_lifo_standalone.py and minkowski_sum_tester.py which can be found in the comp313p_planner_controller/scripts directory. The code should be “self- documenting”. However, please ask us any questions.
Running Full ROS
To run, use:
roslaunch comp313p_cw1 factory_scenario.launch
This will launch all the necessary nodes required, including STDR, an appropriate robot, a suitable map, the boss and the test files. Once started up, the boss will play through a sequence of waypoints.
In addition, you can run:
roslaunch comp313p_cw1 test_scenario.launch
This creates an empty map with a few predefined waypoints.
Detailed Description
The software consists of the following packages. Those shown in italics are identical to the ones in Lab Exercise 2.
- comp313p_cw1: This package contains launch files, which are used to automate starting up ROS nodes, together with the scenarios (maps + lists of goals).
- comp313p_example: This is the move the robot example you encountered in Lab Exercise 02.
- comp313p_launcher: Example launch scripts for starting up stdr.
- comp313p_planner_controller: This node will be the main focus of your coding efforts. It contains both the path
planner which computes a path, and the controller to drive the robot.
- comp313p_resources: These are resources such as simple rooms.
- stdr: This is a modified version of the stdr simulator. It fixes a couple of bugs with stdr which meant that CW1 would
not run. We have submitted a PR with the stdr developers, but it’s not clear if / when the changes will be selected.
- comp313p_the_boss: This node produces the set of waypoints the robot drives to. It waits to receive a message to confirm that the robot has reached its goal. Rather than use the strings produced in Lab Exercise 02, it uses formatted
ROS messages.
- comp313p_time_server: This can be used to “speed up” and “slow down” the simulation time. By default it runs
at real time (1s simulation = 1s real world time).
You will mainly work with comp313p_planner_controller.
COMP313P Coursework 1 Term 2, 2018
The launch for the ROS node is scripts/planner_controller_node.py. The way it works is as follows. It waits until it receives a request to go to a destination. The planner is called to plan a path, and the controller is then invoked to drive the robot to the goal.
Planning:
- cell.py: Contains the description of the cells and their states.
- occupancy_grid.py: This is the raw input map. It basically consists of a big array of integers which either have the
value 0 (for clear) or 1 (for occupied).
- search_grid.py: This contains an encoding of the graph for search. It consists of a 2D array the same size as the
occupancy_grid. Each element is a cell and can be dead, alive, etc.
- planned_path.py: This contains the class which represents the planned path. This consists of the chain of cells,
together with costs.
- planner_base.py: This is the base class for the planner. It actually mostly contains stuff for drawing the 2D grid cell
map, and you shouldn’t have to look at it.
- general_forward_search_algorithm.py: This includes the implementation of the general forward based
search presented in the lectures. You should not have to change this.
- cell_based_forward_search.py: This provides the logic for how the robot state is predicted forwards.
- lifo_planner.py: This contains the methods just to implement depth first search.
- fifo_planner.py: This contains just the code needed to implement breadth first search.
When you implement your own algorithms, you should only have to create your own classes similar to lifo_planner and fifo_planner. You should not have to change any other code.
Control:
- controller_base.py: This handles the code for taking in odometry from STDR, turning it into a pose that’s
available, and driving the robot from waypoint to waypoint in a path
- move2goal_controller.py: This is a simple reference path planner I implemented which is my solution to Lab
Exercise 02.
To implement your own controller you should be able to replace the move2goal_controller. You should not have to change any other code.
Getting Help
You are encouraged to use the assignment discussion forum to help when you get stuck. Please check the forum regularly and try and answer each other’s questions. I will be checking the forum as often as I can and will be answering any questions that have remained unanswered. Please note that if you have questions about coursework, please post them to the forum directly rather than emailing me. The reason is that all students will be able to see the reply.
Submission Format and Structure
Each group will submit a single zip file. The name of the zip file will be of the form “Group_XX_CW2.zip”, where XX is the group name. The zip file, when uncompressed, will contain your catkin_ws/src (including all the nodes described above), together with a report in pdf format. The code will not be marked independently, however, the code may be tested to ensure that it works correctly and supports the results presented in the report.
Marking Guidelines
All reports will be marked against the marking rubric, which is downloadable from the course’s Moodle page. The mark weighting for each section is as follows:
1. Algorithms Description (30%)
How well are the different algorithms described and contrasted?
2. Implementation, Analysis and Presentation of Results (40%)
COMP313P Coursework 1 Term 2, 2018
How thorough is the analysis and discussion of the results? How well do they compare between the different algorithms and with properties of those algorithms? Are the algorithms well-supported by quantitative evidence?
- Format, structure, referencing and clarity of writing (10%)
Is your report well laid out and does the write-up follow a clear structure? Have you included any references to show background research/reading? Is your writing free from spelling, punctuation, and grammatical errors?
- Challenge Problems (20%)
Additional marks for the challenges – 10% on description, 5% on analysis and 5% on performance gains.
Submission and Feedback
The deadline for submission is 23:55 on Friday 23rd February, 2018. As explained above,
please submit a single zip file per group. Please pay attention to both the requested file name and the file structure. The reports will be marked and feedback will be provided by Friday, 16th March 2018.