mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
navigator/follow_target remove unused
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user