microsoft / DroneRescue

This sample demonstrates how to bring AI to edge devices, by using AirSim to generate synthetic training data for a Custom Vision model and then how to deploy the model to edge devices.
MIT License
66 stars 25 forks source link

Fix home position stability check on drone_orbit.py #13

Open laurelkeys opened 4 years ago

laurelkeys commented 4 years ago

By assigning pos = self.home, both variables are pointing to the same address (which we can see by printing their id or verifying that pos is self.home is always True).

Thus, the if statement on line 64 always goes to the else branch:

https://github.com/microsoft/DroneRescue/blob/53d0cc98829e33f421f33f5f7d7e943a9877fb4c/resources/drone_orbit.py#L63-L64

Also, we can avoid making another API call to the client when assigning self.center on line 74, since once we've reached this line we already know that the values of pos and self.home are stable.