28 #ifndef DJI_FLIGHT_JOYSTICK_MODULE_HPP 29 #define DJI_FLIGHT_JOYSTICK_MODULE_HPP 36 class FlightJoystick {
39 enum class JoystickCtrlAuthorityCommand {
40 RELEASE_AUTHORITY = 0,
54 enum HorizontalLogic {
68 HORIZONTAL_VELOCITY = 1,
74 HORIZONTAL_POSITION = 2,
80 HORIZONTAL_ANGULAR_RATE = 3
96 VERTICAL_VELOCITY = 0,
101 VERTICAL_POSITION = 1,
128 enum HorizontalCoordinate {
130 HORIZONTAL_GROUND = 0,
165 typedef struct ControlMode {
166 uint8_t stableMode : 1;
167 uint8_t horizFrame : 2;
169 uint8_t vertiMode : 2;
170 uint8_t horizMode : 2;
173 typedef struct CtrlData {
174 ControlMode controlMode;
175 ControlCommand controlCommand;
183 ControlMode controlMode;
186 float32_t xFeedforward;
187 float32_t yFeedforward;
190 typedef struct KillSwitchData {
191 uint8_t high_version;
193 uint8_t debug_description[10];
197 uint8_t reserved : 6;
200 typedef struct CommonAck {
206 FlightJoystick(Vehicle *vehicle);
212 UserData userData,
int timeout,
int retryTime);
216 UserData userData,
int timeout,
int retryTime);
219 void setHorizontalLogic(HorizontalLogic horizontalLogic);
220 void setVerticalLogic(VerticalLogic verticalLogic);
221 void setYawLogic(YawLogic yawLogic);
222 void setHorizontalCoordinate(HorizontalCoordinate horizontalCoordinate);
223 void setStableMode(StableMode stableMode);
225 void setControlCommand(
const ControlCommand &controlCommand);
226 void joystickAction();
228 void getControlCommand(ControlCommand &controlCommand);
229 void getControlMode(ControlMode &controlCommand);
233 FlightLink *flightLink;
238 #endif // DJI_FLIGHT_JOYSTICK_MODULE_HPP void * UserData
This is used as the datatype for all data arguments in callbacks.
Definition: dji_type.hpp:75
int64_t ErrorCodeType
Unified error type.
Definition: dji_error.hpp:144
float32_t x
Definition: dji_flight_joystick_module.hpp:157
Type definition for new Vehicle-style callbacks.
CtrlData used for flight control.
Definition: dji_flight_joystick_module.hpp:156
float32_t y
Definition: dji_flight_joystick_module.hpp:159
float32_t z
Definition: dji_flight_joystick_module.hpp:161
AdvancedCtrlData.
Definition: dji_flight_joystick_module.hpp:182
Definition: dji_ack.cpp:38
float32_t yaw
Definition: dji_flight_joystick_module.hpp:162