By: Max Thompson
Edited by: Matt Schmittle
- Install ompl from source here with python bindings
- If you have a segfault with CastXML on Ubuntu 16.04 as I did, install the binaries from here. You will need to put the contents of
.../castxml/bininto/usr/local/bin/and.../castxml/shareinto/usr/local/share. Also, uninstall your current version of cast xmlsudo apt remove castxml - make sure you have the following installed
- If you have a segfault with CastXML on Ubuntu 16.04 as I did, install the binaries from here. You will need to put the contents of
- Clone this repo into
.../catkin_ws/src/:
git clone https://github.com/thompsonmax/mushr_global_planner.git - Make and source your workspace. (Assuming source commands in .bashrc)
cd ~/catkin_ws && catkin_make && source ~/.bashrc
We have a pre-built demo that is easy to use just run the following:
roslaunch mushr_global_planner demo.launch
Then open rviz
rviz
After a minute, if you subscribe to the /mushr_global_planner_result topic you should see a red path.
To use the global planner simply launch planner.launch
roslaunch mushr_global_planner planner.launch
Or include it in your own launch file. Note, the default planner does not launch a map server so that will need to be running separately.
To call the planner, simply make a service request using the API:
- start position is in world frame
- goal position is in world frame
- turning radius is the turning radius of the car in meters. You can calculate your turning radius although we recommend you tune your car to match your expected turning radius. You should match the variables to the vesc settings preset car length and delta (steering angle).
- planning time is the planning time cutoff. E.g. give me your best solution after 30 seconds
The planner is essentially a wrapper around OMPL doing Dubin’s path planning using BIT*. The input map is used to get the bounds of the state space and for determining if a sampled state is invalid (either by being out of bounds or within an obstacle). The planner uses the optimization objective of minimizing the path length of the solution. The planner then converts the solution path to a non-ompl format (list of tuples) and returns it to the user. The path is filled in with interpolated points via solutionPath.interpolate to create a dense path, but this can be tuned to vary the density of the output path.
| Topic | Type | Description |
|---|---|---|
/mushr_global_planner_start |
geometry_msgs/Pose | Start position |
/mushr_global_planner_goal |
geometry_msgs/Pose | Goal position |
/mushr_global_planner_result |
geometry_msgs/PoseArray | Planned path of poses in world coordinates from start to goal |
| Topic | Type | Description |
|---|---|---|
/mushr_global_planner |
mushr_global_planner/MushrGlobalPlanner | Calls for a path to be created with a given start, goal, turning radius, and planning time |