navigator/follow_target remove unused

This commit is contained in:
Daniel Agar
2017-06-05 18:16:30 -04:00
parent d6e9287f51
commit 3b7e57a5b2

View File

@@ -179,26 +179,18 @@ void FollowTarget::on_active()
dt_ms = ((_current_target_motion.timestamp - _previous_target_motion.timestamp) / 1000);
// ignore a small dt
if (dt_ms > 10.0F) {
math::Vector<3> prev_position_delta = _target_position_delta;
// get last gps known reference for target
map_projection_init(&target_ref, _previous_target_motion.lat, _previous_target_motion.lon);
// calculate distance the target has moved
map_projection_project(&target_ref, _current_target_motion.lat, _current_target_motion.lon,
&(_target_position_delta(0)), &(_target_position_delta(1)));
// update the average velocity of the target based on the position
_est_target_vel = _target_position_delta / (dt_ms / 1000.0f);
// if the target is moving add an offset and rotation
if (_est_target_vel.length() > .5F) {
_target_position_offset = _rot_matrix * _est_target_vel.normalized() * _follow_offset;
}