Skip to content

Show HN: I wrote a multicopter simulation library in Python

3 pointshazrmard4 comments
On HN

Documentation: https://multirotor.readthedocs.io/en/latest/

Source code: https://github.com/hazrmard/multirotor

Demo/Quickstart: https://multirotor.readthedocs.io/en/latest/Quickstart.html

There are many simulation libraries out there. For example AirSim using Unreal Engine, several implementations in Unity3D, Matlab toolboxes. I wanted a simple hackable codebase with which to experiment.

So, I wrote this. Propellers, motors, batteries, airframe are their own components and can be mixed and matched. The code lets you create any number of propellers, and an optimization function learns a PID controller for that vehicle. Additionally, there are convenience functions to visualize in 3D and sensor measurements.

Please let me know what you think :)

Comments

Could it output drones for existing sims?

X-Plane Plane Maker: https://developer.x-plane.com/manuals/planemaker/

Juno: New Origins (and also Hello Engineer)

MS Flight Simulator cockpits are built with MSFS Avionics Framework which is React-based: https://docs.flightsimulator.com/html/Introduction/SDK_Overv...

https://news.ycombinator.com/item?id=37619564 :

[Multi-objective gym + MuJoCo] for drone simulation
Idea: Generate code like BlenderGPT to generate drone rover sim scenarios and environments like the Moon and Mars

https://news.ycombinator.com/item?id=36052833 :

awesome finite element analysis https://www.google.com/search?q=awesome+finite+element+analy...

Also: awesome-cfd

https://news.ycombinator.com/item?id=31049608 :

Numerical methods in fluid mechanics: https://en.wikipedia.org/wiki/Numerical_methods_in_fluid_mec...

Re: X-plane output. As it stands, no. But I believe a translation script can be made to output the vehicle's properties into a different format. Currently it is a python dataclass.

Thank you for linking to other resources. I will take a look at them.

Np. Interesting field.

"How to create an aircraft [for MS Flight Simulator]" https://docs.flightsimulator.com/html/mergedProjects/How_To_...

Gymnasium w/ MuJoCo or similar would probably be most worthwhile in terms of research,

GlTF: https://en.m.wikipedia.org/wiki/GlTF

/? gltf msfs https://www.google.com/search?q=gltf+msfs

https://github.com/AsoboStudio/glTF-Blender-IO-MSFS :

Microsoft Flight Simulator glTF 2.0 Importer and Exporter for Blender

MSFS docs on the Blender plugin: https://docs.flightsimulator.com/html/Asset_Creation/Blender...

There must be fluid simulation in MSFS and XPlane because they model helicopter flight characteristics.

I don't think either model things like solar thermal effect upon wings' material properties yet.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.