OnBoard API doesn't give feedback after moving drone

#1

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.

image

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:

image

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?

#2

That project is not maintained anymore. The internal API schema may have changes over the time, resulting in the problems that your are facing.

You can use https://github.com/flytbase/xbuild_demo project. It has a sample code file. Please follow the instructions provided in the readme file. In case you need more APIs than what is available in api_library.py files then you can raise an issue in that git repository.

Thanks.

#3

@Dhirajd does that mean that we can’t do on-board development any more?

I was hoping to access & steer the drone via my Python code on a Raspberry PI device, over flyt-python. We don’t have 4G connectivity everywhere, so we’d like to bypass the cloud platform.

Since the project is not maintained any longer, is that not possible?

#4

You can do on-board deployment. If you had been using ROS (rospy) then the APIs are available directly.

For your convenience I have modified above repository and added a sample script for onboard (local network, strictly speaking) API access. Please modify the URL with correct IP and port (of your docker instance) as necessary.

With this you should not need 4g connection.

#5

Thanks for your time, @Dhirajd . I will check the solution over ROS.