CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Rover/defines.h
Views: 1798
1
#pragma once
2
3
// Internal defines, don't edit and expect things to work
4
// -------------------------------------------------------
5
6
#define SERVO_MAX 4500.0 // This value represents 45 degrees and is just an arbitrary representation of servo max travel.
7
8
// types of failsafe events
9
#define FAILSAFE_EVENT_THROTTLE (1<<0)
10
#define FAILSAFE_EVENT_GCS (1<<1)
11
12
// Logging parameters - only 32 messages are available to the vehicle here.
13
enum LoggingParameters {
14
LOG_THR_MSG,
15
LOG_NTUN_MSG,
16
LOG_STEERING_MSG,
17
LOG_GUIDEDTARGET_MSG,
18
};
19
20
#define MASK_LOG_ATTITUDE_FAST (1<<0)
21
#define MASK_LOG_ATTITUDE_MED (1<<1)
22
#define MASK_LOG_GPS (1<<2)
23
#define MASK_LOG_PM (1<<3)
24
#define MASK_LOG_THR (1<<4)
25
#define MASK_LOG_NTUN (1<<5)
26
//#define MASK_LOG_MODE (1<<6) // no longer used
27
#define MASK_LOG_IMU (1<<7)
28
#define MASK_LOG_CMD (1<<8)
29
#define MASK_LOG_CURRENT (1<<9)
30
#define MASK_LOG_RANGEFINDER (1<<10)
31
#define MASK_LOG_COMPASS (1<<11)
32
#define MASK_LOG_CAMERA (1<<12)
33
#define MASK_LOG_STEERING (1<<13)
34
#define MASK_LOG_RC (1<<14)
35
// #define MASK_LOG_ARM_DISARM (1<<15)
36
#define MASK_LOG_IMU_RAW (1UL<<19)
37
#define MASK_LOG_VIDEO_STABILISATION (1UL<<20)
38
#define MASK_LOG_OPTFLOW (1UL<<21)
39
40
// for mavlink SET_POSITION_TARGET messages
41
#define MAVLINK_SET_POS_TYPE_MASK_POS_IGNORE ((1<<0) | (1<<1))
42
#define MAVLINK_SET_POS_TYPE_MASK_VEL_IGNORE ((1<<3) | (1<<4))
43
#define MAVLINK_SET_POS_TYPE_MASK_ACC_IGNORE ((1<<6) | (1<<7))
44
#define MAVLINK_SET_POS_TYPE_MASK_FORCE (1<<9)
45
#define MAVLINK_SET_POS_TYPE_MASK_YAW_IGNORE (1<<10)
46
#define MAVLINK_SET_POS_TYPE_MASK_YAW_RATE_IGNORE (1<<11)
47
48
// for mavlink SET_ATTITUDE_TARGET messages
49
#define MAVLINK_SET_ATT_TYPE_MASK_ROLL_RATE_IGNORE (1<<0)
50
#define MAVLINK_SET_ATT_TYPE_MASK_PITCH_RATE_IGNORE (1<<1)
51
#define MAVLINK_SET_ATT_TYPE_MASK_YAW_RATE_IGNORE (1<<2)
52
#define MAVLINK_SET_ATT_TYPE_MASK_THROTTLE_IGNORE (1<<6)
53
#define MAVLINK_SET_ATT_TYPE_MASK_ATTITUDE_IGNORE (1<<7)
54
55
// radio failsafe enum (FS_THR_ENABLE parameter)
56
enum fs_thr_enable {
57
FS_THR_DISABLED = 0,
58
FS_THR_ENABLED,
59
FS_THR_ENABLED_CONTINUE_MISSION,
60
};
61
62
// gcs failsafe enum (FS_GCS_ENABLE parameter)
63
enum fs_gcs_enable {
64
FS_GCS_DISABLED = 0,
65
FS_GCS_ENABLED,
66
FS_GCS_ENABLED_CONTINUE_MISSION,
67
};
68
69
enum fs_crash_action {
70
FS_CRASH_DISABLE = 0,
71
FS_CRASH_HOLD = 1,
72
FS_CRASH_HOLD_AND_DISARM = 2
73
};
74
75
enum fs_ekf_action {
76
FS_EKF_DISABLE = 0,
77
FS_EKF_HOLD = 1,
78
FS_EKF_REPORT_ONLY = 2,
79
};
80
81
#define DISTANCE_HOME_MINCHANGE 0.5f // minimum distance to adjust home location
82
83
enum class PilotSteerType : uint8_t {
84
DEFAULT = 0,
85
TWO_PADDLES = 1,
86
DIR_REVERSED_WHEN_REVERSING = 2,
87
DIR_UNCHANGED_WHEN_REVERSING = 3,
88
};
89
90
// frame class enum used for FRAME_CLASS parameter
91
enum frame_class {
92
FRAME_UNDEFINED = 0,
93
FRAME_ROVER = 1,
94
FRAME_BOAT = 2,
95
FRAME_BALANCEBOT = 3,
96
};
97
98
// manual mode options
99
enum ManualOptions {
100
SPEED_SCALING = (1 << 0),
101
};
102
103