This algorithm is capable of 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 in an off-line manner. When finished, the robot simply follows the generated path.
- Matlab
- Peter Corke’s RVC toolbox
- CoppeliaSim simulator
- Matlab bindings for CoppeliaSim
Important
It is required to use a fairly recent version of Matlab, versions older than 2011 may cause problems.
- Download
CoppeliaSim EDU
and unpack it in the~/ws_emor
workspace directory. - Download EMOR tutorials repository and unzip it in
~/ws_emor
.
Copy the following three files from the directory of the CoppeliaSim
to the directory named youbot
within your local copy of EMOR tutorials repository
downloaded above.
The three files you need to copy are:
remApi.m
: located in{CoppeliaSim_path}/programming/remoteApiBindings/matlab/matlab
Note
In the newest version of CoppeliaSim, the files may be located in {CoppeliaSim_path}/programming//legacyRemoteApi/remoteApiBindings/matlab/matlab
remoteApiProto.m
: located in{CoppeliaSim_path}/programming/remoteApiBindings/matlab/matlab
remoteApi.so
(if you use Linux) orremoteApi.dll
(if you use Windows) orremoteApi.dylib
(if you use a Mac). If you have a choice between a 32-bit or 64-bitremoteApi
, pick the one that corresponds to your Matlab install.
Important
If you have 32-bit Matlab, pick the 32-bit remoteApi, even if your kernel is 64-bit.
The file is located in {CoppeliaSim_path}/programming/remoteApiBindings/lib/lib
You will find these files in the directory containing the CoppeliaSim app. Look in the programming/remoteApiBindings/lib/lib and programming/remoteApiBindings/matlab/matlab
subdirectories of the CoppeliaSim app directory (although this can change from version to version). You must copy these files to the youbot directory within your copy of EMOR tutorials repository
.
-
Run Matlab and change the current directory to the youbot directory (in Matlab Command Window), e.g. on Linux/Mac:
cd ~/ws_emor/emor_trs/youbot
-
Then type (in Matlab):
vrep=remApi('remoteApi'); vrep.delete();
You can run the simulation with the following command in the MATLAB console:
run_simulation(@wavefront_main, false, [goal_x, goal_y], map_filename)
wavefront_main
is the control callback function.[goal_x, goal_y]
is the position of the goal point.map_filename
is the name of the map file.
run_simulation(@wavefront_main, false, [-0.5, 3.8], "map.png")
It also plots the state of the Wavefront Planner for debugging and visualization purposes. The planner runs in the initial state. Then the robot moves to the subsequent cells on the path generated by Wavefront.