SITL: add simulated slung payload #27536
Merged
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.
This adds SITL support for a slung payload and is implemented similarly to how the Ship landing ship was implemented.
The payload can be enabled by setting a new SIM_SLUP_ENABLE parameter to 1. In addition the payload's weight, line length and air resistance (aka drag) can also be adjusted through new parameters
This Physics Classroom wiki page was used as a reference to come up with this method for updating the payload and vehicle's movements:
This has been tested in SITL and seems to move in a plausible way.
To add confidence I've checked that the payload reaches the correct maximum speed according to the above linked pendulum document. So with drag removed (e.g. SIM_SLUP_DRAG=0) and the vehicle suddenly stopped so as to cause the pendulum to swing out to 38deg the pendulum reached a maximum speed of 11m/s which is very close to the theoretical 11.17m/s.