SwiftGust / ardupilot_gazebo

Repository for ArduPilot & Gazebo Software In Loop Simulation Interfaces, Models
76 stars 89 forks source link

How to simulate a custom tilt rotor with Gazebo #25

Open jzattelman opened 4 years ago

jzattelman commented 4 years ago

I've created a custom tilt rotor model in gazebo and can successfully link it with the gazebo SITL. The model is a quadplane (which will have a wing in the future) and each motor arm is able to tilt forwards to transition to fixed wing flight.

In the model SDF file, how do I tell Gazebo to take the PWM command from Ardupilot SITL and turn it into motor arm angular position? (eg 0 degrees is when the motor arm is vertical and 90 degrees is when the motor arm is tilted forward for fixed wing flight).

Thanks in advance!

SwiftGust commented 4 years ago

Hi, Are you referring quad-tilt-rotor type aircraft? I think zephyr ardupilot model would be good example in this case since there is propeller & elevon. I can't find good example with such aircraft in Gazebo

Refer this part of the section, https://github.com/SwiftGust/ardupilot_gazebo/blob/master/models/zephyr_delta_wing_ardupilot_demo/delta_wing.sdf#L132-L186

Use position type for tilt joint, and set other parameters correct such as offset, min & max by trial and error. For the rough example, if upright position is 0 degree, then control output from ArduPilot without tilt command(i.e. PWM low) should make tilt joint to hold upright too. This ArduPilot control to gazebo joint command interpretation is up to multiplier, offset, cmd_min & cmd_max plugin parameters.

sundexin111 commented 3 years ago

is there a ArduPlanePlugin,my arduplane is not connected with gazebo

SwiftGust commented 3 years ago

@sundexin111 ArduPilotPlugin is generic plugin for ArduPilot-Gazebo SITL, use this plugin and check your settings if it doesn't connect. Please open another issue to discuss issue.