Example #1
0
void
NavigatorMode::run(bool active)
{
	if (active) {
		if (!_active) {
			/* first run, reset stay in failsafe flag */
			_navigator->get_mission_result()->stay_in_failsafe = false;
			_navigator->set_mission_result_updated();
			on_activation();

		} else {
			/* periodic updates when active */
			on_active();
		}

	} else {
		/* periodic updates when inactive */
		if (_active) {
			on_inactivation();

		} else {
			on_inactive();
		}
	}

	_active = active;
}
Example #2
0
NavigatorMode::NavigatorMode(Navigator *navigator, const char *name) :
	SuperBlock(navigator, name),
	_navigator(navigator),
	_active(false)
{
	/* set initial mission items */
	on_inactivation();
	on_inactive();
}
Example #3
0
EngineFailure::EngineFailure(Navigator *navigator, const char *name) :
	MissionBlock(navigator, name),
	_ef_state(EF_STATE_NONE)
{
	/* load initial params */
	updateParams();
	/* initial reset */
	on_inactive();
}
Example #4
0
RCLoss::RCLoss(Navigator *navigator, const char *name) :
	MissionBlock(navigator, name),
	_param_loitertime(this, "LT"),
	_rcl_state(RCL_STATE_NONE)
{
	/* load initial params */
	updateParams();
	/* initial reset */
	on_inactive();
}
NavigatorMode::NavigatorMode(Navigator *navigator, const char *name) :
    SuperBlock(navigator, name),
    _navigator(navigator),
    _first_run(true)
{
    /* load initial params */
    updateParams();
    /* set initial mission items */
    on_inactive();
}
Example #6
0
RTL::RTL(Navigator *navigator, const char *name) :
    MissionBlock(navigator, name),
    _rtl_state(RTL_STATE_NONE),
    _param_return_alt(this, "RETURN_ALT"),
    _param_descend_alt(this, "DESCEND_ALT"),
    _param_land_delay(this, "LAND_DELAY")
{
    /* load initial params */
    updateParams();
    /* initial reset */
    on_inactive();
}
Example #7
0
RCRecover::RCRecover(Navigator *navigator, const char *name) :
	MissionBlock(navigator, name),
	_state(RCRECOVER_STATE_NONE),
	_start_lock(false),
	_param_rtl_delay(this, "RCRCVR_RTL_DELAY", false)
{
	// load initial params
	updateParams();
	
	// initial reset
	on_inactive();
}
Example #8
0
GpsFailure::GpsFailure(Navigator *navigator, const char *name) :
	MissionBlock(navigator, name),
	_param_loitertime(this, "LT"),
	_param_openlooploiter_roll(this, "R"),
	_param_openlooploiter_pitch(this, "P"),
	_param_openlooploiter_thrust(this, "TR"),
	_gpsf_state(GPSF_STATE_NONE),
	_timestamp_activation(0)
{
	/* load initial params */
	updateParams();
	/* initial reset */
	on_inactive();
}
Example #9
0
RTL::RTL(Navigator *navigator, const char *name) :
	MissionBlock(navigator, name),
	_rtl_state(RTL_STATE_NONE),
	_param_return_alt(this, "RTL_RETURN_ALT", false),
	_param_min_loiter_alt(this, "MIS_LTRMIN_ALT", false),
	_param_descend_alt(this, "RTL_DESCEND_ALT", false),
	_param_land_delay(this, "RTL_LAND_DELAY", false),
	_param_rtl_min_dist(this, "RTL_MIN_DIST", false)
{
	/* load initial params */
	updateParams();
	/* initial reset */
	on_inactive();
}
Example #10
0
DataLinkLoss::DataLinkLoss(Navigator *navigator, const char *name) :
	MissionBlock(navigator, name),
	_param_commsholdwaittime(this, "CH_T"),
	_param_commsholdlat(this, "CH_LAT"),
	_param_commsholdlon(this, "CH_LON"),
	_param_commsholdalt(this, "CH_ALT"),
	_param_airfieldhomelat(this, "NAV_AH_LAT", false),
	_param_airfieldhomelon(this, "NAV_AH_LON", false),
	_param_airfieldhomealt(this, "NAV_AH_ALT", false),
	_param_airfieldhomewaittime(this, "AH_T"),
	_param_numberdatalinklosses(this, "N"),
	_param_skipcommshold(this, "CHSK"),
	_dll_state(DLL_STATE_NONE)
{
	/* load initial params */
	updateParams();
	/* initial reset */
	on_inactive();
}