ArduPilot / SITL_Models

Models of aircraft for SITL
70 stars 111 forks source link

Add truck quadplane landing example #62

Closed srmainwaring closed 2 years ago

srmainwaring commented 2 years ago

This draft PR provides an example for simulating a quadplane landing on the back of a truck semi-trailer unit.

It has a dependency on https://github.com/ArduPilot/SITL_Models/pull/61 which is cherry-picked into this PR. When #61 has been merged this PR can be rebased and moved to review.

https://user-images.githubusercontent.com/24916364/151050925-e33c7441-7e68-430f-9622-8ddd8b7f61f3.mov

Usage

You must run the SITL launch script before starting Ignition Gazebo as it generates the world file for the simulation.

Run ArduPilot SITL

Change to the root directory where ArduPilot is installed ($ARDUPILOT_HOME), then run the launch script:

~/SITL_Models/Ignition/launch/truck-quadplane-landing.sh

This will create a number of directories under the ardupilot root directory. There is a directory for each vehicle that contains the eeprom.bin for each SITL instance, additional parameter files for configuring the SYSID_THISMAV and follow mode. For the tractor unit there is also a scripts directory containing the custom mixer.

The worlds directory contains a generated SDF world file that configures each model to have the correct ports and assembles the tractor - trailer units from their component parts.

sitl
├── quadplane
│   ├── eeprom.bin
│   ├── follower.param
│   ├── logs
│   │   ├── 00000001.BIN
│   │   └── LASTLOG.TXT
│   └── terrain
│       └── S36E149.DAT
├── tractor
│   ├── eeprom.bin
│   ├── leader.param
│   ├── logs
│   │   ├── 00000001.BIN
│   │   └── LASTLOG.TXT
│   └── scripts
│       └── daf_xf_450_tractor_mixer.lua
├── trailer
│   ├── eeprom.bin
│   ├── leader.param
│   └── logs
│       ├── 00000001.BIN
│       └── LASTLOG.TXT
└── worlds
    └── truck_quadplane_landing.sdf

Run Gazebo

ign gazebo -v 4 -r truck_quadplane_landing.sdf

Run MAVProxy

In another terminal run the MAVProxy launch script supplying as an argument the number of vehicles being simulated:

~/SITL_Models/Ignition/launch/mavproxy-multi-vehicle.sh 3

Enable position forwarding:

MAV> set posfwd 1

Controlling the vehicles

There are 3 vehicles:

Notes

The truck is speed limited to 5 m/s in AUTO mode by overriding WP_SPEED in the launch script.

The quadplane model is now an Alti Transition QuadPlane

The MAVProxy wiki contains more information about using SITL with multiple vehicles:

JohnVorwald commented 6 months ago

I tried to switch 3rd vehicle from alti to iris, and the iris model doesn't connect to mavproxy. How to debug / resolve?

srmainwaring commented 6 months ago

I tried to switch 3rd vehicle from alti to iris, and the iris model doesn't connect to mavproxy. How to debug / resolve?

Hi @JohnVorwald, it's customary not to add help requests to closed issues and PRs. The best place to ask for help is ArduPilot Discourse. Can you open a request there, provide details of your environment and what you are trying to do. The more information (details of commands, code changes), the more likely it is someone will be able to reproduce and help.

JohnVorwald commented 6 months ago

Good morning, @srmainwaring . I described the error here: https://discuss.ardupilot.org/t/combine-two-working-models-for-gz-sim/111313/3