Skip to content
Snippets Groups Projects
Commit c30af1b0 authored by Michael Day's avatar Michael Day
Browse files

Copter: Ignore some checks in SITL to get faster takeoff

parent 93bca8d6
No related branches found
No related tags found
No related merge requests found
...@@ -500,6 +500,7 @@ bool Copter::pre_arm_gps_checks(bool display_failure) ...@@ -500,6 +500,7 @@ bool Copter::pre_arm_gps_checks(bool display_failure)
return true; return true;
} }
#if CONFIG_HAL_BOARD != HAL_BOARD_SITL
// ensure GPS is ok // ensure GPS is ok
if (!position_ok()) { if (!position_ok()) {
if (display_failure) { if (display_failure) {
...@@ -525,6 +526,7 @@ bool Copter::pre_arm_gps_checks(bool display_failure) ...@@ -525,6 +526,7 @@ bool Copter::pre_arm_gps_checks(bool display_failure)
} }
return false; return false;
} }
#endif
// check home and EKF origin are not too far // check home and EKF origin are not too far
if (far_from_EKF_origin(ahrs.get_home())) { if (far_from_EKF_origin(ahrs.get_home())) {
......
...@@ -28,6 +28,10 @@ static struct { ...@@ -28,6 +28,10 @@ static struct {
// should be called at 10hz // should be called at 10hz
void Copter::ekf_check() void Copter::ekf_check()
{ {
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
return;
#endif
// exit immediately if ekf has no origin yet - this assumes the origin can never become unset // exit immediately if ekf has no origin yet - this assumes the origin can never become unset
Location temp_loc; Location temp_loc;
if (!ahrs.get_origin(temp_loc)) { if (!ahrs.get_origin(temp_loc)) {
......
...@@ -171,6 +171,9 @@ void Copter::failsafe_terrain_set_status(bool data_ok) ...@@ -171,6 +171,9 @@ void Copter::failsafe_terrain_set_status(bool data_ok)
// terrain failsafe action // terrain failsafe action
void Copter::failsafe_terrain_on_event() void Copter::failsafe_terrain_on_event()
{ {
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
return;
#endif
failsafe.terrain = true; failsafe.terrain = true;
gcs_send_text(MAV_SEVERITY_CRITICAL,"Failsafe: Terrain data missing"); gcs_send_text(MAV_SEVERITY_CRITICAL,"Failsafe: Terrain data missing");
Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_TERRAIN, ERROR_CODE_FAILSAFE_OCCURRED); Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_TERRAIN, ERROR_CODE_FAILSAFE_OCCURRED);
......
...@@ -14,6 +14,9 @@ bool Copter::set_mode(control_mode_t mode, mode_reason_t reason) ...@@ -14,6 +14,9 @@ bool Copter::set_mode(control_mode_t mode, mode_reason_t reason)
// boolean to record if flight mode could be set // boolean to record if flight mode could be set
bool success = false; bool success = false;
bool ignore_checks = !motors.armed(); // allow switching to any mode if disarmed. We rely on the arming check to perform bool ignore_checks = !motors.armed(); // allow switching to any mode if disarmed. We rely on the arming check to perform
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
ignore_checks = true;
#endif
// return immediately if we are already in the desired mode // return immediately if we are already in the desired mode
if (mode == control_mode) { if (mode == control_mode) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment