Waypoint API is not working for DJI SDK


#1

Hi, I am using DJI N3 controller + Raspberry Pi with FlytOS version 1.5-5b. running flytos with --dji argument. It works but gives below error if I try to set a waypoint, whether it is through restful API or web page.

is this normal, because original DJI SDK supports waypoints?

[ INFO] [1517918258.442620116]: Nav: Waypoint Set command received
[ERROR] [1517918258.443925512]: Nav: Waypoint Set API not supported for DJI


#2

Hi @matalar,

Yes. You are correct. DJI supports waypoints via its SDK.
We are currently in process of enabling it in our API as well.
For now I would request you to use position_set_global API.


#3

thanks, I will try it. one more question. If I don’t open RC and link between Aircontroller and RC, Flytos APIs doesn’t affect. When I open RC and see it is connected, it works.

But for original DJI SDK sending commands through UART port to N3 controller, it doesn’t need to open RC.

Do you know this issue and anyway to bypass it?


#4

For DJI, FlytOS APIs should work even if you dont have an RC configured/connected.

Can you please share the FlytOS runlog, whenever you face this issue. Moreover, what is the error response of APIs when called in absence of RC?


#5

please find logs below. I HAVE comments between logs on command line.

It shows logs for takeoff command and there is no error in logs. but doesn’t working without RC connected. I tried this with land command the rest is same, no error log, it gives success as return but doesn’t run if RC is not connected.

But if I try the same thing with tools written on dji sdk directly through the command line, it is working if RC is not connected.

root@flytos:~# BEFORE SWITCHING RC ON, IT IS NOT ARMED AND NOW SENDING TAKEOFF COMMAND

BEFORE: command not found
root@flytos:~#
root@flytos:~# --------------------------------------------------------------------------------
DEBUG in flask_views [/flyt/flytos/flytcore/lib/python2.7/dist-packages/rostful/flask_views.py:499]:
calling service /flytos/navigation/take_off with msg : {‘takeoff_alt’: 10}

[ INFO] [1518506060.909103653]: Nav: Takeoff command received. Height argument would be ignored by DJI
[ INFO] [1518506061.186336545]: Nav: Takeoff command accepted by DJI Autopilot
[ INFO] [1518506061.186998728]: Nav: Takeoff called by REST API, not waiting for takeoff to complete. Returning success=true even though vehicle has not reached provided takeoff height

DEBUG in flask_views [/flyt/flytos/flytcore/lib/python2.7/dist-packages/rostful/flask_views.py:499]:
calling service /flytos/param/param_get_all with msg : {‘get_only_ap’: True, ‘fresh_pull’: False}


INFO in server [/flyt/flytos/flytcore/lib/python2.7/dist-packages/rostful/server.py:261]:
http://localhost:8080/api_list_streams?namespace=flytos

root@flytos:~# NOT ARMED NOT TAKEOFF
NOT: command not found
root@flytos:~#
root@flytos:~#
root@flytos:~#
root@flytos:~# NOW RC IS ON AND CONNECTED, SENDING TAKEOFF COMMAND AGAIN
NOW: command not found
root@flytos:~# --------------------------------------------------------------------------------
DEBUG in flask_views [/flyt/flytos/flytcore/lib/python2.7/dist-packages/rostful/flask_views.py:499]:
calling service /flytos/navigation/take_off with msg : {‘takeoff_alt’: 10}

[ INFO] [1518506229.242980279]: Nav: Takeoff command received. Height argument would be ignored by DJI
[ INFO] [1518506229.267799711]: Nav: Takeoff command accepted by DJI Autopilot
[ INFO] [1518506229.268463769]: Nav: Takeoff called by REST API, not waiting for takeoff to complete. Returning success=true even though vehicle has not reached provided takeoff height
[ INFO] [1518506239.640784772]: Nav: Position Hold command received
[ERROR] [1518506239.641284196]: Nav: Position Hold service failed as Vehicle Position not available, wait for GPS lock or other position sensors to initialize

root@flytos:~#
root@flytos:~# IT IS ARMED AND TAKEOFF NOW
IT: command not found
root@flytos:~#


#6

Hi,

Which version of DJI SDK are you using?
FlytOS currently has DJI SDK v3.3, and may be you are using its latest v3.6.

According to the logs, DJI is communicating to FlytOS that it has received TakeOff request successfully.
I would appreciate it if you could try sending commands using DJI SDK v3.3. It would help me a lot figuring the bug.

Moreover, I have built a new version of FlytOS based on DJI SDK v3.6. I would request you to give this a try too.

  1. Download this debian package to RPi.
  2. open a terminal window and run this command: sudo dpkg --purge flytcore-pe
  3. in terminal, go to directory where you downloaded debian package, and install it via: sudo dpkg -i flytosv1.5-6rc1bdji_3.deb

#7

Hi,

Yes you are right, I am using dji sdk 3.6.

I updated the flytos to 1.56 which you gave the link. Tested and result is same. You can see the logs below.

two notes more, to help you:

  1. I am using dji assistant simulator to check if it is armed or not
  2. I remember that was mentioned if RC is not connected API is not working for DJI N3 and Lighbridge2. But the strange thing; it is working if I use the dji sdk directly on command line. So I beleive flytOS may bypass that rule.

If it would be helpful I may try to downgrade to dji sdk 3.3 and try with that version?

root@flytos:~/dji#
root@flytos:~/dji# BEFOR RC IS ON, SENDING TAKEOFF COMMAND
BEFOR: command not found
root@flytos:~/dji# --------------------------------------------------------------------------------
DEBUG in flask_views [/flyt/flytos/flytcore/lib/python2.7/dist-packages/rostful/flask_views.py:499]:
calling service /flytos/navigation/take_off with msg : {‘takeoff_alt’: 10}

[ INFO] [1518526324.764258617]: Nav: Takeoff command received. Height argument would be ignored by DJI
[ INFO] [1518526324.857028692]: Nav: Takeoff command accepted by DJI Autopilot
[ INFO] [1518526324.857432856]: Nav: Takeoff called by REST API, not waiting for takeoff to complete. Returning success=true even though vehicle has not reached provided takeoff height

root@flytos:~/dji#
root@flytos:~/dji#
root@flytos:~/dji#
root@flytos:~/dji#
root@flytos:~/dji# NOT ARMED AND TAKEOFF
NOT: command not found
root@flytos:~/dji#
root@flytos:~/dji#
root@flytos:~/dji#
root@flytos:~/dji# NOW RC I SON AND SENDING TAKEOFF AGAIN
NOW: command not found
root@flytos:~/dji#
root@flytos:~/dji#
root@flytos:~/dji#
root@flytos:~/dji# --------------------------------------------------------------------------------
DEBUG in flask_views [/flyt/flytos/flytcore/lib/python2.7/dist-packages/rostful/flask_views.py:499]:
calling service /flytos/navigation/take_off with msg : {‘takeoff_alt’: 10}

[ INFO] [1518526432.866363217]: Nav: Takeoff command received. Height argument would be ignored by DJI
[ INFO] [1518526432.878787253]: Nav: Takeoff command accepted by DJI Autopilot
[ INFO] [1518526432.879989225]: Nav: Takeoff called by REST API, not waiting for takeoff to complete. Returning success=true even though vehicle has not reached provided takeoff height
[ INFO] [1518526443.250015436]: Nav: Position Hold command received
[ERROR] [1518526443.250229550]: Nav: Position Hold service failed as Vehicle Position not available, wait for GPS lock or other position sensors to initialize

root@flytos:~/dji#
root@flytos:~/dji# ARMED AND IT IS WORKING NOW
ARMED: command not found
root@flytos:~/dji#


#8

What do you mean by this? Is it working now?

The below steps assume you are using v3.6.
Also, can you please also demonstrate the API you call/use while using DJI SDK. Are you using their DJI SDK ROS or Linux DJI SDK?
Can you try using their ROS SDK, and check if it works without RC?

Unfortunately, I did not get time to have a similar setup, and I won’t be able to do it tomorrow to. I would definitely try to replicate it on 15th.

Thanks for your patience.


#9

no, it is not working.

I am using Linux DJI SDK

I don’t have a ROS environment, will check this if it runs on raspberry pi.

This issue is not so urgent but it would be nice if I know there is a solution.

thanks for your support.


#10

If you have FlytOS running, then you have ROS environment.
Anyway I would give this a try today to replicate it and resolve the issue.


#11

Hello @matalar,

Were you able to get this issue resolved?
I would also request you to open DJI Assistant, go to SDK settings tab and set ‘SDK Failsafe Action’ to ‘Hover’.

This might resolve your issue.


#12

Hi @srv-admin

unfortunately it is not solved. SDK Failsafe Action is already in Hover mode but SDK Failsafe Action option is disabled and I can’t enable it to uncheck and recheck. Trying to solve it first and will inform you.

thanks


#13

We released FlytOS today (version: v1.5-6).
This new version has support for DJI waypoints. The API definition is available in api.flytbase.com


#14

Hi,

I tried 1.5-6 firmware that’s ok, thanks to all team for that.

Also I solved the problem about RC. It is not related to SDK Failsafe but related to RC Failsafe. It was in RTL mode for RC Failsafe, thus not arming with SDK command, when I set RC Failsafe to Hover mode, i could command through SDK even RC is switched off.

thanks for your support.


#15