microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.32k stars 4.55k forks source link

How to customize internal flight controller for drones? #4746

Closed haildceu1 closed 1 year ago

haildceu1 commented 1 year ago

Is there any way to customize internal flight controller for drones? The document says Airsim has a built-in flight controller called simple_flight, which uses a cascade of PID controllers. How could I change them into custom controllers like Lead-Lag Compensator or Geometric Control. I’m aware that Quadrotor flight controller receives desired state input such as position and angle level, and ouputs 4 PWM values to control the propellers with actual state. So I presume it’s possible to replace what’s between? I know there are some feasible options available right now:

  1. using external controller such as PX4
  2. using python API “moveByMotorPWMsAsync” with calculated PWM values in python files

But I’m completely unfamiliar of PX4, and my ultimate goal is to achieve a total-simulation game (no hardware involved) in unreal engine, with controlling UI where you can change types and parameters of controllers. Considering UE’s limited support for python, I’m afraid none of these options would work.

I also noticed in https://github.com/microsoft/AirSim/commit/a6aee1c7011aa60c5b51e18744a3e6dd9d421cc5?diff=split the author showed specific details of making simple_flight extensible for Adaptive Controller. Does this apply to all other controllers? Thank you!