if V_RCL_LT < 0 go directly to termination

This commit is contained in:
Thomas Gubler 2014-09-07 15:31:58 +02:00
parent 21009e89a4
commit a8239b2c45
2 changed files with 13 additions and 5 deletions

View File

@ -153,10 +153,17 @@ RCLoss::advance_rcl()
{
switch (_rcl_state) {
case RCL_STATE_NONE:
/* Check the number of data link losses. If above home fly home directly */
warnx("RC loss, OBC mode, loiter");
mavlink_log_info(_navigator->get_mavlink_fd(), "#audio: rc loss, loitering");
_rcl_state = RCL_STATE_LOITER;
if (_param_loitertime.get() > 0.0f) {
warnx("RC loss, OBC mode, loiter");
mavlink_log_info(_navigator->get_mavlink_fd(), "#audio: rc loss, loitering");
_rcl_state = RCL_STATE_LOITER;
} else {
warnx("RC loss, OBC mode, slip loiter, terminate");
mavlink_log_info(_navigator->get_mavlink_fd(), "#audio: rc loss, terminating");
_rcl_state = RCL_STATE_TERMINATE;
_navigator->get_mission_result()->stay_in_failsafe = true;
_navigator->publish_mission_result();
}
break;
case RCL_STATE_LOITER:
_rcl_state = RCL_STATE_TERMINATE;

View File

@ -51,9 +51,10 @@
* Loiter Time
*
* The amount of time in seconds the system should loiter at current position before termination
* Set to -1 to make the system skip loitering
*
* @unit seconds
* @min 0.0
* @min -1.0
* @group RCL
*/
PARAM_DEFINE_FLOAT(NAV_RCL_LT, 120.0f);