Skip to content

simulation: compute anti paths from the hardpoints, not KinPy - #186

Merged
raorjun merged 2 commits into
mainfrom
arjun/anti-paths-no-kinpy
Oct 27, 2026
Merged

raorjun merged 2 commits into
mainfrom
arjun/anti-paths-no-kinpy

Conversation

@raorjun

@raorjun raorjun commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Why

tools/anti_paths.py used BobSim KinPy to solve the corner at five jounce steps and take finite differences. KinPy may be deprecated. The anti coefficients need only first-order kinematics at the design pose.

What changes

  • anti_paths.corner_coefficients solves the upright twist directly. Each of the five links (four wishbone legs and the tie rod) keeps its length. The twist is the null space of a 5x6 linear system. It uses numpy only.
  • The contact-patch, wheel-center and virtual-power coefficients come from that twist, with the same formulas as before.
  • Parallel links that leave more than one degree of freedom raise an error. The record is then invalid.
  • Dropped KinPy-only fields: the jounce step, the finite-difference tolerance and the bobsim_instant_link cross-check. pose.kind is now hardpoint_twist.
  • docs/anti-paths.md describes the new method.
  • The FourPost acceptance (simulation: check FourPost anti coefficients against the hardpoints #185) now calls this solve, so the repo has one copy. A contact patch with no vertical velocity raises an error, as in simulation: check FourPost anti coefficients against the hardpoints #185.

Evidence

  • On vehicle/vehicle.yml, all three coefficients equal the old KinPy values to 6 digits. Front: contact patch 0.005135, wheel center and virtual power −0.003893. Rear: −0.008952 and 0.004727.
  • test_anti_paths.py now compares with the statics oracle (tests/anti_oracle.py) at 1e-9, not at the old finite-difference tolerance.
  • New test: parallel links are rejected.
  • make test: 364 passed.

Limits

  • studies/front-ackermann/run.py still uses KinPy for full nonlinear steering geometry. It is a historical study and is not changed here.

Stack

On #185.

@raorjun
raorjun requested a review from a team as a code owner October 27, 2026 21:31
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between c035a8e and a238e3f.

Files selected for processing: 6
  • simulation/docs/anti-paths.md
  • simulation/docs/bobsim.md
  • simulation/tests/test_anti_paths.py
  • simulation/tests/test_four_post_acceptance.py
  • simulation/tools/anti_paths.py
  • simulation/tools/four_post_acceptance.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lhre-ultron

lhre-ultron Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Safe to merge. I found no defect in the new twist solve or in the callers I could read.

I read the full diff. The five link constraints are [l, p×l] rows, which is correct for a point velocity v0 + ω×p. The null vector is Vt[-1] from a full 6×6 SVD. The rank-deficiency and zero-vertical-velocity checks raise ValueError, and anti_records turns that into an invalid record. corner_coefficients has two callers, anti_records and the acceptance's contact_patch_coefficient. The only caller I found passing the removed step_m argument was anti_records itself, which this PR updates. The four-post acceptance keeps its KeyError/TypeError/ValueError handling.

What I checked

Checked: the whole diff and the changed files. I confirmed the constraint-row algebra, the SVD null-space indexing, and the 5th-singular-value test for duplicate or parallel links. I checked the new camber_deg/toe_deg keys: both exist in vehicle/vehicle.yml and are 0 on both axles. I checked that no other caller passes step_m, uses bobsim_instant_link, or reads the dropped pose fields.

Didn't check: I did not run make test, so I did not reproduce the 364 passing tests or the 6-digit match with the old KinPy values. The pinned monorepo is older than this PR's base (it has no tests/ or anti_oracle.py). The contact offset [0, sin(camber), cos(camber)] is a sign convention that only shows up with nonzero camber. I could not test that sign, because the real car and the visible tests use 0° camber and toe.

Assumed: the statics oracle in the PR branch is independent of this solve and agrees at 1e-9, as the PR says. #185 is the base and this PR changes nothing else in the FourPost flow.

Ultron reviewed 585e30d · it re-reviews on new pushes

@raorjun
raorjun force-pushed the arjun/anti-paths-no-kinpy branch from f1cfa4e to 585e30d Compare October 27, 2026 21:35
@raorjun
raorjun changed the base branch from main to arjun/four-post-anti-check October 27, 2026 21:35
@raorjun
raorjun added this pull request to stack #187 October 27, 2026 21:35
Base automatically changed from arjun/four-post-anti-check to main October 27, 2026 21:36
@raorjun
raorjun force-pushed the arjun/anti-paths-no-kinpy branch from 585e30d to a238e3f Compare October 27, 2026 21:36
@raorjun
raorjun merged commit cbea3a6 into main Oct 27, 2026
9 checks passed
@raorjun
raorjun deleted the arjun/anti-paths-no-kinpy branch October 27, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant