dji-sdk / onboard-sdk Goto Github PK
View Code? Open in Web Editor NEWDJI Onboard SDK Official Repository
Home Page: https://github.com/dji-sdk/Onboard-SDK
License: Other
DJI Onboard SDK Official Repository
Home Page: https://github.com/dji-sdk/Onboard-SDK
License: Other
Official updates will be handled by DJI SDK staff. If an issue/bug is found in our documents, developers are welcome to correct the error and submit a pull request.
Developers must alert the DJI SDK staff of a pull request through a related discussion, such as on forum.dji.com, bbs.dji.com, gitbuh issues or email record. If the pull request is valid, the SDK staff will acknowledge the issue being fixed and accept the pull request.
Pull requests that do not follow this guild will not be accepted.
This section covers document formatting and syntax. You can refer to Github's Mastering Markdown Guides for additional reference.
#
We structure markdown documents through the use of #
symbol to create headers. Multiple #
symbols in a row will format smaller headers. Here is a suggested usage example:
Code
# Document Title
## Main Heading 1
### 1. Subheading 1
## Main Heading 2
### 1. Subheading 1
### 2. Subheading 2
Result
Document Title
Main Heading 1
1. Subheading 1
Main Heading 2
1. Subheading 1
2. Subheading 2
It is important that you follow the example shown above, with a single '#' being used for the document title, '##' being used for section headings, and '###' being used for subheadings. This allows us to generate and organize reading interfaces based on these headings.
Please do not adjust the number of '#' symbols used for the aesthetic purpose of adjusting the side of headings, as shown here:
Code
# Document Title
## Main Heading 1
### 1. Subheading 1
## Main Heading 2
### 1. Subheading 1
### 2. Subheading 2
Result
Document Title
Main Heading 1
1. Subheading 1
Main Heading 2
1. Subheading 1
2. Subheading 2
Markdown allows you to create tables, separating the header with the first row with hyphens '-', and separating each column with a pipe symbol '|'.
Here's an example:
Code
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Result
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
You can also choose to align cell contents:
Code
| Left Aligned | Center Aligned | Right Aligned |
|:-------------|:----------------:| -------------:|
| Left | Center | Right |
| Left Aligned | Center Aligned | Right Aligned |
Result
Left Aligned | Center Aligned | Right Aligned |
---|---|---|
Left | Center | Right |
Left Aligned | Center Aligned | Right Aligned |
We control text alignment through the colons ':'. The left and right most pipes |
are purely aesthetic, and can be omitted. Blank spaces serve no functional purpose besides code readability.
All images should be stored in the Images
folder. Images should be refered to by their relative path name, rather than an absolute path name.
For example, you should use ![N1UI](Images/N1UI.png)
instead of ![N1UI](https://github.com/dji-sdk/Onboard-SDK/blob/master/Onboard_API_Doc/en/Images/N1UI.png)
Inline code blocks should be wrapped in backticks:
Code
'var example = true'
Result
var example = true
To insert multiple lines of code, used a Fenced Code Block. Surround code with three tildes '~' to format it:
Code
~~~
void get_control_callback(const void* p_data, unsigned int n_size) { }
~~~
Result
void get_control_callback(const void* p_data, unsigned int n_size) { }
Including the name of the language after the opening triple tilde will allow for syntax highlighting:
Code
~~~c
void get_control_callback(const void* p_data, unsigned int n_size) { }
~~~
Result
void get_control_callback(const void* p_data, unsigned int n_size) { }
I recently purchased the D-RTK and Datalink Pro for high-accuracy GPS location of my M600, but after completing the setup as described in the manuals, I can't pull data through the Onboard SDK and the antennae don't appear in DJI Assistant 2 for the M600. It's just one Ground System and one Air System, in full duplex mode. When set up in the field, both Ground System and Air System have green lights on the D-RTK's and Datalink Pros. But I can't set antennae offsets, and I am recording zeros for the RTK Latitude and Longitude. Please advise!
Just wondering if there is any way to send some audio commands like simple beeps to remote control. This would be very good to have an API.
Thanks.
Hi,
not sure if this is the correct place for this question but I was under the impression that the port covered by yellow tape marked as "reserved for future use" is an AV input port for a second camera. Can this be used as a FPV camera port and if so how do I can access. If now what is the best method for adding a FPV camera to the Matrice. I have the X3 and plugged into the N1 Flight Controller and a second camera via a second transmitter to a second screen but this consumes valuable power and is messy to use as it requires a second screen connected to a ground station that is quite annoying. Any assistance would be greatly appreciated.
Best Regards,
Ian Hamer
Should we try to get rid of all compilation warnings? This should be mostly done by fixing code and in rare cases by adding a compiler flag to ignore a specific warning.
And then to prevent new warnings from being introduced, should we add -Wall and -Werror compiler flags?
Here are an example of a warning that should be fixed in code:
[-Wunused-variable]:
Onboard-SDK/osdk-wrapper/src/ReadUserConfig.cpp:46:7: warning: unused variable ‘id’ [-Wunused-variable]
and [-Wreturn-type]:
Onboard-SDK/sample/Linux/Non-Blocking/../../../platform/linux/inc/LinuxSerialDevice.h:55:71: warning: no return statement in function returning non-void [-Wreturn-type]
int serialRead(unsigned char *buf, int len) {_serialRead(buf,len);}
Hi,
According to DJI support the battery level value is not supported on the A3 and will always return zero. I've verified this on my A3 with S900 frame and non-intelligent battery.
Would it be possible to include this in a future version? In fact, what I'd really like would be the actual voltage value from the battery (as shown in the DJI Assistant).
In file
Onboard-SDK/sample/commandline/Linux/conboardSDK/conboardsdktask.h
missing
using namespace DJI;
DJICommontype.h
namespace DJI
{
typedef uint64_t time_ms;
typedef uint64_t time_us; // about 0.3 million years
typedef void *UserData;
UserData is in DJI namespace, not DJI::onboardAPI space, compiler report UserData not found.
In "Monitor Command Set: 0x02" > "Command ID 0x00 Message Package":
The type of item magnetometer is float32
. See
Chinese Version: https://github.com/dji-sdk/onboard/blob/master/Onboard_API_Doc/Onboard_API_%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3.md#命令码-0x00-标准数据包
English Version: https://github.com/dji-sdk/onboard/blob/master/Onboard_API_Doc/Onboard_API_introduction.md#command-id-0x00-message-package
But in DJI_Onboard_API_ROS_Sample, the sdk_3_6B_data_t
is using int16_t
https://github.com/dji-sdk/onboard/blob/master/Onboard_SDK_Sample/DJI_Onboard_API_ROS_Sample/dji_sdk/src/sdk_lib/DJI_Pro_App.h#L124
We implement an application on an OES device using OnboardSDK.
It receives some data from an android device running MobileSdk through Data Transparent transmission.
With A3 fw version 1.3.0.00 the OES receives the data correctly.
When changing to A3 fw version 1.6.0.10 with the same code the data is received to OES, but it can't be recognized.
The header of the DTT packet is the same, but the payload is nothing usable.
Here is an example of 3 bytes data packet received from MobileSDK:
A3 1.3.0.00:
aa 15 00 00 00 00 00 00 20 00 11 de 02 02 01 01 00 81 30 1f 5b
A3 fw 1.6.0.10:
aa 16 00 00 00 00 00 00 b6 81 aa ee 02 02 20 73 44 20 af aa 9a b7
Could it be that the data is transmitted encrypted on the new fw 1.6.0.10?
Note:
While changing code to work on fw 1.6 we updated to the newest OnboardSDK 3.2 and MobileSDK for Android 3.5.
The A3 with fw version 1.3 receives the data correctly.
When using A3 1.3.0.00 the activation of OnboardSDK is requested with
"versionA3_31 = (MAKE_VERSION(3, 1, 100, 0));" (successfully),
while when using A3 1.6.0.10 the activation of OnboardSDK is requested with:
"versionA3_32 = (MAKE_VERSION(3, 2, 100, 0));" (also successfully).
When I run the PureQT sample, it crashed.
My environment:
OS: Window 7 64bit
QT: 5.5
Compiler: mingw492 32bit
Stack information:
Thread#1
1 ntdll!RtlpNtEnumerateSubKey 0x77bc152d
2 ntdll!RtlUlonglongByteSwap 0x77b83166
3 ?? 0x33a47810
4 ntdll!RtlpNtEnumerateSubKey 0x77bc2587
5 ntdll!RtlUlonglongByteSwap 0x77b7b2a2
6 ?? 0x2ff80000
7 ntdll!RtlQueryPerformanceCounter 0x77b22ce5
8 msvcrt!free 0x756a98cd
9 ?? 0x2ff80000
10 QIODevicePrivateLinearBuffer::makeSpace qiodevice_p.h 176 0x6458a0d8
11 QIODevicePrivateLinearBuffer::reserve qiodevice_p.h 116 0x64589fee
12 QSerialPortPrivate::completeAsyncRead qserialport_win.cpp 418 0x64584f9d
13 QSerialPortPrivate::_q_notified qserialport_win.cpp 540 0x645855ef
14 QSerialPort::qt_static_metacall moc_qserialport.cpp 357 0x64583114
15 QMetaObject::activate qobject.cpp 3713 0x6b907249
16 QMetaObject::activate qobject.cpp 3578 0x6b906b8e
17 QWinOverlappedIoNotifier::notified moc_qwinoverlappedionotifier_p.cpp 149 0x6b8ae98b
18 QWinOverlappedIoNotifierPrivate::_q_notified qwinoverlappedionotifier.cpp 363 0x6b8ae705
19 QWinOverlappedIoNotifier::qt_static_metacall moc_qwinoverlappedionotifier_p.cpp 87 0x6b8ae79a
20 QMetaCallEvent::placeMetaCall qobject.cpp 486 0x6b9008b4
21 QObject::event qobject.cpp 1239 0x6b901619
22 QApplicationPrivate::notify_helper qapplication.cpp 3716 0xc0bf34d
23 QApplication::notify qapplication.cpp 3160 0xc0bcd03
24 QCoreApplication::notifyInternal qcoreapplication.cpp 965 0x6b8ded92
25 QCoreApplication::sendEvent qcoreapplication.h 224 0x6b9d73e7
26 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1593 0x6b8dff2a
27 QEventDispatcherWin32::sendPostedEvents qeventdispatcher_win.cpp 1241 0x6b92ed28
28 QWindowsGuiEventDispatcher::sendPostedEvents qwindowsguieventdispatcher.cpp 83 0x3205eca5
29 qt_internal_proc(HWND__ *, unsigned int, unsigned int, long) *16 qeventdispatcher_win.cpp 414 0x6b92c033
30 gapfnScSendMessage 0x757c62fa
31 ?? 0x5406b0
32 USER32!GetThreadDesktop 0x757c6d3a
33 <lambda()>::operator()(void) const qeventdispatcher_win.cpp 355 0x6b92bd2f
34 ?? 0x5406b0
35 USER32!CharPrevW 0x757c77d3
36 USER32!DispatchMessageW 0x757c789a
37 QEventDispatcherWin32::processEvents qeventdispatcher_win.cpp 817 0x6b92d611
38 QWindowsGuiEventDispatcher::processEvents qwindowsguieventdispatcher.cpp 74 0x3205eb81
39 QEventLoop::processEvents qeventloop.cpp 128 0x6b8dcc68
40 QEventLoop::exec qeventloop.cpp 204 0x6b8dcefb
41 QCoreApplication::exec qcoreapplication.cpp 1229 0x6b8df3d5
42 QGuiApplication::exec qguiapplication.cpp 1527 0x9781b2
43 QApplication::exec qapplication.cpp 2976 0xc0bc7c3
44 qMain main.cpp 13 0x40166b
45 WinMain *16 qtmain_win.cpp 113 0x41b9a0
46 main 0x45e05d
Thread#2
1 ntdll!ZwDelayExecution 0x77b0fe31
2 ntdll!ZwDelayExecution 0x77b0fe31
3 SleepEx 0x775a3d3d
4 ??
Thread#3
1 QHardDriver::readall QonboardSDK.cpp 80 0x40b86d
2 DJI::onboardSDK::CoreAPI::readPoll DJI_Link.cpp 184 0x41075a
3 APIThread::run QonboardSDK.cpp 126 0x40bb00
4 QThreadPrivate::start(void *) *4 qthread_win.cpp 367 0x6b799da8
5 msvcrt!_itow_s 0x756b1287
6 msvcrt!_endthreadex 0x756b1328
7 KERNEL32!BaseThreadInitThunk 0x7551338a
8 ntdll!RtlInitializeExceptionChain 0x77b29a02
9 ntdll!RtlInitializeExceptionChain 0x77b299d5
10 ??
Thread#10
1 ntdll!ZwRemoveIoCompletion 0x77b0f9f9
2 ntdll!ZwRemoveIoCompletion 0x77b0f9f9
3 KERNELBASE!GetQueuedCompletionStatus 0x77597705
4 QWinIoCompletionPort::run qwinoverlappedionotifier.cpp 195 0x6b9e466c
5 QThreadPrivate::start(void *) *4 qthread_win.cpp 367 0x6b799da8
6 msvcrt!_itow_s 0x756b1287
7 msvcrt!_endthreadex 0x756b1328
8 KERNEL32!BaseThreadInitThunk 0x7551338a
9 ntdll!RtlInitializeExceptionChain 0x77b29a02
10 ntdll!RtlInitializeExceptionChain 0x77b299d5
11 ??
Other threads are similar to thread#2, just some simple calls.
Is this similar to the problem on MSVC-64bit? A bug in QSerialPort?
Hi, I have an onboard computer equipped with a camera that is performing a Position/Orientation estimation. My goal is to have the most accurate information of the attitude of the drone, so I'm fusing the camera estimation with the IMU and GPS informations given by the drone. This gives me a quite good estimation, but this information remains in the onboard computer for now...
Is there a way to provide this estimation to the matrice100 to help him determining his horizontal speed? Because this is the way I control the drone, I need this speed to be as accurate as possible!
I can also control the drone in position if this is possible to give the position informations to the drone!
Note that I'm talking about a matrice100 without Guidance. The communication with the drone is over serial.
Looking though the code it seems like the struct read from the DJI autopilot returns RCData
struct which only contains the roll, pitch, yaw, throttle, mode and gear signals. There is another struct VirtualRCData
which contains all channels but it does not seem to be used anywhere. How can I read all the channels from the remote control. Apparently this is possible according to this https://www.youtube.com/watch?v=_9VR9IQP7QM
I just cloned the Onboard-SDK to a Raspberry Pi with the latest Raspbian Jessie. I got these errors when I run the build script:
./scripts/build —-build-type Debug -—clean true --lidar-logging OFF
...
cat: /etc/lsb-release: No such file or directory
CMake Error at osdk-wrapper/CMakeLists.txt:71 (if):
...
cat: /etc/lsb-release: No such file or directory
CMake Error at sample/Linux/Blocking/CMakeLists.txt:70 (if):
The file /etc/lsb-release in fact does not exit. But /etc/os-release does exist.
What would be the right fix?
It is unclear to me what the status of N3 support is for the OSDK v.3.2.0. On their website DJI says that the N3 is compatible with the MSDK and OSDK, however there is no version constant in DJI_Version.h for the N3 and it does not seem to be mentioned in the release notes. In my testing I've been using versionA3_32
and am able to activate, however I am running into some issues. Is the N3 a supported OSDK platform?
Is there anyway to access information in DJI simulator? The DJI simulator is very limited (no environment, collisons, sensors etc) so we want to try out Gazebo or something like that. All we currently need is ability to get position and orientation that is in DJI Simulator. This we can then feed in to Gazeebo so that we use hardware-in-loop part. So if any of below things are possible, we can possibly make it work:
I won't mind trying out out something experimental/beta so we can keep going :)
Hi
Could we use your source code to control the phantom 2?
Thanks a lot.
Since more and more developers will use this onboard SDK, it is necessary for us to maintain few versions of standard ROM which could help user use onboard SDK easily just like what PX4 did. And hardware standard can avoid some possible accident happens.
We could provide full support with compiled Onboard SDK codes in these ROMs and also compile environment.
I think at least we need two types of ROM which is support by community.One is low cost like Raspberry Pi, another one should have better compute ability like Jetson TK1.At the same time,we may provide docker container for PC.
As for ROM the rom we support, it should compile with full support drivers that may use on UAV, like WiFi ,USB-serial, bluetooth and so on.It should come up with ROS support and full support of Onboard SDK , maybe a one step SDK update script also should be include.And there is lot of details to discuss.
when compiling the SDK, the link error show as the title
Hello,
I'm working with Mobile Onboard SDK communication using Data Transparent Transmission, to send a data frames from Mobile Device to an Onboard Embedded System through A3 with Lb2. My issue is that my data frames (6 bytes the size of data frame) are not received in order (I've created a sequence number in my data frame that is incremented on mobile device when sending the message). I've checked the protocol frame, and the frame sequence number from header it is received correctly. Can you check please if the the issue is on Mobile SDK or on Onboard SDK.
Thank you
What's the <BroadcastData.CtrlInfoData.mode >indicate in the Onboard SDK? I can not find out any information from the docs...
And my real question is:
I'm seeking the < Flight Mode > in the iOS SDK which is sent from Onboard SDK. I need this mode/status to do some stratage . I need to get this information on the Onboard side ! But I can not find out the approach to get it.
I can only get the <BroadcastData .CtrlInfoData.mode> in the Onboard SDK. It seems that this mode indicates the flight mode which is described in the iOS SDK...
And this is the definition of the Flight Mode:
Flight Mode Definition in iOS SDK
Waiting for you response.
Thank you.
看源码它是跟在script->addTask("addTask");后面的,我想让飞机自动获取控制权限,就把script->addTask("addTask");改成了script->addTask("ctCA",(UserName)1);,然而这样做了之后就会报错“段错误,核心已转储”。
请教一下想实现飞机的自动获取控制权限与自动起飞应该怎么写呢?
如题
I was looking in the SDK code and FlighData documentation. It appears that linear velocity is in ground frame and is derived from GPS. Is this correct understanding? I'm looking for getting fused velocity data indoor from IMU. Currently FlightData documentation doesn't seem to have anyway to get this. Is it possible to get velocity from onboard IMU for indoor purposes?
Another quick question: Does quaternion elements q0, q1, q2, q3, q4 correspond to w, x, y, z respectively?
After modifying "User_Config.h" file.
I open up a terminal inside the "sample/commandline/Linux" directory and type "make" at the command prompt.
An error occured with error information "../../../lib/src/DJI_App.cpp:95:25: error: ‘dataflag’ was not declared in this scope
passData(*enableFlag, dataflag, &broadcastData.gimbal, pdata,".
I am wondering why the error came. And how to solve this problem? Thanks!
M100的控制模式采用(VERT_POS,HORI_POS,YAW_ANG)设置。这种控制方式的有效的前提是GPS信号稳定?我需要在室内进行M100的控制,加装guidance后,是否能采用上述控制模式在室内控制飞机?
I'm following the instructions here:
https://developer.dji.com/onboard-sdk/documentation/github-platform-docs/Linux/README.html
I ran the script using this command:
./scripts/build —-build-type Debug -—clean true --lidar-logging OFF
But I get segmentation fault. This is what I got:
[ 72%] Building CXX object osdk-wrapper/CMakeFiles/djiosdk-wrapper.dir/src/LinuxMobile.cpp.o
[ 75%] Building CXX object osdk-wrapper/CMakeFiles/djiosdk-wrapper.dir/src/LinuxCamera.cpp.o
[ 77%] Building CXX object osdk-wrapper/CMakeFiles/djiosdk-wrapper.dir/src/ReadUserConfig.cpp.o
[ 80%] Building CXX object osdk-wrapper/CMakeFiles/djiosdk-wrapper.dir/src/LinuxCleanup.cpp.o
[ 83%] Building CXX object osdk-wrapper/CMakeFiles/djiosdk-wrapper.dir/src/LinuxWaypoint.cpp.o
[ 86%] Building CXX object osdk-wrapper/CMakeFiles/djiosdk-wrapper.dir/src/LinuxFlight.cpp.o
[ 88%] Building CXX object osdk-wrapper/CMakeFiles/djiosdk-wrapper.dir/src/LinuxSetup.cpp.o
Linking CXX static library ../libs/libdjiosdk-wrapper.a
[ 88%] Built target djiosdk-wrapper
Scanning dependencies of target djiosdk-linux-sample-nonblock
[ 91%] Building CXX object sample/Linux/Non-Blocking/CMakeFiles/djiosdk-linux-sample-nonblock.dir/src/main.cpp.o
[ 94%] Building CXX object sample/Linux/Non-Blocking/CMakeFiles/djiosdk-linux-sample-nonblock.dir/src/LinuxInteractiveNonBlocking.cpp.o
Linking CXX executable ../../../bin/djiosdk-linux-sample-nonblock
collect2: error: ld terminated with signal 11 [Segmentation fault]
make[2]: *** [bin/djiosdk-linux-sample-nonblock] Error 1
make[1]: *** [sample/Linux/Non-Blocking/CMakeFiles/djiosdk-linux-sample-nonblock.dir/all] Error 2
make: *** [all] Error 2
I'm using Jetson TX1 with ubuntu 14.04.
Drone: Matrice 100 with Guidance
Firmware: 1.2.0.90
I can run DJI Assitant and Simulator fine. However when using PureQT sample app or console app, there is no response when I click Activate button. I've confirmed COM port is correctly assigned in the Device Manager and port can be successfully opened with exact same baud rate as in DJI Assistant.
--UPDATE--
I've now spent entire 2 days debugging this issue and have tried all different baud rates and even combinations. I also tried removing all broadcast from Assistant app. I also tried using sample client in Onboard-SDK-ROS in Ubuntu but there are no messages received on any of the topics and no error messages. I can connect to COM port but nothing happens when clicking Activate button.
How do I debug this? Please help as we can't do much else else until this problem is solved.
Hi,
On my A3 I always get zero for positional health value (BoadcastData -> pos -> health). I've made dozens of tests. Always zero. In the simulator I always get value 4.
Is this a known problem? Has anyone else had this problem?
Thanks in advance.
The programming guide says quaternion to Eulerian conversion code should be this:
float roll = atan2(2.0 * (q.q3 * q.q2 + q.q0 * q.q1) , 1.0 - 2.0 * (q.q1 * q.q1 + q.q2 * q.q2));
float pitch = asin(2.0 * (q.q2 * q.q0 - q.q3 * q.q1));
float yaw = atan2(2.0 * (q.q3 * q.q0 + q.q1 * q.q2) , - 1.0 + 2.0 * (q.q0 * q.q0 + q.q1 * q.q1));
However the implementation in DJI SDK does not match above. Is this a bug?
//Source: http://docs.ros.org/latest-lts/api/dji_sdk_lib/html/DJI__Flight_8cpp_source.html#l00152
00152 EulerianAngle Flight::toEulerianAngle(QuaternionData data)
00153 {
00154 EulerianAngle ans;
00155
00156 double q2sqr = data.q2 * data.q2;
00157 double t0 = -2.0 * (q2sqr + data.q3 * data.q3) + 1.0;
00158 double t1 = +2.0 * (data.q1 * data.q2 + data.q0 * data.q3);
00159 double t2 = -2.0 * (data.q1 * data.q3 - data.q0 * data.q2);
00160 double t3 = +2.0 * (data.q2 * data.q3 + data.q0 * data.q1);
00161 double t4 = -2.0 * (data.q1 * data.q1 + q2sqr) + 1.0;
00162
00163 t2 = t2 > 1.0 ? 1.0 : t2;
00164 t2 = t2 < -1.0 ? -1.0 : t2;
00165
00166 ans.pitch = asin(t2);
00167 ans.roll = atan2(t3, t4);
00168 ans.yaw = atan2(t1, t0);
00169
00170 return ans;
00171 }
osdk-wrapper's ReadUserConfig.cpp hard codes user configuration file name as "UserConfig.txt" and hardcodes the file's path to current directory. It would be useful for application developers who leverage osdk-wrapper library to be able to specify path of the user configuration file.
It looks like below function allows to set broadcast frequency for data. However it takes array of size 16, each of which elements probably mean certain broadcast data type. This doesn't seem to be documented anywhere. What is the default channel assignment for Matrice 100 for below function? I want to set broadcast frequency for specific messages (for example, local_position) and set everything else to 0 Hz to remove noise. I can certainly do this from PC Assistant but it would be great to be able to do from APIs at run time. Also when can below function may be called (after activation or after RequestControl)?
void CoreAPI::setBroadcastFreq(uint8_t *dataLenIs16, CallBack callback, UserData userData)
It would be also nice to update the API doc with this info.
Followed the instructions on the Onboard SDK website, but once I confirm the port is open and hit activate in the Qt example, nothing happens. Nothing also happens when I hit obtain control. Any advice would be appreciated.
Other things to note:
In continuation of similar issues I have faced previously, the SDK's sample has failed to obtain control of my DJI A3 FC. It flashes the same error - RC not in P mode, while my RC is in single flight mode - P.
The compilation raises no error. I am running the A3 FW 1.7. The system is a Raspberry Pi 3 (ARM 64bit) running Ubuntu 16.04.
On this page: https://developer.dji.com/onboard-sdk/documentation/sensor-integration-guides/ping/README.html
The link in the first paragraph to "pingRX" returns a 404 page. You can instead link to this page, which works: https://www.unmannedsystemssource.com/shop/atc-devices/pingrx-ads-b-receiver/
The instructions on the readme page, lead to an error in compilation via CMAKE - Target dependency not found
Hello, DJI. Fantastic work!
But I am wondering whether there are any API documents about the DJI Onboard SDK API Library?
I couldn't find any now.
Thanks very much!
Not sure if I'm overlooking it, but is there no way to query the serial number from the Flight Controller?
Please build shared libraries for 64b ARM platforms. This will add to the range of mobile computers that can be used with the onboard SDK and increase the computational resources available to users.
I'm using Jetson TX1 with 32bit ubuntu 14.04. I made UART connection between Matrice 100 and Jetson TX1's serial port at J17("/dev/ttyTHS2"). The baud rate is at 115200.
When I run djiosdk-linux-sample, I get this error:
Attempting activation..
Automatic activation successful.
Failed to obtain control.
Your RC mode switch is not in mode F. (Is the RC connected and paired?)
This program will exit now.
I do not know why this is happening. I checked DJI assistant 2 and this is what I have:
Mode: GPS ATTI
RC-Status: F
MC-Output: <check>
The mode seems to be in F mode, and the pairing seems to work from the green blinking light on Matrice 100. Any suggestions on how to fix this problem?
Hi,
I would like to confirm the behavior os the VERTICAL_THRUST mode. Specifically what is controled, Is it the total thurst (N) or the motor combine rotation speed (rmp)? Also is the control linear from 0% to 100%?
Thanks very much
Alex
Hi, I'm trying use the provided samples to gather some informations from the drone and control it in the future. But I'm facing an error both on linux(Ubuntu 14.04) and on windows(7pro) that prevent me to do anything.
Here is my configuration :
The connection to the serial port works well both on linux and windows, but when try to request activation
I've got the --- NO RESPONSE: 374 ---
message coming from DJI_Pro_App.cpp
static void * Activate_API_Thread_Func(void * arg)
{
int retry = 12;
activate_data_t *temp_data_t = (activate_data_t *)arg;
from_user_account_data = *temp_data_t;
while(1)
{
DJI_Pro_App_Send_Data( 2, 0, MY_ACTIVATION_SET, API_USER_ACTIVATION,
(unsigned char*)&from_user_account_data,
sizeof(from_user_account_data) - sizeof(char *),
DJI_Pro_Activate_API_CallBack,1000,1);
usleep(50000);
sleep(1);
if(to_user_activation_result == SDK_ERR_NO_RESPONSE)
{
printf("--- NO RESPONSE: %d ---\n",__LINE__);
pthread_mutex_lock(&std_msg_lock);
std_broadcast_data.activation= 2;
pthread_mutex_unlock(&std_msg_lock);
if(p_activate_api_interface)
{
p_activate_api_interface(SDK_ERR_NO_RESPONSE);
}
activate_api_lock = -1;
break;
}
else if(to_user_activation_result == SDK_ACTIVATE_NEW_DEVICE)
{
If I try some other functionalities, they just don't work too. I've took a look on what was going through the serial port (with all the existing baud-rates) and I've never seen any human readable messages, but the serial port is actually receiving something!
Do you have any ideas of what I'm doing wrong?
thanks in advance
I'm not so sure if I have missed something, I think there is a problem of a shared variable between main thread and read thread.
In DJI::onboardSDK::CoreAPI::getBroadcastData()
The main thread get broadcastData
without mutex protection.
This value may be changed by read thread in
void DJI::onboardSDK::CoreAPI::broadcast(Header *protocolHeader)
in which the read thread calls serialDevice->lockMSG()
before overwriting broadcastData
.
Hi, there,
I have just downloaded the Onboard-sdk 3.1.7, when I am compiling, I met the problem:
I went to sample/pureQT directory, and used the commands as
qmake
make
/usr/lib/arm-linux-gnueabihf/qt5/bin/uic djionboardsdk.ui -o ui_djionboardsdk.h
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT -DDJILIB -DDEPENDENCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_SERIALPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I. -I../../../lib -I../../../lib/inc -I../../../lib/onboardSDK/inc -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtSerialPort -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -o main.o main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT -DDJILIB -DDEPENDENCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_SERIALPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I. -I../../../lib -I../../../lib/inc -I../../../lib/onboardSDK/inc -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtSerialPort -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -o djionboardsdk.o djionboardsdk.cpp
djionboardsdk.cpp:1571:6: warning: unused parameter 'checked' [-Wunused-parameter]
void DJIonboardSDK::on_btn_wp_start_stop_clicked(bool checked)
^
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT -DDJILIB -DDEPENDENCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_SERIALPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I. -I../../../lib -I../../../lib/inc -I../../../lib/onboardSDK/inc -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtSerialPort -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -o QonboardSDK.o QonboardSDK.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT -DDJILIB -DDEPENDENCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_SERIALPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I. -I../../../lib -I../../../lib/inc -I../../../lib/onboardSDK/inc -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtSerialPort -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -o DJI_API.o ../../../lib/src/DJI_API.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT -DDJILIB -DDEPENDENCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_SERIALPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I. -I../../../lib -I../../../lib/inc -I../../../lib/onboardSDK/inc -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtSerialPort -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -o DJI_App.o ../../../lib/src/DJI_App.cpp
../../../lib/src/DJI_App.cpp: In member function 'void DJI::onboardSDK::CoreAPI::broadcast(DJI::onboardSDK::Header*)':
../../../lib/src/DJI_App.cpp:95:25: error: 'dataflag' was not declared in this scope
passData(*enableFlag, dataflag, &broadcastData.gimbal, pdata,
^
make: *** [DJI_App.o] Error 1
I turned you don't have any declaration on dataflag when I try use the command
grep 'dataflag' -r *
the results are like this:
lib/src/DJI_App.cpp: passData(*enableFlag, dataflag, &broadcastData.gimbal, pdata,
lib/src/DJI_App.cpp: passData(*enableFlag, dataflag, &broadcastData.ctrlInfo, pdata,
as you declared the passData,
inline void passData(uint16_t flag, uint16_t &enable, void *data, unsigned char *buf,
size_t datalen, size_t &offset)
you should add a declaration for dataflag in the file.
lib/inc/DJI_Type.h
#define API_LOG(driver, title, fmt, ...) \
if ((title)) \
{ \
int len = (sprintf(DJI::onboardSDK::buffer, "%s %s,line %d: " fmt, \
(title) ? (title) : "NONE", __func__, __LINE__, ##__VA_ARGS__)); \
if ((len != -1) && (len < 1024)) \
(driver)->displayLog(); \
else \
(driver)->displayLog("ERROR: log printer inner fault\n"); \
}
这样做貌似sprintf在目标字符串超过1024的时候就溢出了,程序就会报seg fault, 这个len永远不会返回,这里应该用snprintf.
我这里没有你们的ci,我怕提交了pr以后万一有bug,希望你们check下这个溢出的问题 :)
我的M100刚升级到 MATRICE100_FW_V01.03.01.00
我用了命令行的linux sample, 出现了:activate SDK version did not match问题。
typedef struct
{
fp32 x;
fp32 y;
fp32 z;
// unsigned char health_flag :1;
// unsigned char feedback_sensor_id :4;
// unsigned char reserve :3;
}api_vel_data_t;
Flight Controller version: 2.2.7
I had to comment out the last three values to fix this issue. I think N1 controller is not outputting this format leading to corruption of all the data that follows it like the global/local position, RC etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.