Theta Star Planner

Theta Star Planner implements the Theta* path planner meant to plan any-angled line-segment focused 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>.use_final_approach_orientation

Type

Default

bool

false

Description

If true, the last pose of the path generated by the planner will have its orientation set to the approach orientation, i.e. the orientation of the vector connecting the last two points of the path

<name>.allow_unknown

Type

Default

bool

True

Description

Whether to allow planning in unknown space.

<name>.terminal_checking_interval

Type

Default

int

5000

Description

Number of iterations between checking if the goal has been cancelled or planner timed out

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:
    expected_planner_frequency: 20.0
    use_sim_time: True
    planner_plugins: ["GridBased"]
    GridBased:
      plugin: "nav2_theta_star_planner::ThetaStarPlanner" # In Iron and older versions, "/" was used instead of "::"
      how_many_corners: 8
      w_euc_cost: 1.0
      w_traversal_cost: 2.0
      w_heuristic_cost: 1.0