Parameter update - Rename variables in modules/navigator

using parameter_update.py script
This commit is contained in:
bresch
2019-04-03 15:38:50 +02:00
committed by Matthias Grob
parent e575f032e4
commit f3990c84fc
18 changed files with 116 additions and 116 deletions
+10 -10
View File
@@ -118,7 +118,7 @@ PrecLand::on_active()
_target_pose_valid = true;
}
if ((hrt_elapsed_time(&_target_pose.timestamp) / 1e6f) > _param_timeout.get()) {
if ((hrt_elapsed_time(&_target_pose.timestamp) / 1e6f) > _param_pld_btout.get()) {
_target_pose_valid = false;
}
@@ -203,7 +203,7 @@ PrecLand::run_state_start()
}
// if we don't see the target after 1 second, search for it
if (_param_search_timeout.get() > 0) {
if (_param_pld_srch_tout.get() > 0) {
if (hrt_absolute_time() - _point_reached_time > 2000000) {
if (!switch_to_state_search()) {
@@ -353,7 +353,7 @@ PrecLand::run_state_search()
}
// check if search timed out and go to fallback
if (hrt_absolute_time() - _state_start_time > _param_search_timeout.get()*SEC2USEC) {
if (hrt_absolute_time() - _state_start_time > _param_pld_srch_tout.get()*SEC2USEC) {
PX4_WARN("Search timed out");
if (!switch_to_state_fallback()) {
@@ -434,7 +434,7 @@ PrecLand::switch_to_state_search()
vehicle_local_position_s *vehicle_local_position = _navigator->get_local_position();
position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
pos_sp_triplet->current.alt = vehicle_local_position->ref_alt + _param_search_alt.get();
pos_sp_triplet->current.alt = vehicle_local_position->ref_alt + _param_pld_srch_alt.get();
pos_sp_triplet->current.type = position_setpoint_s::SETPOINT_TYPE_POSITION;
_navigator->set_position_setpoint_triplet_updated();
@@ -475,14 +475,14 @@ bool PrecLand::check_state_conditions(PrecLandState state)
switch (state) {
case PrecLandState::Start:
return _search_cnt <= _param_max_searches.get();
return _search_cnt <= _param_pld_max_srch.get();
case PrecLandState::HorizontalApproach:
// if we're already in this state, only want to make it invalid if we reached the target but can't see it anymore
if (_state == PrecLandState::HorizontalApproach) {
if (fabsf(_target_pose.x_abs - vehicle_local_position->x) < _param_hacc_rad.get()
&& fabsf(_target_pose.y_abs - vehicle_local_position->y) < _param_hacc_rad.get()) {
if (fabsf(_target_pose.x_abs - vehicle_local_position->x) < _param_pld_hacc_rad.get()
&& fabsf(_target_pose.y_abs - vehicle_local_position->y) < _param_pld_hacc_rad.get()) {
// we've reached the position where we last saw the target. If we don't see it now, we need to do something
return _target_pose_valid && _target_pose.abs_pos_valid;
@@ -511,13 +511,13 @@ bool PrecLand::check_state_conditions(PrecLandState state)
} else {
// if not already in this state, need to be above target to enter it
return _target_pose_updated && _target_pose.abs_pos_valid
&& fabsf(_target_pose.x_abs - vehicle_local_position->x) < _param_hacc_rad.get()
&& fabsf(_target_pose.y_abs - vehicle_local_position->y) < _param_hacc_rad.get();
&& fabsf(_target_pose.x_abs - vehicle_local_position->x) < _param_pld_hacc_rad.get()
&& fabsf(_target_pose.y_abs - vehicle_local_position->y) < _param_pld_hacc_rad.get();
}
case PrecLandState::FinalApproach:
return _target_pose_valid && _target_pose.abs_pos_valid
&& (_target_pose.z_abs - vehicle_local_position->z) < _param_final_approach_alt.get();
&& (_target_pose.z_abs - vehicle_local_position->z) < _param_pld_fappr_alt.get();
case PrecLandState::Search:
return true;