We are trying to work on the onboard API using Python 3.6. I am using MacOS Mojave 10.14.6.
Following the guidance on https://pypi.org/project/flyt-python/ ;
• I have installed flyt-python
• I have installed redis
• I have installed Docker
• Got my vehicle ID & personel access token
• Started daemon.py
After that; I executed the demo app 1 via Python 3.6.
from flyt_python.flyt_python import DroneApiConnector
token = '(hidden)'
vehicle_id = '(hidden)'
drone = DroneApiConnector(token, vehicle_id, ip_address='localhost', wait_for_drone_response=True)
drone.connect()
#drone.takeoff(5)
drone.set_params()
print("pos change")
drone.set_local_position(x=5, y=0, z=0, body_frame=True)
print("pos change")
drone.set_local_position(x=0, y=5, z=0, body_frame=True)
print("pos change")
drone.set_local_position(x=0, y=0, z=5, body_frame=True)
print("pos change")
drone.set_local_position(x=0, y=-5, z=0, body_frame=True)
print("land")
drone.land()
print("disconnect")
drone.disconnect()
Basically, I’m aiming at “set_local_position”.
When I run the Python program, the web based local application says that the vehicle has successfully moved. This means that the first set_local_position was executed correctly.
However; the Python application gets stuck and doesn’t move to the next set_local_position command.
(...)
print("pos change")
drone.set_local_position(x=5, y=0, z=0, body_frame=True) ## STUCK!
print("pos change")
drone.set_local_position(x=0, y=5, z=0, body_frame=True)
print("pos change")
drone.set_local_position(x=0, y=0, z=5, body_frame=True)
print("pos change")
drone.set_local_position(x=0, y=-5, z=0, body_frame=True)
(...)
Here is the corresponding Docker terminal window:
The way I see it; the messages flow from Python to the simulator without any problems. However; for some reason, the message from the simulator to Python doesn’t seem to flow.
Can someone help? Any idea why this happens, and how can we solve this?