Repository navigation
genhexkins: take the forward's Newton step in roll, pitch and yaw rates - #4724
Merged
Merged
Conversation
BsAtHome
reviewed
Oct 26, 2026
The forward kinematics is a Newton iteration on the platform pose that steps roll, pitch and yaw by the solution of J delta = strut errors, but it built the rotational columns of J as the strut moments (R a) x u. Those are the rates per angular velocity, which equal the rates per roll, pitch and yaw rate only at zero orientation. With the platform tilted the step was off, and the iteration converged linearly instead of quadratically. Motion runs this forward on the joint feedback every servo cycle, seeded with the pose of the cycle before. From such a seed, one cycle of motion away, on the hexapod-sim geometry tilted to 20 degrees and turned to 30, it took 12.6 iterations on average and 23 at most instead of three; tilted to 40 and turned to 60, one pose in ten did not converge within the 120 iteration limit. Running the sim through MDI tilts to A35 B35 C55, the most a feedback forward needed in the session was 117 iterations. Take the rows against the rates, w = E [dr dp dy], with the E that genhexKinematicsJacobian() uses. The same poses converge in three iterations at a quarter of the cost, none fails, and the sim session needs three at most. tests/genhexkins-forward walks 600 tilted poses with genhexkins.limit-iterations at 8, each seeded a cycle away; before this change 480 of them did not converge.
grandixximo
force-pushed
the
genhex-newton
branch
from
October 26, 2026 09:15
9d70099 to
54a868c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
genhexkins' forward kinematics is a Newton iteration on the platform pose. It steps roll, pitch and yaw by the solution of
J delta = strut errors, but it built the rotational columns ofJas the strut moments(R a) x u. Those are the rates per angular velocity. They equal the rates per roll, pitch and yaw rate only at zero orientation. With the platform tilted the step was therefore off, and the iteration converged linearly instead of quadratically.Motion runs this forward on the joint feedback every servo cycle, seeded with the previous cycle's pose. I measured it from such a seed, one cycle of motion away, on the hexapod-sim geometry:
In the hexapod sim, through MDI tilts up to A35 B35 C55,
genhexkins.max-iterationsread 117 at the end of the session before the change, against the limit of 120, and 3 after it.The fix takes the rows against the rates,
w = E [dr dp dy], the same E thatgenhexKinematicsJacobian()already uses.tests/genhexkins-forwardwalks a grid of 600 tilted poses withgenhexkins.limit-iterationsat 8, each seeded one cycle away. Without the change, 480 of them do not converge.It applies unchanged on top of #4702, which moves genhexkins onto the parameter block, and the test passes there too.