VirtualRC class has all the methods to mimic the RC functionality via OnboardSDK. More...
#include <DJI_VirtualRC.h>
Public Types | |
enum | CutOff { CutOff_ToLogic = 0, CutOff_ToRealRC = 1 } |
Public Member Functions | |
CoreAPI * | getApi () const |
RadioData | getRCData () const |
VirtualRCData | getVRCData () const |
New function - this will replace sendSafeModeData() in a future release. | |
bool | isVirtualRC () const |
void | neutralVRCSticks () |
void | resetData () |
This function will not be maintained and will be deprecated in a future release. Please use resetVRCData() instead. | |
void | sendData (VirtualRCData Data) |
void | sendData () |
This function will be deprecated in a future release. Please use sendData(VirtualRCData Data) instead. | |
void | sendSafeModeData () |
This function will be deprecated in the future. Please use neutralVRCSticks() instead. | |
void | setApi (CoreAPI *value) |
void | setControl (bool enable, CutOff cutoffType) |
void | setVRCData (const VirtualRCData &value) |
VirtualRC (CoreAPI *ControlAPI=0) | |
Static Public Member Functions | |
static RadioData | toRadioData (VirtualRCData &vData) |
static RCData | toRCData (VirtualRCData &vData) |
static VirtualRCData | toVirtualRCData (RadioData &rData) |
Private Attributes | |
CoreAPI * | api |
VirtualRCData | vrcData |
VirtualRC class has all the methods to mimic the RC functionality via OnboardSDK.
Definition at line 24 of file DJI_VirtualRC.h.
Definition at line 27 of file DJI_VirtualRC.h.
VirtualRC::VirtualRC | ( | CoreAPI * | ControlAPI = 0 | ) |
Definition at line 17 of file DJI_VirtualRC.cpp.
CoreAPI * VirtualRC::getApi | ( | ) | const |
Definition at line 81 of file DJI_VirtualRC.cpp.
RadioData VirtualRC::getRCData | ( | ) | const |
Definition at line 79 of file DJI_VirtualRC.cpp.
VirtualRCData VirtualRC::getVRCData | ( | ) | const |
New function - this will replace sendSafeModeData() in a future release.
Definition at line 84 of file DJI_VirtualRC.cpp.
bool VirtualRC::isVirtualRC | ( | ) | const |
Definition at line 90 of file DJI_VirtualRC.cpp.
void VirtualRC::neutralVRCSticks | ( | ) |
Definition at line 72 of file DJI_VirtualRC.cpp.
void VirtualRC::resetData | ( | ) |
This function will not be maintained and will be deprecated in a future release. Please use resetVRCData() instead.
Definition at line 45 of file DJI_VirtualRC.cpp.
void VirtualRC::sendData | ( | VirtualRCData | Data | ) |
api->send command was moved to this function from sendData().
Definition at line 31 of file DJI_VirtualRC.cpp.
void VirtualRC::sendData | ( | ) |
This function will be deprecated in a future release. Please use sendData(VirtualRCData Data) instead.
Definition at line 39 of file DJI_VirtualRC.cpp.
void VirtualRC::sendSafeModeData | ( | ) |
This function will be deprecated in the future. Please use neutralVRCSticks() instead.
Definition at line 66 of file DJI_VirtualRC.cpp.
void VirtualRC::setApi | ( | CoreAPI * | value | ) |
Definition at line 82 of file DJI_VirtualRC.cpp.
void VirtualRC::setControl | ( | bool | enable, |
VirtualRC::CutOff | cutoffType | ||
) |
Global: VirtualRCData myData;
Thread 1: while(1) { myData = myAPIToSetupDataFromGroundStation(); }
Thread 2: while(1) { sendData(myData); msleep(200); }
When your drone lose signal, it will keep the recent command sent by your API: myAPIToSetupDataFromGroundStation(); This may result in a catastrophic crash.
Definition at line 23 of file DJI_VirtualRC.cpp.
void VirtualRC::setVRCData | ( | const VirtualRCData & | value | ) |
Definition at line 85 of file DJI_VirtualRC.cpp.
RadioData VirtualRC::toRadioData | ( | VirtualRCData & | vData | ) | [static] |
Definition at line 96 of file DJI_VirtualRC.cpp.
RCData VirtualRC::toRCData | ( | VirtualRCData & | vData | ) | [static] |
Definition at line 108 of file DJI_VirtualRC.cpp.
VirtualRCData VirtualRC::toVirtualRCData | ( | RadioData & | rData | ) | [static] |
Definition at line 120 of file DJI_VirtualRC.cpp.
CoreAPI* DJI::onboardSDK::VirtualRC::api [private] |
Definition at line 111 of file DJI_VirtualRC.h.
Definition at line 112 of file DJI_VirtualRC.h.