feat: apply nonlinear/asymmetric T200 thrust curve in manager + sim - #570
Open
nrebolloso wants to merge 1 commit into
Open
feat: apply nonlinear/asymmetric T200 thrust curve in manager + sim#570nrebolloso wants to merge 1 commit into
nrebolloso wants to merge 1 commit into
Conversation
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.
Closes #340.
The thruster manager assumed thrust maps linearly to effort and that a thruster makes the same force forward and reverse. Neither is true for the T200s (forward is ~20-30% stronger than reverse, and the PWM-to-thrust curve is nonlinear), which is likely behind the asymmetric rotation and the flaky translation maneuvers, plus why anything that trusts the thrust estimate (open-loop control, drag comp) only works sometimes.
This replaces the old single-slope scaling with the real measured curve, and makes the sim use the same one.
Testing:
Added test/test_lut.cpp (GTest, wired into CMake):
deadband where the inverse isn't unique).
force in reverse costs more effort than forward.
All 11 passing. Writing these caught a small out-of-bounds bug in the interpolation at the top of the range, now fixed.
Validated in sim: applied the curve in Gazebo and the thrusters respond with the asymmetric force. Not yet validated on hardware.
Two things to flag for review: