Theta Star Planner

Theta Star Planner implements the Theta* path planner meant to plan any-angled paths using A*.

For the below example the planner took ~46ms (averaged value) to compute the path of 87.5m -

Path generated by the Theta* planner

<name> is the corresponding planner plugin ID selected for this type.

Parameters

The parameters of the planner are:

<name>.how_many_corners:
 
Type Default
int 8
Description

To choose between 4-connected (up, down, left, right) and 8-connected (all the adjacent cells) graph expansions, the accepted values are 4 and 8

<name> .w_euc_cost:
 
Type Default
double 1.0
Description

Weight applied on the length of the path.

<name>.w_traversal_cost:
 
Type Default
double 2.0
Description

It tunes how harshly the nodes of high cost are penalised. From the above g(neigh) equation you can see that the cost-aware component of the cost function forms a parabolic curve, thus this parameter would, on increasing its value, make that curve steeper allowing for a greater differentiation (as the delta of costs would increase, when the graph becomes steep) among the nodes of different costs.

<name>.w_heuristic_cost:
 
Type Default
double 1.0
Description

It has been provided to have an admissible heuristic, so the recommendation would be to change its value only when required. Usually set is at the same value as w_euc_cost or 1.0 (whichever is lower), though you may increase the value of w_heuristic_cost to speed up the process.

Note

Do go through the README file available on this repo’s link to develop a better understanding of how you could tune this planner. This planner requires you to tune the cost_scaling_factor parameter of your costmap too, to get good results.

Example

planner_server:
ros__parameters:
  planner_plugin_types: ["nav2_theta_star_planner/ThetaStarPlanner"]
  use_sim_time: True
  planner_plugin_ids: ["GridBased"]
  GridBased:
    how_many_corners: 8
    w_euc_cost: 1.0
    w_traversal_cost: 2.0
    w_heuristic_cost: 1.0