Skip to content

2.9 Angular constraints

The standard swerve planner accepts a chassis angular acceleration limit through LimitsConfigs.maxAngularAcceleration(AngularAcceleration). Python and C++ use max_angular_acceleration with a value in rad/s². The existing maxAngularVelocity setting supplies the angular speed limit. Zero and positive infinity leave either limit unset. Negative values and NaN are rejected.

The acceleration limit is opt-in. With it disabled, heading interpolation does not impose an acceleration bound. The C entry point tempo_replanner_new_with_angular_acceleration takes the limit as a separate function argument and does not store it in a C structure.

Physical meaning

Linear acceleration changes chassis translation. Centripetal acceleration limits the curvature of that translation. Angular acceleration changes chassis angular velocity. A swerve robot can follow a straight line while rotating, or follow a curved line while holding its heading, so these are separate bounds.

Angular acceleration requires torque and rotational inertia:

torque = sum(moduleX * forceY - moduleY * forceX)
alpha = torque / momentOfInertia

Robot mass and wheel COF alone do not determine rotational inertia. The PathPlanner configuration guide describes CAD and measured inertia and warns that a uniform-mass estimate can be inaccurate. The editor accepts measured inertia or labels its uniform-frame estimate explicitly. PathPlanner robot configuration.

The editor calculates pure-yaw ceilings from each module’s offset radius r, wheel speed v, and net current-limited force Fmotor:

omegaMax = min(v_i / r_i)
force_i = min(Fmotor_i, mu_i * mass * 9.81 / moduleCount)
alphaMax = sum(r_i * force_i) / momentOfInertia
estimatedInertia = mass * (frameLength² + frameWidth²) / 12

The acceleration calculation assumes centered mass and equal normal loads. It follows the at-rest force and torque calculation in PathPlanner’s robot settings. The angular speed ceiling follows module velocities under pure rotation in WPILib swerve kinematics. An inertia estimate is not a measured robot property. These ceilings do not reserve module force or speed for simultaneous translation.

PathPlanner’s trajectory generator combines module forces, computes chassis torque divided by inertia, and caps angular acceleration separately from linear acceleration. Its full module dynamics model also accounts for motor speed and available torque. Tempo’s scalar angular limit does not establish that joint translation and rotation fit every module’s electrical or traction envelope. PathPlanner trajectory source.

Continuous heading profile

Finite acceleration requires continuous angular velocity between trajectory samples. Linear interpolation of angles has piecewise-constant angular velocity with jumps at the knots. Bounded profiles are stored analytically and evaluated at the actual query time, including angular feedforward.

A rest-to-rest heading interval of duration T uses cubic time scaling when the cubic keeps both caps, with shortest-angle displacement d and u = t / T:

theta(t) = theta0 + d * (3*u² - 2*u³)
omega(t) = 6*d*u*(1-u) / T
alpha(t) = 6*d*(1-2*u) / T²

max(abs(omega)) = 1.5*abs(d) / T
max(abs(alpha)) = 6*abs(d) / T²

A shorter interval uses trapezoidal time scaling. The rate rises at a constant a to a cruise rate w = min(omegaLimit, 2*abs(d)/T), holds it, and falls at a to rest. a = w² / (w*T - abs(d)) is the gentlest rate change that fits. The fastest turn reaches the cap at full acceleration and cruises there:

T_min = abs(d)/omegaLimit + omegaLimit/alphaLimit   when abs(d) > omegaLimit²/alphaLimit
T_min = 2*sqrt(abs(d)/alphaLimit)                   otherwise

A cubic needs T >= 1.5*abs(d)/omegaLimit and T >= sqrt(6*abs(d)/alphaLimit), so a turn the rate cap limits takes up to a third less time as a trapezoid. Each stretch of constant rate change is stored as a span of its own, so every bound on spans (extrema, excursions, retiming) applies unchanged. A turn that starts already moving brakes to rest first when it moves away from its target or cannot stop short of it, and otherwise changes rate at alphaLimit to a cruise rate, holds it and brakes. Angular velocity is continuous, but acceleration may change discontinuously. No jerk bound is implied. These profiles follow the cubic and trapezoidal time scaling in Modern Robotics, chapter 9.

On a swerve drive a module at offset r moves at the chassis velocity plus omega x r, so a turn shares the module’s wheel speed with translation. A route resolved from a robot configuration carries the drive’s wheel speed and farthest module offset (HeadingSpec::module_speed, the route block’s moduleSpeed). The wheel speed is the drive’s 12 V wheel speed where a motor model gives one and Speed.FULL’s velocity otherwise. The offset is the largest module offset. For each stretch between rotation targets the planner picks the turn rate w and translation cap v with v + w*r within the wheel speed that give the stretch its least time (Trajectory::module_speed_shares). Of the rates that give that time it keeps the slowest. A turn under an angular acceleration cap peaks at sqrt(abs(d)*alpha) from rest, so a higher rate never shortens it and only takes wheel speed from translation. A 1.37 m leg turning a quarter turn under 12.57 rad/s^2 and a 9.42 rad/s cap (CTRE’s PathPlanner “Tests” auto, 4.5 m/s module at 0.377 m) reserved 6.3 rad/s where the turn reaches 4.44, capping translation at 1.94 m/s. Both legs together take 1.50 s in place of 1.76 s on an obstacle-free field. On the seeded turning corpus with a 4.5 m/s, 0.38 m module at 9.42 rad/s and 12.57 rad/s^2, 220 of 1,272 plans are faster (18.1 s in all, up to 0.23 s) and 2 slower. In those two the faster turn reaches a span beside the hub too narrow to rotate in and the leg finishes it before the span. A travel-facing leg turns at v*abs(kappa) on a path of curvature kappa, so each sample’s ceiling is S / (1 + abs(kappa)*r) for wheel speed S, over the sharper curvature of the sample and its neighbors. Either way the planned translation and turn never ask a module for more than it drives. A differential or mecanum leg (the mecanum wheel model shares its own wheel speed), a leg that crosses terrain and a leg with Rotation Lock holds plan against the angular caps alone.

A module’s wheel force at a wheel speed falls toward the drive’s top speed (back EMF and the loss that grows with speed), so the angular acceleration a robot reaches while it translates falls with its speed. ModuleSpeed carries that as a TurnAcceleration curve of (speed, angular acceleration) points. The curve is the measured turning curve where a calibration gives one. Otherwise, where the angular acceleration is the one derived from FULL’s and a motor model gives the drive’s acceleration curve, it is the derived angular acceleration scaled by min(1, drive.at(v) / FULL acceleration), since the derived angular acceleration is linear in the linear one. A stated angular acceleration is the team’s own cap and carries no curve. module_speed_shares evaluates the curve at the fastest the stretch drives, its translation cap v(w) or the speed the leg reaches over its length from its faster end if lower, puts that in the turn’s least time T(w) and sets it as the keyframe’s max_turn_acceleration_rad_s2. The authored profile, required_duration and prefix_duration read that in place of the leg’s cap for that turn. The route block spells the curve as moduleSpeed’s third element. On the seeded turning corpus with a 4.5 m/s, 0.38 m module and 2910’s drive curve scaled to each leg, the plans that ask for more angular acceleration than the curve gives at their speed drop from 433 of 1,272 (peak 1.64 times the curve) to none. That comes at +4.5% plan time (3 faster, 799 slower, 470 unchanged). Without a curve every plan keeps its bits.

A turn whose stretch between keyframes would run short of its turn time caps that stretch’s speed at the highest value whose capped profile, with its ramps in and out of the stretch, still takes the turn time (keyframe_stretch_caps, the stretch form of whole_leg_cap). A cap at the stretch’s length over the turn time holds the whole stretch to the mean speed, and the ramps undercut that. A 4.2 m leg of the seeded turning corpus that turns 1.8 rad at 2 rad/s and 4 rad/s^2 takes 1.96 s under that cap and 1.73 s under the highest one.

A leg whose only target is its end and whose drive is shorter than its turn waits out the turn through its middle and keeps the speed it enters and leaves at (ramped_leg_cap). Its cap sits under ramps that brake from the start speed and rise to the end speed (end_ramps). Each step takes the least longitudinal budget the ramp’s speeds leave (the drive curve at the ramp’s top speed, inside the elliptical budget on the step’s curvature), so the profile pass keeps the end speed the next leg is planned from. A constant cap held the whole leg, both ends included, near its length over the turn time. On 4774’s Snowblow port the quarter turn leaving the 1.75 m/s sweep held 1.31 m/s and handed over at that speed. Ramped, it enters at the sweep’s speed, waits at 1.19 m/s and leaves at 3 m/s, and the auto drops from 7.26 s to 7.20 s. Where the ramps alone are faster than the turn at any cap, the constant cap stays. It also stays where the profile pass takes any speed from a ramped end. The junction beside it plans both sides again until their speeds agree, and an end that loses a little on every round never settles. On CTRE’s “Tests” auto a module share clipping the second leg’s first sample ahead of a tightening curve braked it by 0.7 mm/s a round, until the junction gave up and stopped the robot there.

A travel-facing leg’s bounded heading goes through the travel heading at anchors picked from the path’s samples (Trajectory::face_travel_anchors). The anchors are every sample where that keeps both caps, and otherwise every 2nd, 4th, … sample while the heading stays within ten degrees of the travel heading. The travel heading at a sample is the direction of its velocity at any speed above zero, unslewed, so it follows the path and not the clock. A leg that starts facing away from its travel turns onto it as it drives. The heading turns from its start toward the travel heading of the earliest sample one span reaches within both caps, and faces the travel from there (Trajectory::start_turn_catch). Where a span still breaks a cap, at a path corner or a tight bend, the anchors on both sides of it are left out a pair at a time. The heading then leads into the corner and trails out of it by up to half the corner’s largest step plus ten degrees (Trajectory::spread_corners). A span that still breaks a cap slows only the samples it covers. Each is capped at its speed over the span’s slowdown and the leg is profiled again under its acceleration limits, for up to four rounds, before what is left slows the whole leg (Trajectory::retime_face_travel). A speed carried through a junction is not capped there.

The heading lags the travel through a start turn, which the disk of the outline’s reach the leg is routed for clears. A plan whose lagging poses the turning certificate or the contact check refuses is made again within a StartTurnAtRest scope. In that scope a leg that starts at rest turns in place first, by the rest-to-rest turn at both caps. One that starts moving makes the turn over its first samples, slowed for it. Where that would take the speed it carries in, the whole leg slows instead. Only a plan whose heading starts more than ten degrees off its travel is made again. One the scope cannot plan takes the retries a leg turning beside contact takes. The outline plans of Replanner::plan_lagging_travel_off_the_disk do the same. A plan made in the scope differs from the lagging one, so its plan key carries the scope (START_TURN_AT_REST_FLAG). On the travel-facing corpus of leg_plan_time.rs at 9.42 rad/s and 12.57 rad/s^2 (2026-11-05), the routes that plan every leg complete within 1.07 (Field, traced-U) to 1.19 (random) times their time with no angular limit and 1.16 on the shipped pack. Shipped route 1 takes 6.90 s against 5.78 s.

Rotation targets finish their turn with zero angular velocity. This does not require stopping translation. A fraction-zero target with a different heading requires a bounded stationary turn before translation. A zero-distance route gets its duration from rotation.

Shared timing and execution

Heading deadlines constrain the translation timeline. For a required total duration T and path length L, a fixed translational ceiling no greater than L/T guarantees sufficient time. Adjacent legs negotiate their attainable boundary speeds against this fixed ceiling. Repeatedly scaling a completed trajectory would also shrink its endpoints on every negotiation pass.

Replanning seeds rotation from the last built-in angular command. The limits shape the planned heading and nothing after it. The standard follower adds its heading feedback to the planned rate without a bound, as PathPlanner’s PPHolonomicDriveController and ChoreoLib’s follower do, and the drivetrain’s wheel-speed desaturation bounds the modules. A coast through a hold slows its turn at the angular acceleration limit. Cancellation, failure, and safety holds can command an immediate stop.

A leg planned from the robot’s heading under an angular acceleration limit turns from where the robot is to the leg’s heading. Where the leg authors no turn of its own (every rotation target names its start heading) and the robot is within twice the heading a later leg’s plan may keep, that turn only closes the follower’s lag from the handover. It turns at the robot’s angular velocity limit and not the leg’s own cap. Choreo ports write a leg cap such as 0.1 rad/s on legs whose ends share a heading to hold it. Team 180’s LowPath_Loop2 entered such a leg 3.8 degrees behind after a quarter turn handed over at speed, closed the gap in 0.66 s under the cap and held the 1.35 m leg to 1.97 m/s where its limit is 2.75. A larger gap is a turn the leg before left unfinished and keeps the leg’s cap.

The independent yaw profile applies to holonomic motion. Differential heading remains coupled to the path tangent. Routed native and WebAssembly previews use the core trajectory profile. The legacy positional preview API has no angular acceleration argument.

Editor

Robot Configuration > Path limits offers Calculated or Custom angular limits. Calculated values are read-only and expose their equations on hover. The display accepts degrees or radians. Persisted values and generated configs use radians. Custom zero disables a robot-wide limit. Existing positive overrides remain custom. The editor rejects nonfinite values because JSON cannot represent infinity.

Path defaults, custom leg limits, and speed zones can lower the rotation limits. An absent leg override inherits path defaults. An explicit zero resets that component to the robot cap. Positive path and leg limits cannot raise a robot cap. Speed-zone limits apply to each complete leg touched by their selected interval.

Composer accepts limits(v, a, c, omega, alpha) in SI units. It affects the next to(...) and remains sticky. The three-value form resets the angular components to robot defaults. Full TrajectoryConstraints appends omega and alpha after its six existing values. Native route JSON omits the appended pair when both are zero, preserving existing serialized inputs and frozen traces.

Preview requests capture angular limits before loading a field and include them in the cache key. Without a game pack, enabled limits use an empty field through the routed API. A failed preview cannot fall back to unbounded planning.

Verification

Tests must check acceleration between samples as well as stored heading values. Coverage includes shortest-angle wrapping, keyframe deadlines, initial angular velocity, turns in place, terrain heading holds, junction carry, replanning, reactive overrides, completion, disabled-limit compatibility, and binding parity. Planning tests establish reference bounds, and that feedback may exceed them. Physical robot tracking still depends on localization, PID tuning, and attainable drivetrain forces.

esc

Loading search...