🎾D.7 Smac Planner

Smac Planner plugin မှာ three A* base planning algorithms များဖြစ်တဲ့ 2D A*, Hybrid-A* နဲ့ State Lattice path planners တို့ကို ပါဝင် ပါတယ်။ အတိအကျပြောရမယ်ဆိုရင်တော့ အောက်ကကောင်တွေပါ။

  • Smac 2D Planner

  • Smac Hybrid-A* Planner

  • Smac State Lattice Planner

Nav2_smac_planner package မှာ robot platforms အမျိုးမျိုးအတွက် အဆင့်မြင့်ထားတဲ့ A*-based search algorithm ပါဝင်ပါတယ်။ template node types တွေကိုအသုံးပြုထားပြီး နောက်ထပ် planners အသစ်တွေ develop လုပ်လို့လည်းရပါတယ်။

circular differential-drive robots နဲ့ omni-directional drive robots တွေအတွက်ဆိုရင် SmacPlanner2D planner အသုံးပြုရမှာဖြစ်ပါတယ်။

ကားပုံစံ ackermann နဲ့ legged vehicles robot တွေအတွက်ဆိုရင်တော့ SmacPlannerHybrid plugin ကို support လုပ်ပေးပါတယ်။

Non-circular တွေ၊ arbitrary shaped robot တွေနဲ့ စိတ်ကြိုက် model vehicles များကိိုအသုံးပြုမယ်ဆိုရင်တော့ SmacPlannerLattice plugin ကိုသုံးနိုင်ပါတယ်။ ဒီကောင်သည် omni, diff, ackermann, legged, custom အမျိုးအစားတွေအားလုံးအတွက် support ပေးတယ်လို့ဆိုပါတယ်။

အပေါ်မှာ ဖေါ်ပြခဲ့တဲ့ plugin ၃ထဲက နောက်ဆုံး plugin နှစ်ခုကတော့ kinematically feasible ဖြစ်ပါတယ်။

အောက်မှာ planner သုံးခု နဲ့ ၇၅ မီတာအကို အကြမ်းအားဖြင့် plan လုပ်ရာမှာ ကြာချိန်အသီးသီးကို ဖေါ်ပြထားပါတယ်။

  • Hybrid-A* computed the path in 144 ms

  • State Lattice computed the path in 113 ms

  • 2D A* computed the path in 243 ms

  • For reference: NavFn compute the path in 146 ms, including some nasty path discontinuity artifacts

တချို့ environment များအတွက် 100ms အောက်ကို ပုံမှန် planning လုပ်ပြီး၊ တခါတရံ 200 ms နဲ့ ထိကြာပါတယ်။

Left to Right [ 2D A* planner, Hybird-A* planner, State Lattice planner ] source from nav2 docs

Smac 2D Planner

Param Names
Description
Type
Default

<name>.tolerance

Tolerance in meters between requested goal pose and end of path.

double

0.125

<name>.downsample_costmap

Whether to downsample costmap to another resolution for search.

bool

FALSE

<name>.downsampling_factor

Multiplier factor to downsample costmap by (e.g. if 5cm costmap at 2 downsample_factor, 10cm output).

int

1

<name> .allow_unknown

Whether to allow traversing/search in unknown space.

bool

TRUE

<name>.max_iterations

Maximum number of search iterations before failing to limit compute time, disabled by -1.

int

1000000

<name>.max_on_approach_iterations

Maximum number of iterations after the search is within tolerance before returning approximate path with best heuristic if exact path is not found.

int

1000

<name> .max_planning_time

Maximum planning time in seconds.

double

2

နမူနာ

Smac Hybrid-A* Planner

Param Names
Description
Type
Default

<name>.downsample_costmap

Whether to downsample costmap to another resolution for search.

bool

FALSE

<name>.downsampling_factor

Multiplier factor to downsample costmap by (e.g. if 5cm costmap at 2 downsample_factor, 10cm output).

int

1

<name>.allow_unknown

Whether to allow traversing/search in unknown space.

bool

TRUE

<name> .tolerance

If an exact path cannot be found, the tolerance (as measured by the heuristic cost-to-goal) that would be acceptable to diverge from the requested pose.

double

0.25

<name> .max_iterations

Maximum number of search iterations before failing to limit compute time, disabled by -1.

int

1000000

<name> .max_on_approach_iterations

Maximum number of iterations once a visited node is within the goal tolerances to continue to try to find an exact match before returning the best path solution within tolerances. Negative values convert to infinite.

int

1000

<name> .max_planning_time

Maximum planning time in seconds.

double

5.0

<name> .analytic_expansion_ratio

Planner will attempt to complete an analytic expansions in a frequency proportional to this value and the minimum heuristic.

double

3.5

<name> .analytic_expansion_max_length

If the length is too far, reject this expansion. This prevents shortcutting of search with its penalty functions far out from the goal itself (e.g. so we don’t reverse half-way across open maps or cut through high cost zones). This should never be smaller than 4-5x the minimum turning radius being used, or planning times will begin to spike.

double

3.0

<name> .motion_model_for_search

Motion model enum string to search with. For Hybrid-A* node, default is “DUBIN”. Options for SE2 are DUBIN or REEDS_SHEPP.

string

“DUBIN”

<name> .angle_quantization_bins

Number of angular bins to use for SE2 search. This can be any even number, but a good baseline is 64 or 72 (for 5 degree increments).

int

72

<name> .minimum_turning_radius

Minimum turning radius in meters of vehicle. Also used in the smoother to compute maximum curvature.

double

0.4

<name> .reverse_penalty

Heuristic penalty to apply to SE2 node if searching in reverse direction. Only used in REEDS_SHEPP motion model.

double

2.0

<name> .change_penalty

Heuristic penalty to apply to SE2 node if changing direction (e.g. left to right) in search. Disabled by default after change to guarantee admissibility of the Hybrid-A* planner.

double

0

<name> .non_straight_penalty

Heuristic penalty to apply to SE2 node if searching in non-straight direction.

double

1.2

<name> .cost_penalty

Heuristic penalty to apply to SE2 node for cost at pose. Allows Hybrid-A* to be cost aware.

double

2

<name> .retrospective_penalty

Heuristic penalty to apply to SE2 node penalty. Causes Hybrid-A* to prefer later maneuvers before earlier ones along the path. Saves search time since earlier (shorter) branches are not expanded until it is necessary. Must be >= 0.0 and <= 1.0. Must be 0.0 to be fully admissible.

double

0.015

<name> .lookup_table_size

Size of the dubin/reeds-sheep distance window to cache, in meters.

double

20.0

<name> .viz_expansions

Whether to publish expansions on the /expansions topic as an array of poses (the orientation has no meaning). WARNING: heavy to compute and to display, for debug only as it degrades the performance.

bool

FALSE

<name> .cache_obstacle_heuristic

Cache the obstacle map dynamic programming distance expansion heuristic between subsiquent replannings of the same goal location. Dramatically speeds up replanning performance (40x) if costmap is largely static.

bool

FALSE

<name> .smooth_path

If true, does simple and fast smoothing post-processing to the path from search

bool

TRUE

<name> .smoother.max_iterations

The maximum number of iterations the smoother has to smooth the path, to bound potential computation.

int

1000

<name> .smoother.w_smooth

Weight for smoother to apply to smooth out the data points

double

0.3

<name> .smoother.w_data

Weight for smoother to apply to retain original data information

double

0.2

<name> .smoother.tolerance

Parameter tolerance change amount to terminate smoothing session

double

1E-10

<name> .smoother.do_refinement

Performs extra refinement smoothing runs. Essentially, this recursively calls the smoother using the output from the last smoothing cycle to further smooth the path for macro-trends. This typically improves quality especially in the Hybrid-A* planner due to the extra “wobbling” it can have due to the very small primitive lengths but may cause the path to get slightly closer to some obstacles.

bool

TRUE

<name> .smoother.refinement_num

Number of times to recursively attempt to smooth, must be >= 1.

int

2

နမူနာ

Smac State Lattice Planner

Note: State Lattice does not have the costmap downsampler due to the minimum control sets being tied with map resolutions on generation. The minimum turning radius is also not a parameter in State Lattice since this was specified at the minimum control set pre-computation phase. See the Smac Planner package to generate custom control sets for your vehicle or use one of our pre-generated examples.

The image above you can see the reverse expansion enabled, such that the robot can back into a tight requested spot close to an obstacle.

Param Names
Description
Type
Default

<name> .allow_unknown

Whether to allow traversing/search in unknown space.

bool

TRUE

<name> .tolerance

If an exact path cannot be found, the tolerance (as measured by the heuristic cost-to-goal) that would be acceptable to diverge from the requested pose in distance-to-goal.

double

0.25

<name> .max_iterations

Maximum number of search iterations before failing to limit compute time, disabled by -1.

int

1000000

<name> .max_on_approach_iterations

Maximum number of iterations once a visited node is within the goal tolerances to continue to try to find an exact match before returning the best path solution within tolerances.

int

1000

<name> .max_planning_time

Maximum planning time in seconds.

double

5.0

<name> .analytic_expansion_ratio

SE2 node will attempt to complete an analytic expansion with frequency proportional to this value and the minimum heuristic. Negative values convert to infinite.

double

3.5

<name> .analytic_expansion_max_length

If the length is too far, reject this expansion. This prevents shortcutting of search with its penalty functions far out from the goal itself (e.g. so we don’t reverse half-way across open maps or cut through high cost zones). This should never be smaller than 4-5x the minimum turning radius being used, or planning times will begin to spike.

double

3.0

<name> .reverse_penalty

Heuristic penalty to apply to SE2 node if searching in reverse direction. Only used in allow_reverse_expansion = true.

double

2.0

<name> .change_penalty

Heuristic penalty to apply to SE2 node if changing direction (e.g. left to right) in search.

double

0.05

<name> .non_straight_penalty

Heuristic penalty to apply to SE2 node if searching in non-straight direction.

double

1.05

<name> .cost_penalty

Heuristic penalty to apply to SE2 node for cost at pose. Allows State Lattice to be cost aware.

double

2.0

<name> .rotation_penalty

Penalty to apply for rotations in place, if minimum control set contains in-place rotations. This should always be set sufficiently high to weight against in-place rotations unless strictly necessary for obstacle avoidance or there may be frequent discontinuities in the plan where the plan requests the robot to rotate in place to short-cut an otherwise smooth forward-moving path for marginal path distance savings.

double

5

<name> .retrospective_penalty

Heuristic penalty to apply to SE2 node penalty. Causes State Lattice to prefer later maneuvers before earlier ones along the path. Saves search time since earlier (shorter) branches are not expanded until it is necessary. Must be >= 0.0 and <= 1.0. Must be 0.0 to be fully admissible.

double

0.015

<name> .lattice_filepath

The filepath to the state lattice minimum control set graph, this will default to a 16 bin, 0.5m turning radius control set located in test/ for basic testing and evaluation (opposed to Hybrid-A*’s default of 0.5m).

string

“”

<name> .lookup_table_size

Size of the dubin/reeds-sheep distance window to cache, in meters.

double

20.0

<name> .cache_obstacle_heuristic

Cache the obstacle map dynamic programming distance expansion heuristic between subsiquent replannings of the same goal location. Dramatically speeds up replanning performance (40x) if costmap is largely static.

bool

FALSE

<name> .allow_reverse_expansion

If true, allows the robot to use the primitives to expand in the mirrored opposite direction of the current robot’s orientation (to reverse).

bool

FALSE

<name> .smooth_path

If true, does simple and fast smoothing post-processing to the path from search

bool

TRUE

<name> .smoother.max_iterations

The maximum number of iterations the smoother has to smooth the path, to bound potential computation.

int

1000

<name> .smoother.w_smooth

Weight for smoother to apply to smooth out the data points

double

0.3

<name> .smoother.w_data

Weight for smoother to apply to retain original data information

double

0.2

<name> .smoother.tolerance

Parameter tolerance change amount to terminate smoothing session

double

1.00E-10

<name> .smoother.do_refinement

Performs extra refinement smoothing runs. Essentially, this recursively calls the smoother using the output from the last smoothing cycle to further smooth the path for macro-trends. This typically improves quality especially in the Hybrid-A* planner but can be helpful on the state lattice planner to reduce the “blocky” movements in State Lattice caused by the limited number of headings.

bool

TRUE

<name> .smoother.refinement_num

Number of times to recursively attempt to smooth, must be >= 1.

int

2

နမူနာ

Last updated