You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Align IMU accelerometer axes.
Calculate pitch, roll, and overall tilt angles.
Set ESC shutdown pin to HIGH if:
- shutdown_esc_max_pitch is set
- not on a slope (pitch < shutdown_esc_max_pitch) and...
- ROS is running and...
- current mode is IDLE or emergency latched
Requires killswitch to be set to ADC2_HIGH in xesc app config
(Based on the work of @Pete_MI632 on discord)
Copy file name to clipboardExpand all lines: Firmware/LowLevel/src/datatypes.h
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ struct ll_status {
101
101
// Bit 0: Initialized (i.e. setup() was a success). If this is 0, all other bits are meaningless.
102
102
// Bit 1: Raspberry Power
103
103
// Bit 2: Charging enabled
104
-
// Bit 3: don't care (reserved for ESC shutdown PR)
104
+
// Bit 3: ESC power
105
105
// Bit 4: Rain detected
106
106
// Bit 5: Sound available
107
107
// Bit 6: Sound busy
@@ -168,7 +168,7 @@ struct ll_high_level_state {
168
168
structll_ui_event {
169
169
// Type of this message. Has to be PACKET_ID_LL_UI_EVENT
170
170
uint8_t type;
171
-
uint8_t button_id;
171
+
uint8_t button_id;
172
172
uint8_t press_duration; // 0 for single press, 1 for long, 2 for very long press
173
173
uint16_t crc;
174
174
} __attribute__((packed));
@@ -236,7 +236,7 @@ struct ll_high_level_config {
236
236
float v_battery_full = 28.7f - 0.3f; // Full battery voltage used for % calc of capacity (-1 = unknown)
237
237
uint16_t lift_period = 100; // Period (ms) for >=2 wheels to be lifted in order to count as emergency (0 = disable, 0xFFFF = unknown). This is to filter uneven ground
238
238
uint16_t tilt_period = 2500; // Period (ms) for a single wheel to be lifted in order to count as emergency (0 = disable, 0xFFFF = unknown). This is to filter uneven ground
239
-
uint8_t shutdown_esc_max_pitch = 0; // Do not shutdown ESCs if absolute pitch angle is greater than this (0 = disable, 0xffff = unknown) (to be implemented, see PR #97)
239
+
uint8_t shutdown_esc_max_pitch = 0; // Do not shutdown ESCs if absolute pitch angle is greater than this (0 = disable, 0xffff = unknown)
240
240
iso639_1 language = {'e', 'n'}; // ISO 639-1 (2-char) language code (en, de, ...)
241
241
uint8_t volume = 80; // Volume (0-100%) feedback (if directly changed i.e. via CoverUI or WebApp) (0xff = do not change)
0 commit comments