Skip to content

Commit

Permalink
Gazebo: Add model for Swan-K1-HWing
Browse files Browse the repository at this point in the history
1. add initial model for base / fuselage

2. add mesh for engine and spinner

3. reorient and recentre fuselage mesh
- Orientation should be for normal flight mode (ROS convention x-forward, y-left, z-up)

4. update texture name in motor mesh

5. add ENU axis to runway for orientation

6. add IMU sensor and link

7. fix scaling error in exported fuselage mesh

8. enable IMU link and reorient plane vertically in world

9. add system plugins JointStatePublisher and ApplyJointForce for motors

10. add ardupilot plugin and reassign motor positions to match wiki
- Assign servos according to docs for NYT QUAD X Motor Tailsitter
- Correct plugin comments

11. add sphere collision for legs
- Add sphere collisions for legs to improve performance - mesh collisions need to be replaced.

12. add prop visuals and materials
- Add prop materials and visuals
- Add PBS material for the fuselage

13. add param file from RF model

14. update prop visuals
- Use CCW and CW props visuals as required

15. update param file
- Set SERVOX_FUNCTION as for x-frame, quad
- Set Q_TAILSIT_MOTMX  4

16. update motor and prop collisions and prop orientation
- Temp set prop colours to assist identifying

17. add initial draft of prop lift-drag plugins

18. update motor link and joint poses
- Set motor link relative to joint
- Position joints and rotate into place
- Align motor axis to local +z (simplifies lift-drag plugin config)

19. update inertials
- Reduce mass of fuselage and motors

20. update example world name and increase motor joint damping

21. convert motors to NYT QUAD X Motor Tailsitter config
- Change lift directions on props for altered config
- Add box collision to allow arming in horizontal orientation
- Update params (AHRS_ORIENTATION, Q_FRAME_TYPE, Q_TAILSIT_MOTMX)

22. cant motors from vertical by 10 deg
- cant motors towards wingtips

23. add lift drag and visual markers for wings and winglets

24. revert frame type back to X-Quad
- Motor angle directions are suitable for X-Quad config
- Revert to Q_FRAME_TYPE = 1
- Update RC input limits

25. conservative tune VTOL mode
- Tune Q_A_RAT_RLL_*, Q_A_RAT_PIT_*, Q_A_RAT_YAW_*
- Set I = P = 0.05, D = 0, SMAX = 50
- Disable rudder arm / disarm
- Set ARSPD_TYPE = 0 (no airspeed sensor)
- Set RC2_REVERSED = 0 (was reversed)

26. update for ignition to gz migration.

27. update the Swan-K1 model

- Add vertical stabilisers.
- Update the prop PID controller settings - NB: the command limits.
- Add RTF control to the world file.

28. update the Swan-K1 params

- Auto-tuned VTOL params.
- Match settings from AP defaults.

29. Gazebo: Add model for Swan-K1-HWing

- Update Swan-K1 params, modify forward flight to VT transition params.
- Update Swan-K1 document.
- Update Swan-K1 model visuals.
- Update Swan-K1 documentation.

Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring committed Jan 3, 2023
1 parent a036d16 commit d97e2e9
Show file tree
Hide file tree
Showing 21 changed files with 4,032 additions and 0 deletions.
1,466 changes: 1,466 additions & 0 deletions Gazebo/config/swan_k1_hwing.param

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions Gazebo/docs/Swan-K1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Swan-K1 Copter Tailsitter Quadplane

Model for the Swan-K1 copter tailsitter quadplane for use with ArduPilot.
It is derived from the [version prepared for RealFlight](https://github.com/ArduPilot/SITL_Models/tree/master/RealFlight/Released_Models/QuadPlanes/Tailsitters/Swan_K-1_HWing).


![swan-k1-hwing-flying](https://user-images.githubusercontent.com/24916364/210408630-01e5f56d-57ba-430e-b04d-62cb8d232527.png)


## Usage

Gazebo and the plugins should be installed as per the [ArduPilot Gazebo Plugin](https://github.com/ArduPilot/ardupilot_gazebo) instructions.

Update the `GZ_SIM_RESOURCE_PATH` to include these models:

```bash
export GZ_SIM_RESOURCE_PATH=$GZ_SIM_RESOURCE_PATH:\
$HOME/SITL_Models/Gazebo/models:\
$HOME/SITL_Models/Gazebo/worlds
```

#### Run Gazebo

```bash
$ gz sim -v4 -r swan_k1_hwing_runway.sdf
```

#### Run ArduPilot SITL

```bash
$ sim_vehicle.py -v ArduPlane -f JSON --add-param-file=$HOME/SITL_Models/Gazebo/config/swan_k1_hwing.param --console --map
```
Binary file added Gazebo/models/swan_k1_hwing/materials/foxmap.tga
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gazebo/models/swan_k1_hwing/meshes/foxmap.tga
Binary file not shown.
115 changes: 115 additions & 0 deletions Gazebo/models/swan_k1_hwing/meshes/iris_prop_ccw.dae

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions Gazebo/models/swan_k1_hwing/meshes/iris_prop_cw.dae

Large diffs are not rendered by default.

296 changes: 296 additions & 0 deletions Gazebo/models/swan_k1_hwing/meshes/swan_k1_hwing_engine.dae

Large diffs are not rendered by default.

569 changes: 569 additions & 0 deletions Gazebo/models/swan_k1_hwing/meshes/swan_k1_hwing_fuselage.dae

Large diffs are not rendered by default.

242 changes: 242 additions & 0 deletions Gazebo/models/swan_k1_hwing/meshes/swan_k1_hwing_motor.dae

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Gazebo/models/swan_k1_hwing/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<model>
<name>Swan K-1 HWing</name>
<version>1.0</version>
<sdf version='1.7'>model.sdf</sdf>

<author>
<name>Brandon MacDougall</name>
</author>

<author>
<name>Andrew Tridgell</name>
</author>

<author>
<name>Rhys Mainwaring</name>
<email>[email protected]</email>
</author>

<description>
This is a model of a Swan K-1 HWing with ArduPilot integration.
</description>
</model>
Loading

0 comments on commit d97e2e9

Please sign in to comment.