feat: per-marker dock_straight_length override for the terminal straight leg

terminal/straight_length is one global value, so every docking marker gets
the same straight run into the dock. A marker profile can now set
dock_straight_length (move_base2 copies it into the DockPlanner namespace
and writes YAML null when the next marker lacks it). The terminal leg is
max(cusp floor, dock_straight_length or terminal/straight_length).

- Valid for every dock_anchor (center, face, mating_edge), unlike
  dock_face_offset and dock_pivot_safety_margin; finite and in [0, 2.0] m.
- The init summary and the plan log print the effective length and whether
  it came from the marker or the default.
- Test: missing and null keep the default, 0.30 lengthens the terminal leg,
  all three anchors load, out-of-range and NaN values are rejected.
This commit is contained in:
2026-11-12 15:44:02 +07:00
parent 07e2fd3b38
commit c94c5b2b0c
7 changed files with 118 additions and 6 deletions

View File

@@ -376,12 +376,14 @@ bool DockPlanner::initialize(std::string name,
optionalDistanceText(loaded_config.dock_face_offset);
const std::string dock_pivot_safety_margin_text =
optionalDistanceText(loaded_config.dock_pivot_safety_margin);
const std::string dock_straight_length_text =
optionalDistanceText(loaded_config.dock_straight_length);
robot::log_info(
"[dock_planner] Initialized dock maneuver (docking edge is derived per plan "
"from the side the robot stands on): model=%s, TF %s -> %s, wheel_base=%.4f m, "
"max_steering_angle=%.4f rad, minimum_turning_radius=%.4f m, "
"pivot_fallback_extension=%.3f m, pivot_safety_margin=%.3f m, "
"dock_face_offset=%s, dock_pivot_safety_margin=%s, "
"dock_face_offset=%s, dock_pivot_safety_margin=%s, dock_straight_length=%s, "
"pivot_backoff_max_distance=%.3f m, pivot_check_costmap=%s.\n",
loaded_config.requiresAxleTf() ? "ackermann" : "differential",
loaded_config.requiresAxleTf() ? loaded_config.front_axle_frame.c_str() : "-",
@@ -390,6 +392,7 @@ bool DockPlanner::initialize(std::string name,
minimum_turning_radius, loaded_config.pivot_fallback_extension,
loaded_config.pivot_safety_margin,
dock_face_offset_text.c_str(), dock_pivot_safety_margin_text.c_str(),
dock_straight_length_text.c_str(),
loaded_config.pivot_backoff_max_distance,
loaded_config.pivot_check_costmap ? "true" : "false");
return true;