18 #ifndef UAVSTATEMACHINE_H
19 #define UAVSTATEMACHINE_H
29 class FrameworkManager;
44 class TrajectoryGenerator1D;
47 class TargetController;
69 enum class AltitudeMode_t { Manual, Custom };
70 const AltitudeMode_t &GetAltitudeMode(
void)
const {
return altitudeMode; }
71 bool SetAltitudeMode(
const AltitudeMode_t &altitudeMode);
76 bool GotoAltitude(
float desiredAltitude);
78 enum class OrientationMode_t { Manual, Custom };
79 const OrientationMode_t &GetOrientationMode(
void)
const {
80 return orientationMode;
82 bool SetOrientationMode(
const OrientationMode_t &orientationMode);
84 enum class ThrustMode_t { Default, Custom };
85 const ThrustMode_t &GetThrustMode()
const {
return thrustMode; }
86 bool SetThrustMode(
const ThrustMode_t &thrustMode);
88 enum class TorqueMode_t { Default, Custom };
89 const TorqueMode_t &GetTorqueMode(
void)
const {
return torqueMode; }
90 bool SetTorqueMode(
const TorqueMode_t &torqueMode);
112 void EmergencyLand(
void);
114 void EmergencyStop(
void);
124 virtual void AltitudeValues(
float &z,
float &dz)
const;
125 void EnterFailSafeMode(
void);
126 bool ExitFailSafeMode(
void);
127 void FailSafeAltitudeValues(
float &z,
float &dz)
const;
130 virtual void ExtraSecurityCheck(
void){};
131 virtual void ExtraCheckJoystick(
void){};
132 virtual void ExtraCheckPushButton(
void){};
134 void GetDefaultReferenceAltitude(
float &refAltitude,
135 float &refVerticalVelocity);
136 virtual void GetReferenceAltitude(
float &refAltitude,
137 float &refVerticalVelocity);
237 gui::Tab *setupLawTab, *graphLawTab;
244 enum class AltitudeState_t {
253 AltitudeState_t altitudeState;
254 void ProcessAltitudeFiniteStateMachine();
255 void ComputeReferenceAltitude(
float &refAltitude,
float &refVerticalVelocity);
257 float groundAltitude;
258 float currentAltitude, currentVerticalSpeed;
261 void SecurityCheck(
void);
262 void MandatorySecurityCheck(
void);
263 void CheckJoystick();
264 void GenericCheckJoystick();
265 void CheckPushButton(
void);
266 void GenericCheckPushButton(
void);
268 void StopMotors(
void);
269 bool IsValuePossible(
float value,std::string desc);
279 void ComputeOrientation(
void);
280 void ComputeAltitude(
void);
282 void ComputeTorques(
void);
284 bool needToComputeDefaultTorques;
286 void ComputeThrust(
void);
287 float currentThrust, savedDefaultThrust;
288 bool needToComputeDefaultThrust;
291 *button_start_log, *button_stop_log;
294 AltitudeMode_t altitudeMode;
295 OrientationMode_t orientationMode;
296 ThrustMode_t thrustMode;
297 TorqueMode_t torqueMode;
299 bool flagConnectionLost;
300 bool flagCriticalSensorLost;
301 bool flagZTrajectoryFinished;
310 #endif // UAVSTATEMACHINE_H
Abstract class for data types.
Definition: io_data.h:94
Abstract class for input/ouput system.
Definition: IODevice.h:45
namespace of the flair Framework
Definition: Ahrs.h:19
Class defining euler angles.
Definition: Euler.h:27
Class defining a 2D vector.
Class displaying a QGridLayout on the ground station.
Definition: GridLayout.h:27
Class defining a Pid for Thrust. This Pid as an extra offset for compensating gravity.
Definition: PidThrust.h:33
Class defining AHRS datas.
Definition: AhrsData.h:30
Class defining a 3D vector.
Base Class for target side remote controls.
Definition: TargetController.h:49
Class generating a trajectory in 1D.
Definition: TrajectoryGenerator1D.h:47
Class defining a PID.
Definition: Pid.h:32
Abstract class for a thread.
Class defining a quaternion.
Class defining a PID with saturations.
Definition: NestedSat.h:43
Abstract class for a thread.
Definition: Thread.h:38
Class displaying a QDoubleSpinBox on the ground station.
Definition: DoubleSpinBox.h:28
Class defining a quaternion.
Definition: Quaternion.h:26
Class displaying a QTab on the ground station.
Definition: Tab.h:29
Class defining euler angles.