Navigator: Only update params as they change

This commit is contained in:
Lorenz Meier
2017-02-22 23:48:38 +01:00
parent ecb2511a7b
commit ad3d0391ab
8 changed files with 5 additions and 19 deletions

View File

@@ -93,7 +93,6 @@ void
DataLinkLoss::on_activation()
{
_dll_state = DLL_STATE_NONE;
updateParams();
advance_dll();
set_dll_item();
}
@@ -102,7 +101,6 @@ void
DataLinkLoss::on_active()
{
if (is_mission_item_reached()) {
updateParams();
advance_dll();
set_dll_item();
}

View File

@@ -96,9 +96,6 @@ EngineFailure::set_ef_item()
{
struct position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
/* make sure we have the latest params */
updateParams();
set_previous_pos_setpoint();
_navigator->set_can_loiter_at_sp(false);

View File

@@ -100,8 +100,6 @@ void FollowTarget::on_inactive()
void FollowTarget::on_activation()
{
updateParams();
_follow_offset = _param_tracking_dist.get() < 1.0F ? 1.0F : _param_tracking_dist.get();
_responsiveness = math::constrain((float) _param_tracking_resp.get(), .1F, 1.0F);

View File

@@ -89,7 +89,6 @@ GpsFailure::on_activation()
{
_gpsf_state = GPSF_STATE_NONE;
_timestamp_activation = hrt_absolute_time();
updateParams();
advance_gpsf();
set_gpsf_item();
}
@@ -160,8 +159,6 @@ GpsFailure::set_gpsf_item()
void
GpsFailure::advance_gpsf()
{
updateParams();
switch (_gpsf_state) {
case GPSF_STATE_NONE:
_gpsf_state = GPSF_STATE_LOITER;

View File

@@ -444,9 +444,6 @@ Mission::get_absolute_altitude_for_item(struct mission_item_s &mission_item)
void
Mission::set_mission_items()
{
/* make sure param is up to date */
updateParams();
/* reset the altitude foh (first order hold) logic, if altitude foh is enabled (param) a new foh element starts now */
altitude_sp_foh_reset();

View File

@@ -278,6 +278,11 @@ Navigator::params_update()
{
parameter_update_s param_update;
orb_copy(ORB_ID(parameter_update), _param_update_sub, &param_update);
updateParams();
if (_navigation_mode) {
_navigation_mode->updateParams();
}
}
void
@@ -413,7 +418,6 @@ Navigator::task_main()
if (updated) {
params_update();
updateParams();
}
/* vehicle control mode updated */

View File

@@ -83,7 +83,6 @@ void
RCLoss::on_activation()
{
_rcl_state = RCL_STATE_NONE;
updateParams();
advance_rcl();
set_rcl_item();
}
@@ -92,7 +91,6 @@ void
RCLoss::on_active()
{
if (is_mission_item_reached()) {
updateParams();
advance_rcl();
set_rcl_item();
}

View File

@@ -136,9 +136,6 @@ RTL::set_rtl_item()
{
struct position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
/* make sure we have the latest params */
updateParams();
if (!_rtl_start_lock) {
set_previous_pos_setpoint();
}