ArduPilot / ardupilot_gazebo

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

Add support for using Ardupilot FDM for the vehicle dynamics instead of Gazebo #90

Open Ryanf55 opened 4 months ago

Ryanf55 commented 4 months ago

Feature request

Is your feature request related to a problem? Please describe.

Creating a gazebo model, with lift/drag coefficients requires precise knowledge of the vehicle. This is only needed if you want gazebo to run physics on the vehicle. What if I want to use gazebo for doing robotics-type stuff like path planning, computer vision, and SLAM, but don't have experience with aerodynamics?

Describe the solution you'd like

Perhaps a simpler approach for people using gazebo is to have ArduPilot SITL run the FDM, send the FDM state to gazebo, and then have Gazebo skip running physics on the vehicle.

This has the cost of removing collision support, but the advantage is now you can drive a lot more of the vehicle behavior from the Ardupilot SIM* parameters.

In it's simplest form, reproduce this demo on gazebo harmonic:

Describe alternatives you've considered

Learning more aerodynamics and how the lift/drag plugin works.

Platform [ ] All [ ] AntennaTracker [x] Copter [ ] Plane [ ] Rover [ ] Submarine

Additional context

To create a new plane, here are the steps it looks like you need based on the current zephyr.sdf file. This is a lot of work. A user on the discord server asked how to do it for a cessna-style plane. I've tried to summarize the process here

zephyr.sdf

  1. Create links for all the parts of the vehicle
    • wing
    • propellor
    • flap_left
    • flap_right
    • imu_link
  2. Each link you need to know
    • pose
    • mass
    • Inertia
    • a visual geometry which can be either a mesh in .dae format or a simple collision box
    • a collision geometry, same as above, and you can re-use a the .dae file
  3. The wing link also has collision boxes defined with the rudders (seems this is to have mechanical limits of the elevon throws)
  4. Create joints (all are revolute)
    • flap_left_joint
    • flap_right_joint
    • imu_joint
    • propeller_joint
  5. For each of the joints, you need to know
    • damping coefficient
    • For the flaps, you also have axis limits, which seem redundant with having collision defined above

zephyr_with_ardupilot.sdf

Here is where you add the plugins of:

The lift drag plugin seems quite complex to understand all the aerodynamic values. Hence, the motivation to just use the ArduPilot FDM.