Repository navigation
fix: call normalize_state_quaternions() before applying it in TRAPEZOIDAL - #1112
Conversation
pariterre
left a comment
There was a problem hiding this comment.
@pariterre reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Ipuch).
…IDAL Building any OCP with quaternions and OdeSolver.TRAPEZOIDAL crashed while the integrator was being constructed. normalize_state_quaternions is a cache_function-decorated method that returns a casadi Function, but TRAPEZOIDAL.next_x passed the state vector to the method itself instead of to the returned Function. cache_function then tried to use the symbolic (SX/MX) as part of its cache key, which fails (a TypeError on the biorbd model here, a hash error on other symbolic types). Add the missing "()" so the Function is retrieved first and then called. The RK integrator already did it correctly and is unchanged. Add a regression test building a TRAPEZOIDAL OCP on the quaternion model; construction alone triggers the bug, so no solve is needed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
b605e7d to
cbd7f66
Compare
pariterre
left a comment
There was a problem hiding this comment.
@pariterre reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Ipuch).
Removed 'review_requested' from pull request trigger types.
pariterre
left a comment
There was a problem hiding this comment.
@pariterre reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Ipuch).
Discard automerge on new pushes
pariterre
left a comment
There was a problem hiding this comment.
@pariterre reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Ipuch).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1112 +/- ##
==========================================
+ Coverage 78.09% 78.25% +0.15%
==========================================
Files 198 198
Lines 21694 21747 +53
==========================================
+ Hits 16942 17018 +76
+ Misses 4752 4729 -23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pariterre
left a comment
There was a problem hiding this comment.
@pariterre reviewed 2 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Ipuch).
pariterre
left a comment
There was a problem hiding this comment.
@pariterre reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Ipuch).
pariterre
left a comment
There was a problem hiding this comment.
@pariterre reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on Ipuch).
Building any OCP with quaternions and OdeSolver.TRAPEZOIDAL crashed while the integrator was being constructed. normalize_state_quaternions is a cache_function-decorated method that returns a casadi Function, but TRAPEZOIDAL.next_x passed the state vector to the method itself instead of to the returned Function. cache_function then tried to use the symbolic (SX/MX) as part of its cache key, which fails (a TypeError on the biorbd model here, a hash error on other symbolic types).
Add the missing "()" so the Function is retrieved first and then called. The RK integrator already did it correctly and is unchanged.
Add a regression test building a TRAPEZOIDAL OCP on the quaternion model; construction alone triggers the bug, so no solve is needed.
This change is