Skip to content

Remove carParams.mass - #3665

Open
adeebshihadeh wants to merge 1 commit into
masterfrom
rm-mass
Open

Remove carParams.mass#3665
adeebshihadeh wants to merge 1 commit into
masterfrom
rm-mass

Conversation

@adeebshihadeh

@adeebshihadeh adeebshihadeh commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

CarParams.mass only feeds the lateral bicycle-model stack:

Repo Consumer Why mass cancels
opendbc VehicleModel inputs, equations Tire stiffness scales as C ∝ m and inertia as I ∝ m; the equations use C/m and C/I.
openpilot paramsd, CarKalman Uses the same C/m and C/I bicycle-model terms.
xx lateral planner Uses m/C_rear, while C_rear ∝ m.

This renames the field to unitMass and fixes it at 1 kg. Tire stiffness remains in N/rad, rotational inertia remains in kg*m², and the standard equations and behavior are unchanged.

Other options:

  • Mass-normalize everything (#3666): slightly simpler equations and no fake mass field, but then stiffness and inertia no longer use their normal SI units and the equations are less recognizable.
  • Keep an arbitrary mass local to every consumer: makes the trick obvious at each call site, but duplicates the scaling setup and makes it easier for consumers to get out of sync.

Consumer updates: openpilot #38594, xx #6940

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Car behavior report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ No changes detected

@github-actions github-actions Bot added the car related to opendbc/car/ label Aug 8, 2026
@adeebshihadeh
adeebshihadeh force-pushed the rm-mass branch 3 times, most recently from d1993dd to 2257094 Compare August 9, 2026 00:08
mass cancels out of the bicycle model since tire stiffness and rotational
inertia both scale with it. store stiffness/inertia per unit mass (divided
by the reference Civic mass) so mass disappears from the vehicle model
entirely instead of substituting a fake mass constant.

carParams.mass is still set, just no longer consumed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant