Hi all,
I’ve open-sourced a project I’ve been building for a while, and I’d like feedback
from people who know Nav2 better than I do.
github.com/skunal3318/Ramp-Autonomy. Apache-2.0, ROS 2 Jazzy, Gazebo Harmonic (gz-sim 8), Nav2 MPPI.
The problem
Terrain-aware navigation is a real field, but the default Nav2 tuning path, MPPI
profiles included, still assumes flat ground, and that is what most people start
from. Construction-site AMRs moving material between floors cross temporary ramps
constantly. On a grade, three things a flat-floor stack treats as constants
become variables at once:
- IMU pitch bias corrupting odometry exactly when you need it
- a payload shifting the effective CG, so the tip-over margin changes in real time
- wheel slip as a distinct failure mode with no flat-ground equivalent
So the ramp gets treated as its own control and safety problem rather than a path
to power through.
What’s in it
A five-state FSM (APPROACH → ASCENT → TRANSITION → DESCENT → EXIT, with HALT
pre-emptable from any state) driven end-to-end through real FollowPath/MPPI
control. A LiDAR slope and break-point classifier feeding a look-ahead transition
trigger. A safety layer covering tip-over margin, wheel slip and motion stall, where
any one signal can veto the controller. Two custom nav2_mppi_controller critics.
Two things that might be useful to others here
1. Ascent and descent ended up with opposite MPPI profiles. Ascent runs a
tight heading tolerance (5°) and low angular authority (0.4 rad/s), and measures
driftless at those numbers. Descent runs both loosened (20°, 0.6 rad/s) so it has
the steering authority to act on cross-track error that ascent never accumulates.
Same ramp, inverted profile. Worth saying that a good chunk of the descent drift
I originally tuned against turned out to be my own test harness turning the robot
in the wrong place, so treat the asymmetry as what this stack settled on rather
than a law of ramps.
2. Capping speed to control slip on a descent made things dramatically worse.
My first braking version capped vx_max. On the same descent leg:
| approach | time | max slip | HALTs |
|---|---|---|---|
| no braking | 17.01 s | 1.000 | 0 |
cap vx_max |
76.44 s | 11.148 | 146 |
cap ax_max/az_max |
17.77 s | 1.000 | 0 |
Capping the speed ceiling forces the controller to decelerate harder to comply,
and on a slope that larger acceleration transient is what causes slip in the first
place. The brake read “still slipping”, cut speed further, demanded a harder
correction, and spiralled. Slip on a grade tracks acceleration transients, not
cruising speed.
Worth being precise about the third row, because it is easy to read as a fix it
has not earned: slip never crossed the brake’s threshold on that run, so the
acceleration-capping version is demonstrated harmless, not demonstrated
effective. Its intervention branch has never actually been exercised. Provoking a
mid-descent slip spike to test it properly is still on the list.
There’s also a PathAlignCritic gotcha worth knowing: its score() returns
immediately unless the robot has advanced offset_from_furthest points into the
path. The default is 20; my descent paths have ~15 points total, so the critic
was structurally disabled for the entire descent leg across three tuning
attempts that went nowhere. That one cost me a lot of time.
Status, honestly
Simulation only. Sim-to-real is an explicit separate phase rather than
something I’ve quietly deferred. The trusted 7-cell matrix is 1 PASS, 5 MARGINAL, 1 FAIL, and
there’s no planner_server/bt_navigator/map yet; every test drives the robot
with a hand-built FollowPath goal. All of that is written up rather than hidden.
Everything is verified against Gazebo ground truth rather than against the FSM’s
own report of its state. docs/retrospective.md has two cases where that
distinction mattered enormously, including a controller that tracked its plan
correctly and still drove off a ledge because localisation was wrong.
What I’d value
- Anyone who knows MPPI well telling me where the parameter profiles are wrong.
They’re honest placeholders that happen to work, not a tuned result. - Reproduction. If you re-run a published number and disagree with me, that’s
more useful than agreement, and there’s an issue template for it. - Anyone who has run a real AMR on a ramp with a shifting payload. I’d like to
know where the simulation is lying to me. - Mechanical review, which I did not expect to need at all. Someone worked the
traction balance on the grade today, and following it through the load transfer
that unloads the uphill axle under braking, my descent acceleration ceiling of
2.0 m/s^2 may be roughly three times what those wheels can actually take before
they slip. On this chassis CG height over wheelbase is 0.49, which is tall
enough that the transfer term dominates. It is paper maths until I measure it in
the simulator, and it is issue 25.
Twenty issues are open at a range of sizes. Being straight about the easy end:
the tasks needing no simulator all got taken today, so what is currently unclaimed
needs either ROS or a working Gazebo install. There is also a standing request for
anyone with a real robot and a ramp, and docs/hardware-test-plan.md now sets out
what a first session would actually involve rather than leaving it vague.
Four pull requests merged today, which I mention only because “will my PR sit
there for a month” is a fair thing to wonder about an unknown repo.
Happy to answer anything here.
Kunal