Telemetry API through asynchronous "Broadcast"-style messages. More...
#include <dji_broadcast.hpp>
Static Public Member Functions | |
static void | unpackCallback (Vehicle *vehicle, RecvContainer recvFrame, UserData userData) |
static void | setFrequencyCallback (Vehicle *vehicle, RecvContainer recvFrame, UserData userData) |
Public Attributes | |
VehicleCallBackHandler | unpackHandler |
Detailed Description
Telemetry API through asynchronous "Broadcast"-style messages.
Broadcast telemetry is sent by the FC as push data - whenever an OES connects to the API port on FC, broadcast telemetry starts pushing data to the OES.
Frequencies can be set through DJI Assistant 2 or through these APIs.
- Note
- Broadcast-style telemetry is an old feature, and will not see many updates.
Member Function Documentation
◆ getAcceleration()
Telemetry::Vector3f DataBroadcast::getAcceleration | ( | ) |
Get acceleration from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
The acceleration may be in body or ground frame, fused or raw, based on settings on DJI Assistant 2's SDK page.
- Returns
- Telemetry::Vector3f data structure with the newest value.
◆ getAngularRate()
Telemetry::Vector3f DataBroadcast::getAngularRate | ( | ) |
Get Angular Rates from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
The angular rates may be in body or ground frame, fused or raw, based on settings on DJI Assistant 2's SDK page.
- Returns
- Telemetry::Vector3f data structure with the newest value.
◆ getBatteryInfo()
Telemetry::Battery DataBroadcast::getBatteryInfo | ( | ) |
Get Battery Info from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
- Returns
- Telemetry::Battery data structure with the newest value.
◆ getCompassData()
Telemetry::Compass DataBroadcast::getCompassData | ( | ) |
Get Compass status info from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
- Returns
- Telemetry::Compass data structure with the newest value.
◆ getGimbal()
Telemetry::Gimbal DataBroadcast::getGimbal | ( | ) |
Get Gimbal data from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
Data Accuracy: 0.1 deg in all axes
- Returns
- Telemetry::Gimbal data structure with the newest value.
◆ getGlobalPosition()
Telemetry::GlobalPosition DataBroadcast::getGlobalPosition | ( | ) |
Get Globalc Position (LLA and metadata) from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
Data accuracy:
Axis | Unit | Position Sensor | Accuracy |
---|---|---|---|
x, y | m | GPS | <3m with open sky without multipath |
z | m | GPS | <5m with open sky without multipath |
x, y | m | RTK | around 2cm with fine alignment and fix condition |
z | m | RTK | around 3cm with fine alignment and fix condition |
The returned Lat/Lon values are in rad.
- Returns
- Telemetry::GlobalPosition data structure with the newest value.
◆ getGPSInfo()
Telemetry::GPSInfo DataBroadcast::getGPSInfo | ( | ) |
Get GPS Info from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
This feature provides detailed GPS info. Available on A3/N3/M600. You need to enable it separately on DJI Assistant 2's SDK page.
- Returns
- Telemetry::GPSInfo data structure with the newest value.
◆ getMag()
Telemetry::Mag DataBroadcast::getMag | ( | ) |
Get Magnetometer data from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
The returned value is calibrated mag data, 1000 < |mag| < 2000 for normal operation
- Returns
- Telemetry::Mag data structure with the newest value.
◆ getPassFlag()
uint16_t DataBroadcast::getPassFlag | ( | ) |
getter function for passFlag
- Supported Platforms : M210V2, M300
- Returns
- uint16_t passFlag
◆ getQuaternion()
Telemetry::Quaternion DataBroadcast::getQuaternion | ( | ) |
Get quaternion data from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
- Returns
- Telemetry::Quaternion data structure with the newest value.
Data accuracy:
Angle | Unit | Accuracy | Notes |
---|---|---|---|
pitch, roll | deg | <1 | in non-ahrs mode |
yaw | deg | <3 | for well-calibrated compass with fine alignment |
yaw with rtk | deg | around 1.2 | in RTK heading fixed mode with 1 meter baseline |
◆ getRC()
Telemetry::RC DataBroadcast::getRC | ( | ) |
Get RC channel data from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
- Returns
- Telemetry::RC data structure with the newest value.
◆ getRelativePosition()
Telemetry::RelativePosition DataBroadcast::getRelativePosition | ( | ) |
Get Obstacle info around the vehicle from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
The returned value is relative to your home location.
- Returns
- Telemetry::RelativePosition data structure with the newest value.
◆ getRTKInfo()
Telemetry::RTK DataBroadcast::getRTKInfo | ( | ) |
Get RTK data from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
This feature provides detailed RTK info. Available on A3/M600. You need to enable it separately on DJI Assistant 2's SDK page.
- Returns
- Telemetry::RTK data structure with the newest value.
- Note
- RTK Position Info and Yaw Info State is shown in the table below
State | Meaning | Description |
---|---|---|
0 | NONE | No solution |
1 | FIXEDPOS | Position has been fixed by the FIX POSITION command |
2 | FIXEDHEIGHT | Position has been fixed by the FIX HEIGHT/AUTO command |
8 | DOPPLER_VELOCITY | Velocity computed using instantaneous Doppler |
16 | Single | Single point position |
17 | PSRDIFF | Pseudorange differential solution |
18 | WAAS | Solution calculated using corrections from an SBAS |
19 | PROPAGATED | Propagated by a Kalman filter without new observations |
20 | OMNISTAR | OmniSTAR VBS position (L1 sub-metre) |
32 | L1_FLOAT | Floating L1 ambiguity solution |
33 | IONOFREE_FLOAT | Floating ionospheric-free ambiguity solution |
34 | NARROW_FLOAT | Floating narrow-lane ambiguity solution |
48 | L1_INT | Integer L1 ambiguity solution |
49 | WIDE_INT | Integer wide-lane ambiguity solution |
50 | NARROW_INT | Integer narrow-lane ambiguity solution |
◆ getSDKInfo()
Telemetry::SDKInfo DataBroadcast::getSDKInfo | ( | ) |
Get SDK Control Mode/Authority info from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
- Returns
- Telemetry::SDKInfo data structure with the newest value.
◆ getStatus()
Telemetry::Status DataBroadcast::getStatus | ( | ) |
Get Status (flight status, mode, gear and error) from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
- Returns
- Telemetry::Status data structure with the newest value.
◆ getSyncStamp()
Telemetry::SyncStamp DataBroadcast::getSyncStamp | ( | ) |
Get software sync timestamp from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
Note that this is unrelated to the hardware sync subscription.
- Returns
- Telemetry::SyncStamp data structure with the newest value.
◆ getTimeStamp()
Telemetry::TimeStamp DataBroadcast::getTimeStamp | ( | ) |
Get timestamp from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
- Returns
- Telemetry::TimeStamp data structure with the newest value.
◆ getVelocity()
Telemetry::Vector3f DataBroadcast::getVelocity | ( | ) |
Get velocity from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
Data accuracy:
Axis | Unit | Accuracy |
---|---|---|
vgx, vgy | m/s | Around 5cm/s for GNSS navigation. Around 3cm/s with VO at 1 meter height |
vgz | m/s | 10cm/s only with barometer in steady air. 3cm/s with VO at 1 meter height with 8cm baseline |
The velocity is based on ground frame.
- Returns
- Telemetry::Vector3f data structure with the newest value.
◆ getVelocityInfo()
Telemetry::VelocityInfo DataBroadcast::getVelocityInfo | ( | ) |
Get Velocity Info (health) from local cache
- Supported Platforms : M210V2, M300
- Note
- This getter function is only available with Broadcast, not with Subscribe telemetry
This data is received along with velocity.
- Returns
- Telemetry::VelocityInfo data structure with the newest value.
◆ setBroadcastFreq() [1/2]
void DataBroadcast::setBroadcastFreq | ( | uint8_t * | dataLenIs16, |
VehicleCallBack | callback = 0 , |
||
UserData | userData = 0 |
||
) |
Non-blocking call for Frequency setting
- Supported Platforms : M210V2, M300
- Parameters
-
dataLenIs16 Array of length 16 that has frequency values for each topic callback Callback function you want called upon ACK userData Additional data you want the callback function to have access to
◆ setBroadcastFreq() [2/2]
ACK::ErrorCode DataBroadcast::setBroadcastFreq | ( | uint8_t * | dataLenIs16, |
int | wait_timeout | ||
) |
Blocking call for Frequency setting
- Supported Platforms : M210V2, M300
- Parameters
-
dataLenIs16 Array of length 16 that has frequency values for each topic wait_timeout Time(in s) you want the function to wait for an ACK
- Returns
- ACK::ErrorCode struct containing the ACK and metadata
◆ setBroadcastFreqDefaults() [1/2]
void DataBroadcast::setBroadcastFreqDefaults | ( | ) |
Non-Blocking call for setting default frequencies
- Supported Platforms : M210V2, M300
◆ setBroadcastFreqDefaults() [2/2]
ACK::ErrorCode DataBroadcast::setBroadcastFreqDefaults | ( | int | timeout | ) |
Blocking call for setting default frequencies
- Supported Platforms : M210V2, M300
- Parameters
-
wait_timeout Time(in s) you want the function to wait for an ACK
- Returns
- ACK::ErrorCode struct containing the ACK and metadata
◆ setBroadcastFreqToZero()
void DataBroadcast::setBroadcastFreqToZero | ( | ) |
Non-Blocking call for setting all frequencies to zero
- Supported Platforms : M210V2, M300
The documentation for this class was generated from the following files:
- osdk-core/api/inc/dji_broadcast.hpp
- osdk-core/api/src/dji_broadcast.cpp