microsoft / AirSim-NeurIPS2019-Drone-Racing

Drone Racing @ NeurIPS 2019, built on Microsoft AirSim
https://microsoft.github.io/AirSim-NeurIPS2019-Drone-Racing/
MIT License
356 stars 89 forks source link

Problem with simStartRace() and enableApiControl('drone_2') in the new binary #71

Closed yannbouteiller closed 5 years ago

yannbouteiller commented 5 years ago

Hello,

I am encountering a huge problem with the new airsimneurips binary. It seems that it has been modified so only drone_1 can be controlled while drone_2 does its stuff.

This is fine for evaluating against the reference algorithm I guess, but this is a disqualifying issue for me because I need to be able to control both drones to apply my Reinforcement Learning strategies during training, and I need the simulator and race to reset and run as fast as possible (it seems that the taking off of drone_2 adds a huge time overhead before I can control drone_1).

How can I disable the baseline controller of drone_2 and use my own controllers for both drones again, please?

At the moment, not only calling enableApiControl('drone_2') makes subsequent call to simStartRace() block the program, but drone_2 will want to do its stuff anyway.

Regards, Yann.

madratman commented 5 years ago

Hey. Here's what you can do to disable drone_2 from flying around the scene and take control over it:

This returns the following in my machine, for example: /usr/local/lib/python3.6/dist-packages/airsimneurips

I guess I'll add a note to the readme for people who want to disable it. Technically, we can add a bool param to simstartrace to disable drone_2 in the pythonclient itself, but I am refraining from doing so, as in the qualification binaries, we want people to call simstartrace and that should trigger competitor / drone_2 / MSR racer to do its thing

madratman commented 5 years ago

Hmm, you're correct in that drone_2 is blocking everything while it's taking off. We'll look into it: This is happening coz of the line competitor.fly_through_all_gates_at_once_with_moveOnSpline(), which is called with a .join() in baseline.py. Maybe we should use another thread for controlling drone_2

yannbouteiller commented 5 years ago

The manual fix for controlling drone_2 seems to be working, thanks @madratman :)

madratman commented 5 years ago

Awesome! Closing then

madratman commented 4 years ago

Fixed the blocking call to takeoff for drone_2 in pythonclient. Please pip install --upgrade airsimeneurips to 1.0.0