fix(simulation): bound Nav2 heading discretization by rover geometry
Use pinned Smac Hybrid with a geometry-derived angular grid so rectangular starts are not rejected by coarse lattice headings. Keep the full padded footprint, unknown-space veto, TTLs, and native controller/behavior ownership. Validated on the same archived costmap, five native pass/block scenarios, HTTP/PCL/Nav2 lifecycle and rear-obstacle checks, and 12 CPU tests. Original-route live check moved 20.13 m before its fixed wall budget; the 30 m integration criterion and full-route acceptance remain open.
This commit is contained in:
@@ -46,10 +46,15 @@ def configuration(inputs, robot):
|
||||
inflation_layer=dict(plugin='nav2_costmap_2d::InflationLayer',
|
||||
cost_scaling_factor=3.0, inflation_radius=math.hypot(x, y) + 0.15),
|
||||
)
|
||||
# The upstream differential primitives include pure rotation. They are
|
||||
# geometrical candidates; the drive/support/freshness gates remain required.
|
||||
lattice = ('/opt/ndc_nav2/install/nav2_smac_planner/share/nav2_smac_planner/'
|
||||
'sample_primitives/5cm_resolution/0.5m_turning_radius/diff/output.json')
|
||||
# Bound the corner displacement from a full angular bin to half a map
|
||||
# cell. Humble floors the start heading; a coarse primitive lattice can
|
||||
# classify an actually clear rectangular start as colliding. Hybrid-A*
|
||||
# exposes angular resolution without generating custom motion primitives.
|
||||
# Round to quarter-turn symmetry, independent of world coordinates.
|
||||
radius = math.hypot(x + costmap['footprint_padding'],
|
||||
y + costmap['footprint_padding'])
|
||||
angle_step = 2 * math.asin(min(1.0, costmap['resolution'] / (4 * radius)))
|
||||
heading_bins = max(8, 4 * math.ceil((2 * math.pi / angle_step) / 4))
|
||||
return {
|
||||
'behavior_server': {'ros__parameters': dict(
|
||||
use_sim_time=False, global_frame='map', robot_base_frame='base_link',
|
||||
@@ -65,11 +70,15 @@ def configuration(inputs, robot):
|
||||
)},
|
||||
'planner_server': {'ros__parameters': dict(
|
||||
use_sim_time=False, expected_planner_frequency=5.0, planner_plugins=['GridBased'],
|
||||
GridBased=dict(plugin='nav2_smac_planner/SmacPlannerLattice',
|
||||
lattice_filepath=lattice, allow_unknown=False,
|
||||
GridBased=dict(plugin='nav2_smac_planner/SmacPlannerHybrid',
|
||||
motion_model_for_search='DUBIN',
|
||||
# Retain the former differential lattice's 0.5 m
|
||||
# minimum arc radius; explicit Spin/BackUp stay
|
||||
# separate native behaviors behind unchanged gates.
|
||||
minimum_turning_radius=0.5,
|
||||
angle_quantization_bins=heading_bins, allow_unknown=False,
|
||||
tolerance=0.0, max_planning_time=0.5,
|
||||
allow_reverse_expansion=False, cache_obstacle_heuristic=False,
|
||||
smooth_path=False),
|
||||
cache_obstacle_heuristic=False, smooth_path=False),
|
||||
)},
|
||||
'controller_server': {'ros__parameters': dict(
|
||||
use_sim_time=False, controller_frequency=20.0, odom_topic='/odom',
|
||||
|
||||
Reference in New Issue
Block a user