mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 18:03:33 +08:00
Navigator remove unnecessary calls to updateParams
- the SuperBlock already does this
This commit is contained in:
committed by
Lorenz Meier
parent
6227139df1
commit
25c7a03a8b
@@ -60,28 +60,11 @@ constexpr float FollowTarget::_follow_position_matricies[4][9];
|
||||
|
||||
FollowTarget::FollowTarget(Navigator *navigator, const char *name) :
|
||||
MissionBlock(navigator, name),
|
||||
_navigator(navigator),
|
||||
_param_min_alt(this, "NAV_MIN_FT_HT", false),
|
||||
_param_tracking_dist(this, "NAV_FT_DST", false),
|
||||
_param_tracking_side(this, "NAV_FT_FS", false),
|
||||
_param_tracking_resp(this, "NAV_FT_RS", false),
|
||||
_param_yaw_auto_max(this, "MC_YAWRAUTO_MAX", false),
|
||||
_follow_target_state(SET_WAIT_FOR_TARGET_POSITION),
|
||||
_follow_target_position(FOLLOW_FROM_BEHIND),
|
||||
_follow_target_sub(-1),
|
||||
_step_time_in_ms(0.0f),
|
||||
_follow_offset(OFFSET_M),
|
||||
_target_updates(0),
|
||||
_last_update_time(0),
|
||||
_current_target_motion(),
|
||||
_previous_target_motion(),
|
||||
_yaw_rate(0.0F),
|
||||
_responsiveness(0.0F),
|
||||
_yaw_auto_max(0.0F),
|
||||
_yaw_angle(0.0F)
|
||||
_param_tracking_resp(this, "NAV_FT_RS", false)
|
||||
{
|
||||
_current_target_motion = {};
|
||||
_previous_target_motion = {};
|
||||
_current_vel.zero();
|
||||
_step_vel.zero();
|
||||
_est_target_vel.zero();
|
||||
@@ -90,10 +73,6 @@ FollowTarget::FollowTarget(Navigator *navigator, const char *name) :
|
||||
_target_position_delta.zero();
|
||||
}
|
||||
|
||||
FollowTarget::~FollowTarget()
|
||||
{
|
||||
}
|
||||
|
||||
void FollowTarget::on_inactive()
|
||||
{
|
||||
reset_target_validity();
|
||||
@@ -105,8 +84,6 @@ void FollowTarget::on_activation()
|
||||
|
||||
_responsiveness = math::constrain((float) _param_tracking_resp.get(), .1F, 1.0F);
|
||||
|
||||
_yaw_auto_max = math::radians(_param_yaw_auto_max.get());
|
||||
|
||||
_follow_target_position = _param_tracking_side.get();
|
||||
|
||||
if ((_follow_target_position > FOLLOW_FROM_LEFT) || (_follow_target_position < FOLLOW_FROM_RIGHT)) {
|
||||
@@ -230,11 +207,7 @@ void FollowTarget::on_active()
|
||||
_current_target_motion.lat,
|
||||
_current_target_motion.lon);
|
||||
|
||||
_yaw_rate = (_yaw_angle - _navigator->get_global_position()->yaw) / (dt_ms / 1000.0F);
|
||||
|
||||
_yaw_rate = _wrap_pi(_yaw_rate);
|
||||
|
||||
_yaw_rate = math::constrain(_yaw_rate, -1.0F * _yaw_auto_max, _yaw_auto_max);
|
||||
_yaw_rate = _wrap_pi((_yaw_angle - _navigator->get_global_position()->yaw) / (dt_ms / 1000.0f));
|
||||
|
||||
} else {
|
||||
_yaw_angle = _yaw_rate = NAN;
|
||||
|
||||
Reference in New Issue
Block a user