Skip to content

SMAC Lattice Planner: missing omni support #5231

@AliceGuntli

Description

@AliceGuntli

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04.5 LTS
  • ROS2 Version:
    • Humble
  • Version or commit hash:
    • Humble

Description

While integrating the Nav2 SMAC planner with our omnidirectional robot, we observed that the analytic expansion is hardcoded for Ackermann-like (car-like) motion. This results in suboptimal plans for holonomic platforms: for example, a simple leftward strafe is planned as two maneuvers
(turn, move forward, turn back) instead of a direct lateral movement.

Adding strafing motions in the lattice primitives helps for longer paths, but there are still many motions with unnecessary maneuvers.

Steps to reproduce issue

  1. Configure the planner to use omnidirectional motion primitives
  2. Set a goal directly to one side of the robot, with identical orientation

Expected behavior

For omnidirectional robots, the planner should generate direct strafing motions when appropriate, rather than decomposing them into Ackermann-like maneuvers.

Expected Plan:
Expected

Actual behavior

Analytic expansion only considers Ackermann constraints.
Plans for holonomic robots are unnecessarily complex and inefficient.

Actual Plan:
Actual

Additional Information

planner config:

planner_server:
  ros__parameters:
    planner_plugins: ["GridBased"]
    use_sim_time: False

    GridBased:
      plugin: "nav2_smac_planner/SmacPlannerLattice" # In Iron and older versions, "/" was used instead of "::"
      allow_unknown: true # Allow traveling in unknown space
      tolerance: 0.05 # dist-to-goal heuristic cost (distance) for valid tolerance endpoints if exact goal cannot be found.
      max_iterations: 1000000 # Maximum total iterations to search for before failing (in case unreachable), set to -1 to disable
      max_on_approach_iterations: 1000 # (currently not used) Maximum number of iterations after within tolerances to continue to try to find exact solution
      max_planning_time: 5.0 # Max time in s for planner to plan, smooth
      analytic_expansion_ratio: 3.5 # The ratio to attempt analytic expansions during search for final approach.
      analytic_expansion_max_length: 3.5 # For Hybrid/Lattice nodes The maximum length of the analytic expansion to be considered valid to prevent unsafe shortcutting
      analytic_expansion_max_cost: 50.0 # The maximum single cost for any part of an analytic expansion to contain and be valid, except when necessary on approach to goal
      analytic_expansion_max_cost_override: false #  Whether or not to override the maximum cost setting if within critical distance to goal (ie probably required)
      reverse_penalty: 1.0 # Penalty to apply if motion is reversing, must be => 1
      change_penalty: 0.01 # Penalty to apply if motion is changing directions (L to R), must be >= 0
      non_straight_penalty: 1.0 # Penalty to apply if motion is non-straight, must be => 1
      cost_penalty: 2.0 # Penalty to apply to higher cost areas when adding into the obstacle map dynamic programming distance expansion heuristic. This drives the robot more towards the center of passages. A value between 1.3 - 3.5 is reasonable.
      rotation_penalty: 2.0 # Penalty to apply to in-place rotations, if minimum control set contains them
      minimum_turning_radius: 0.6
      retrospective_penalty: 0.015
      lattice_filepath: "<path>" # The filepath to the state lattice graph.
      lookup_table_size: 20.0 # Size of the dubin/reeds-sheep distance window to cache, in meters.
      cache_obstacle_heuristic: false # Cache the obstacle map dynamic programming distance expansion heuristic between subsequent replannings of the same goal location. Dramatically speeds up replanning performance (40x) if costmap is largely static.
      allow_reverse_expansion: True # If true, allows the robot to use the primitives to expand in the mirrored opposite direction of the current robot's orientation (to reverse).
      smooth_path: False # If true, does a simple and quick smoothing post-processing to the path
      debug_visualizations: False # For Hybrid/Lattice nodes: Whether to publish expansions on the /expansions topic as an array of poses (the orientation has no meaning) and the path's footprints on the /planned_footprints topic. WARNING: heavy to compute and to display, for debug only as it degrades the performance.
      smoother:
        max_iterations: 1000
        w_smooth: 0.3
        w_data: 0.2
        tolerance: 1.0e-10
        do_refinement: true
        refinement_num: 2

Potential fix

Adding a launch parameter to choose the ompl::base::SE2StateSpace motion model to be used in the Analytic expansion function for the lattice node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions