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.

#6

Hello,

I’m using Ubuntu 16.04. I have installed flytSim Native version. I’m trying to run the sample script that you published on https://github.com/flytbase/xbuild_demo. I have changed the API_KEY and VEH_ID for my virtual drone. I’ve also changed the URL to “http://127.0.0.1/” which is localhost.

What I’m doing is;

  • Launching the flytSim by simply running the command launch_flytSim

  • Running the sample python code

The results I get after I run the code:

Even though I can see that there is a connection, I always get request failed error.
I might have done something wrong. Could you explain what I should do?

Thanks in advance.

#7

Can you please upload your flytos runlogs? You can find more info on runlogs here http://docs.flytbase.com/docs/FlytOS/Debugging/GettingHelpForum.html#forum-help-troubleshooting

#8

Here it is;
flyt_runlogs.log (81.1 KB)

#9

@furkankara Looking at the logs, the problem is due to absence of a license. You can go through the sample steps for license activation on this page. Please know that these instructions are for raspberry-pi, you can view instructions for appropriate SBC on the same page.