Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SITL: add simulated slung payload #27536

Merged
merged 2 commits into from
Jul 24, 2024
Merged

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Jul 12, 2024

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:

  1. update the payload's position, velocity using the previous iterations acceleration
  2. check that the payload does not fall below the terrain
  3. check if the line is taught and that the payload does not move more than the line length from the vehicle
  4. calculate gravity and drag forces on the payload
  5. calculate the tension force between the payload and vehicle including force countering gravity, drag and centripetal force
  6. update the payload's acceleration using the sum of the above forces
  7. update the vehicle's acceleration using the opposite of the above forces

This has been tested in SITL and seems to move in a plausible way.
image
image

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.
image

libraries/SITL/SIM_Aircraft.cpp Outdated Show resolved Hide resolved
libraries/SITL/SIM_Multicopter.cpp Show resolved Hide resolved
libraries/SITL/SIM_SlungPayload.cpp Outdated Show resolved Hide resolved
@tridge tridge merged commit a1579bc into ArduPilot:master Jul 24, 2024
93 checks passed
@rmackay9 rmackay9 deleted the sim-slung-payload branch July 24, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants