VirtualRC class has all the methods to mimic the RC functionality via OnboardSDK.
More...
#include <DJI_VirtualRC.h>
|
enum | CutOff { CutOff_ToLogic = 0,
CutOff_ToRealRC = 1
} |
|
VirtualRC class has all the methods to mimic the RC functionality via OnboardSDK.
- Warning
- return type will change to RCData in a future release
-
The return type will change to RCData in a future release.
void VirtualRC::neutralVRCSticks |
( |
| ) |
|
api->send command was moved to this function from sendData().
void VirtualRC::setControl |
( |
bool |
enable, |
|
|
VirtualRC::CutOff |
cutoffType |
|
) |
| |
- Attention
- Safety notes You must use these methods below really carefully with following rules:
-
Your reset code must not be "setControl(true);" without any status check It may cause your drone became a nut drone.
- Note
- You could quit your VRC(Virtual Remot Control) by switching your remote controller out of modeF
- Attention
- Most dangerous, setControl(true); must not be called over 0.5Hz or your drone will be locked in a logic-checking loop. And you cannot exit VirtualRC mode by switching your remote controller's mode. Actually, in this situation your drone will be a full automatically controlled by it self. It will keep flying until its bettery is empty or your code make it stop.
-
If you do not know what reset code you need to write, please just output your datalog and keep it empty.
-
It would be realy dangous if you keep calling sendData(); in a loop with out control-losing protection. like :
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(); Somehow, you will never get your drone back in one pice, if this tragedy happend.
- Note
- API "sendData();" need to be called above 2Hz, and not greater than 25hz.
-
API "sendSafeModeData();" will lead your drone hover;
- Warning
- old interface. Will be replaced by toRCData (see below) in a future release.
-
This function will be deprecated in a future release. Please use toRCData instead.
The documentation for this class was generated from the following files: