utiasDSL / gym-pybullet-drones

PyBullet Gymnasium environments for single and multi-agent reinforcement learning of quadcopter control
https://utiasDSL.github.io/gym-pybullet-drones/
MIT License
1.21k stars 351 forks source link

Sim2real transfer for betaflight #218

Open saghavart opened 4 months ago

saghavart commented 4 months ago

Hi. I am planning to use your framework for my Reinforcement Learning task. I saw that there is Betaflight support. My question is how can I achieve sim2real transfer for betaflight. Shall I write a new flight mode and build the new firmware? And also betaflight is using his own controller, so how is my RL code integrated on top of it? Are ther any succesful examples?

JacopoPan commented 4 months ago

The instructions to run the example using Betaflight (in simulation) are detailed here. It leverages the SITL version of BF to compute motor controls from CTBR commands.

The simulation environment in gym_pybullet_drones/envs/BetaAviary.py has a CTBR action space so, if you train an RL policy on it, it should output actions already compatible with BF. However, for sim2real transfer you also need to know the state of the system/drone. Are you going to use a MoCap system?

saghavart commented 4 months ago

Thank you for answer. No, I want to deploy it outdoors. The only state I need are IMU,barometer and output from camera