Introduction
The goal of this task is to introduce path planning implemented with the Wavefront Planner.
This algorithm is capable for finding the optimal route to the goal in the planning phase, in the initial state. For this purpose it analyses the map and generates the path and in an off-line manner. When finished, the robot simply follows the generated path.
The detailed description of the Wavefront Planner is in the Lecture 11.
In this task you can run the simulation with the following command in the MATLAB console:
run_simulation(@solution6, false, [goal_x, goal_y], map_filename)
where solution6
is the control callback function you have to implement, [goal_x, goal_y]
is the position of the goal point and map_filename
is the name of the map file.
It is recommended to plot the state of the Wavefront Planner for debugging and visualisation purposes.
The planner should run in the initial state. The generated collision-less trajectory should be executed using the controller implemented in the (Task 1). The robot should move to the subsequent cells on the path generated by Wavefront.
Using a map
The planning algorithm requires a map of the environment.
The map files are shipped together with the scene files *.ttt
. Each scene file <filename>.ttt
has its map file <filename>.png
. You can use all scenes provided in the vrep_env
directory to experiment and test your solution.
To read a map file use the imread Matlab function, e.g.:
map = imread('vrep_env/map2.png')
The map is a matrix, where each cell corresponds to the occupancy state of a particular place in the scene. The state of a cell is either 0 (occupied) or 255 (free), e.g. map(1,1) == 0 means that the scene section with the lowest x and the lowest y is occupied. The map is indexed in ranges:
- for x: from 1 to
size_x
, - for y: from 1 to
size_y
,
where [size_y, size_x] = size(map);
. As the map corresponds to the scene, please take into account the units conversion, e.g. if the scene spans from -5m to 5m in x direction and from -10m to 10m in y direction, and the size of the map is 100 by 200 cells (size(map)==[200,100]
), the units conversions are:
x_map=round( 100*((x_world-(-5))/(5-(-5))) )
y_map=round( 200*((x_world-(-10))/(10-(-10))) )
The inverse conversion can be easily calculated. Please note that the indexing of the map is (y,x)
.
All environments span from -7.5m to 7.5m in both x and y directions, and the size of all maps is 100 by 100.
Use plots to visualise the state of particle filter. Please refer to the plotting and image drawing API for Matlab:
- (http://www.mathworks.com/help/matlab/ref/plot.html
- (http://www.mathworks.com/help/images/ref/imshow.html
Information on plotting an image in the background of a plot is avaiable on the page:
Task requirements
- The robot is supposed to move in diverse environments
Grading
You can get 5 points, including:
- Units conversion, proper transformations, plotting
- Wavefront implementation
- Trajectory execution