uzh-rpg / flightmare

An Open Flexible Quadrotor Simulator
https://uzh-rpg.github.io/flightmare/
Other
965 stars 340 forks source link

Motor Failure #124

Open semihtasbas opened 3 years ago

semihtasbas commented 3 years ago

Hi,

In the paper, you mentioned about quadrotor control under motor failure, do you have a script about this. How can I implement it in run_drone_control.py ?

Thank you.

yun-long commented 3 years ago

hi, you should modify the quadrotor_env.hpp & quadrotor_env.cpp

1), in
https://github.com/uzh-rpg/flightmare/blob/master/flightlib/include/flightlib/envs/quadrotor_env/quadrotor_env.hpp

 // control actions
  kAct = 0,
  kNAct = 3,

2) in https://github.com/uzh-rpg/flightmare/blob/master/flightlib/src/envs/quadrotor_env/quadrotor_env.cpp#L96-L98

  quad_act_ = act.cwiseProduct(act_std_) + act_mean_;
  cmd_.t += sim_dt_;
  cmd_.thrusts.segment<3>(0) = quad_act_; // the dimension of quad_act is 3.
cmd_.thrusts(3) = 0.0; // disable fourth rotor

3)

cd flightamre/flightlib/
pip install

and you can retrain the policy