mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 05:03:34 +08:00
commander: more text feedback improvements.
This commit is contained in:
@@ -87,7 +87,7 @@ static const bool arming_transitions[ARMING_STATE_MAX][ARMING_STATE_MAX] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// You can index into the array with an arming_state_t in order to get it's textual representation
|
// You can index into the array with an arming_state_t in order to get it's textual representation
|
||||||
static const char *state_names[ARMING_STATE_MAX] = {
|
static const char * const state_names[ARMING_STATE_MAX] = {
|
||||||
"ARMING_STATE_INIT",
|
"ARMING_STATE_INIT",
|
||||||
"ARMING_STATE_STANDBY",
|
"ARMING_STATE_STANDBY",
|
||||||
"ARMING_STATE_ARMED",
|
"ARMING_STATE_ARMED",
|
||||||
@@ -160,7 +160,7 @@ arming_state_transition(struct vehicle_status_s *status, /// current
|
|||||||
// Fail transition if we need safety switch press
|
// Fail transition if we need safety switch press
|
||||||
} else if (safety->safety_switch_available && !safety->safety_off) {
|
} else if (safety->safety_switch_available && !safety->safety_off) {
|
||||||
|
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: NOT ARMING: Press safety switch!");
|
mavlink_log_critical(mavlink_fd, "NOT ARMING: Press safety switch!");
|
||||||
|
|
||||||
valid_transition = false;
|
valid_transition = false;
|
||||||
}
|
}
|
||||||
@@ -625,7 +625,7 @@ int prearm_check(const struct vehicle_status_s *status, const int mavlink_fd)
|
|||||||
int fd = open(ACCEL_DEVICE_PATH, O_RDONLY);
|
int fd = open(ACCEL_DEVICE_PATH, O_RDONLY);
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: FAIL: ACCEL SENSOR MISSING");
|
mavlink_log_critical(mavlink_fd, "ARM FAIL: ACCEL SENSOR MISSING");
|
||||||
failed = true;
|
failed = true;
|
||||||
goto system_eval;
|
goto system_eval;
|
||||||
}
|
}
|
||||||
@@ -633,7 +633,7 @@ int prearm_check(const struct vehicle_status_s *status, const int mavlink_fd)
|
|||||||
ret = ioctl(fd, ACCELIOCSELFTEST, 0);
|
ret = ioctl(fd, ACCELIOCSELFTEST, 0);
|
||||||
|
|
||||||
if (ret != OK) {
|
if (ret != OK) {
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: FAIL: ACCEL CALIBRATION");
|
mavlink_log_critical(mavlink_fd, "ARM FAIL: ACCEL CALIBRATION");
|
||||||
failed = true;
|
failed = true;
|
||||||
goto system_eval;
|
goto system_eval;
|
||||||
}
|
}
|
||||||
@@ -647,14 +647,14 @@ int prearm_check(const struct vehicle_status_s *status, const int mavlink_fd)
|
|||||||
float accel_magnitude = sqrtf(acc.x * acc.x + acc.y * acc.y + acc.z * acc.z);
|
float accel_magnitude = sqrtf(acc.x * acc.x + acc.y * acc.y + acc.z * acc.z);
|
||||||
|
|
||||||
if (accel_magnitude < 4.0f || accel_magnitude > 15.0f /* m/s^2 */) {
|
if (accel_magnitude < 4.0f || accel_magnitude > 15.0f /* m/s^2 */) {
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: FAIL: ACCEL RANGE");
|
mavlink_log_critical(mavlink_fd, "ARM FAIL: ACCEL RANGE");
|
||||||
mavlink_log_info(mavlink_fd, "#audio: hold still while arming");
|
mavlink_log_critical(mavlink_fd, "hold still while arming");
|
||||||
/* this is frickin' fatal */
|
/* this is frickin' fatal */
|
||||||
failed = true;
|
failed = true;
|
||||||
goto system_eval;
|
goto system_eval;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: FAIL: ACCEL READ");
|
mavlink_log_critical(mavlink_fd, "ARM FAIL: ACCEL READ");
|
||||||
/* this is frickin' fatal */
|
/* this is frickin' fatal */
|
||||||
failed = true;
|
failed = true;
|
||||||
goto system_eval;
|
goto system_eval;
|
||||||
@@ -667,7 +667,7 @@ int prearm_check(const struct vehicle_status_s *status, const int mavlink_fd)
|
|||||||
fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
|
fd = open(AIRSPEED_DEVICE_PATH, O_RDONLY);
|
||||||
|
|
||||||
if (fd <= 0) {
|
if (fd <= 0) {
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: FAIL: AIRSPEED SENSOR MISSING");
|
mavlink_log_critical(mavlink_fd, "ARM FAIL: AIRSPEED SENSOR MISSING");
|
||||||
failed = true;
|
failed = true;
|
||||||
goto system_eval;
|
goto system_eval;
|
||||||
}
|
}
|
||||||
@@ -678,11 +678,11 @@ int prearm_check(const struct vehicle_status_s *status, const int mavlink_fd)
|
|||||||
|
|
||||||
if (ret == sizeof(diff_pres)) {
|
if (ret == sizeof(diff_pres)) {
|
||||||
if (fabsf(diff_pres.differential_pressure_filtered_pa > 6.0f)) {
|
if (fabsf(diff_pres.differential_pressure_filtered_pa > 6.0f)) {
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: WARNING AIRSPEED CALIBRATION MISSING");
|
mavlink_log_critical(mavlink_fd, "ARM WARNING: AIRSPEED CALIBRATION MISSING");
|
||||||
// XXX do not make this fatal yet
|
// XXX do not make this fatal yet
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mavlink_log_critical(mavlink_fd, "#audio: FAIL: AIRSPEED READ");
|
mavlink_log_critical(mavlink_fd, "ARM FAIL: AIRSPEED READ");
|
||||||
/* this is frickin' fatal */
|
/* this is frickin' fatal */
|
||||||
failed = true;
|
failed = true;
|
||||||
goto system_eval;
|
goto system_eval;
|
||||||
|
|||||||
Reference in New Issue
Block a user