ArduPilot / ardupilot_gazebo

Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers
GNU Lesser General Public License v3.0
93 stars 85 forks source link

Add parachute plugin #36

Closed srmainwaring closed 1 year ago

srmainwaring commented 1 year ago

This PR adds a parachute plugin requested in #33 and builds on the initial version by @41Mo.

Details

Example: Zephyr Delta Wing with Parachute

The ArduPilot wiki entry for configuring a parachute is here: Peripheral Hardware/Parachute.

Parachute set up

ArduPilotPlugin

Add a control element for the parachute:

<control channel="4">
  <jointName>parachute_attachment_joint</jointName>
  <type>COMMAND</type>
  <cmd_topic>/parachute/cmd_release</cmd_topic>
  <servo_min>1100</servo_min>
  <servo_max>1900</servo_max>
</control>

ParachutePlugin

Add the parachute plugin element to the model:

<plugin filename="libParachutePlugin.so" name="ParachutePlugin">
  <parent_link>parachute_attachment_link</parent_link>
  <child_model>parachute_small</child_model>
  <child_link>chute</child_link>
  <child_pose>0 0 0 0 -1.0 0</child_pose>
  <cmd_topic>/parachute/cmd_release</cmd_topic>
</plugin>

Zephyr Parameters

Set the parameters for parachute release using MAVProxy:

# Enable parachute release triggered by a servo.
CHUTE_ALT_MIN    0
CHUTE_CRT_SINK   0.0
CHUTE_DELAY_MS   500
CHUTE_ENABLED    1        # Enabled
CHUTE_OPTIONS    1
CHUTE_SERVO_OFF  1100
CHUTE_SERVO_ON   1900
CHUTE_TYPE       10       # Servo

# Assign servo5 for parachute release.
SERVO5_FUNCTION  27       # Parachute
SERVO5_MAX       1900
SERVO5_MIN       1100
SERVO5_REVERSED  0        # Normal
SERVO5_TRIM      1500

# Assign RC9 to trigger manual release.
RC9_MAX          1900
RC9_MIN          1100
RC9_OPTION       22       # Parachute Release
RC9_REVERSED     0        # Normal
RC9_TRIM         1500

Running

Gazebo Sim

gz sim -v4 -r zephyr_runway.sdf

ArduPilot SITL

sim_vehicle.py -D -v ArduPlane -f gazebo-zephyr \-\-model JSON \-\-map \-\-console

MAVProxy commands

A figure of 8 mission at alt = 100m is set.

  MANUAL> fbwa            # switch mode 
  FBWA>   arm throttle    # arm
  FBWA>   rc 3 1900       # vertical launch
  FBWA>   auto            # switch to auto
  AUTO>   rc 9 1900       # manual parachute release

Figure: Parachute release with zephyr delta wing.

https://user-images.githubusercontent.com/24916364/208469930-0c5e81dd-ccf1-4d59-98ea-f333e8cb6cfd.mov