Browse Source

Fixedwing: Enable loiter mode, tested in HIL

sbg
Julian Oes 11 years ago
parent
commit
c75c5a5f30
  1. 3
      src/modules/commander/commander.cpp
  2. 2
      src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp

3
src/modules/commander/commander.cpp

@ -1539,7 +1539,8 @@ check_navigation_state_machine(struct vehicle_status_s *status, struct vehicle_c @@ -1539,7 +1539,8 @@ check_navigation_state_machine(struct vehicle_status_s *status, struct vehicle_c
// TODO AUTO_LAND handling
if (status->navigation_state == NAVIGATION_STATE_AUTO_TAKEOFF) {
/* don't switch to other states until takeoff not completed */
if (local_pos->z > -takeoff_alt || status->condition_landed) {
// XXX: only respect the condition_landed when the local position is actually valid
if (status->condition_local_altitude_valid && (local_pos->z > -takeoff_alt || status->condition_landed)) {
return TRANSITION_NOT_CHANGED;
}
}

2
src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp

@ -711,7 +711,7 @@ FixedwingPositionControl::control_position(const math::Vector2f &current_positio @@ -711,7 +711,7 @@ FixedwingPositionControl::control_position(const math::Vector2f &current_positio
_tecs.set_speed_weight(_parameters.speed_weight);
/* execute navigation once we have a setpoint */
if (_setpoint_valid) {
if (_setpoint_valid && _control_mode.flag_control_auto_enabled) {
/* current waypoint (the one currently heading for) */
math::Vector2f curr_wp(global_triplet.current.lat / 1e7f, global_triplet.current.lon / 1e7f);

Loading…
Cancel
Save