Skip to content

trajectory_planner: support a separate max reverse linear velocity #852

Closed

Description

@alexchunlin

TrajectoryPlanner has a single max_linear_velocity, used symmetrically for forward and reverse. Powered wheelchair controllers like the R-Net run reverse slower than forward, and users expect it. Today the only way to get that is to scale negative joystick input before set_target(), which puts chassis-level behaviour outside the planner whose job it is. Thanks to @finger563 for pointing that out on our PR.

Proposal

Add an optional reverse limit to Config:

float max_reverse_linear_velocity = 0.0f; /**< Linear speed at full reverse stick (m/s).
                                              0 = use max_linear_velocity. */

set_target() would scale negative linear input by this value instead of max_linear_velocity, so full reverse stick maps to the reverse limit. The clamp in update() would use [-max_reverse, +max_linear]. With the default of 0 nothing changes, so it's backwards compatible.

Data

We fitted the planner to a recording of an R-Net wheelchair: Luci joystick input against wheel velocities, 71 s.

  • Reverse speed: full reverse ran at 71% of full forward (10.4 vs 14.5 rad/s at the wheel).
  • With a reverse limit (applied as input scaling), the planner matched the R-Net to 0.72 rad/s RMS on linear wheel speed.
  • Without it, the error was 1.35 rad/s.
  • Turn reduction isn't needed: we also tried easing the turn rate at speed. The existing max_centripetal_acceleration already covers it, within 0.03 rad/s, so the reverse limit is the only gap we found.

Related

#850 (stale acceleration with trapezoidal stopping) is in the same update() code, if it's convenient to handle both together. Happy to open a PR for either if that helps.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions