Package: dropy
dropyScaled down version of Microsoft's AirSim (drone only). Ideal for developers looking to control the drone via keyboard. 'dropy' is a utility package to control the simulator (developed in Unity) by writing minimal code, essentially useful for training of NNs and ideally suited for RL agents.New to dropy 0.1.0Added multiplayer support to work with more than 1 flight objectImproved Camera StabilityInstallationFor the package to work, please download folder containing the simulator from the the drive link provided in the badge above.pip install dropyRequires Python 3.6+Currently supported only on Win32 (MS Windows) environmentUsageBefore using any functionalities of the package, make sure that the simulator (one or multiple instances) is (are) running. Key bindings for the multiplayer simulator is provided in the link itself.fromdropyimportFlightflight=Flight(location='simulator')flight.turn_left(180)print('Current Global Coordinates : ',flight.coords_xyz())print('Current Global Angles : ',flight.angles_xyz())The 'location' parameter specifies the directory of the simulator. In the above, it's in the folder 'simulator' under the same working directory.turn_left(n)-> 'n' specifies the number of degrees to turnMultiplayerfromdropyimportFlightflight1=Flight(location='multiplayer_drone_simulator')# regarded as the host flight objectflight2=Flight(location='multiplayer_drone_simulator')# new flight-2 spawnedflight3=Flight(location='multiplayer_drone_simulator')# new flight-3 spawnedflight4=Flight(location='multiplayer_drone_simulator')# new flight=4 spawnedflight1.turn_left(7)# host turns 7 * 5 degrees to the leftflight2.turn_right(7)# flight-2 turns 7 * 5 degrees to the rightflight3.forward(7)# flight-3 goes forward by 7 distance unitsflight4.up(7)# flight-4 thrusts up by 7 distance unitsprint(flight1.angles_xyz())# returns euler angles of the hostprint(flight2.angles_xyz())# returns euler angles of flight-2print(flight3.angles_xyz())# returns euler angles of flight-3print(flight4.angles_xyz())# returns euler angles of flight-4flight1.tpp_shot().save('test1.jpg')# saves screenshot of tpp-mode of the hostflight2.tpp_shot().save('test2.jpg')# saves screenshot of tpp-mode of flight-2flight3.tpp_shot().save('test3.jpg')# saves screenshot of tpp-mode of flight-3flight4.tpp_shot().save('test4.jpg')# saves screenshot of tpp-mode of flight-4flight2.kill()# flight-2 terminated from simulator and closedflight3.kill()# flight-3 terminated from simulator and closedflight4.kill()# flight-4 terminated from simulator and closedflight1.kill()# Host terminated from simulator and closedHost must not be killed at first, or should never be killed. Killing of the host causes all the other flight objects to be terminated. You might as well choose to never control the host object, but it does take up some resources.HACK : Resize the host window to very small. Doesn't take up much resources then.ExamplesControlsfromdropyimportFlightflight=Flight(location='simulator')# location defines the directory where the simulator is, in the workstationflight.turn_left(7)# turns 7 * 5 degrees to the leftflight.turn_right(7)# turns 7 * 5 degrees to the rightflight.up(10)# thrusts up by 10 distance unitsflight.down(10)# drops down by 10 distance unitsflight.forward(10)# moves forward by 10 distance unitsflight.backward(10)# moves backward by 10 distance unitsflight.swerve_left(10)# swerves 10 units to the leftflight.swerve_right(10)# swerves 10 units to the rightUtilitiesfromdropyimportFlightflight=Flight(location='simulator')# location defines the directory where the simulator is, in the workstationcoords=flight.coords_xyz()# returns current global position of the agentangles=flight.angles_xyz()# returns current global euler angles of the agentflight.top_view()# activates the top-down view of the simulatorflight.fpp_view()# activates the FPP view of the simulatorflight.tpp_view()# activates the TPP view of the simulatorfpp_view=flight.fpp_shot()# returns ImageGrab of FPP camera of the simulatortop_view=flight.top_shot()# returns ImageGrab of top-down view of the simulatortpp_view=flight.tpp_shot()# returns ImageGrab of TPP camera (Main Camera) of the simulatorflight.goto(500,500)# flight travels from current global position to given global coordinates(500, 500)flight.kill()# terminates flight object from the simulator, and closes that instanceContributionsEvery contribution will be welcome.Please feel free to raise issues on GitHub or pull requests for ideas, features and add-ons.The vision is to create better environments in a Pythonic way, for small scale development projects.