mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 07:03:34 +08:00
vehicle_local_position: rename yaw -> heading and add reset logic
- vehicle_global_position yaw removed (redundant)
This commit is contained in:
committed by
Mathieu Bresciani
parent
33fb9d0c62
commit
97fc1db768
@@ -196,7 +196,7 @@ void FollowTarget::on_active()
|
||||
_current_target_motion.lat,
|
||||
_current_target_motion.lon);
|
||||
|
||||
_yaw_rate = wrap_pi((_yaw_angle - _navigator->get_global_position()->yaw) / (dt_ms / 1000.0f));
|
||||
_yaw_rate = wrap_pi((_yaw_angle - _navigator->get_local_position()->heading) / (dt_ms / 1000.0f));
|
||||
|
||||
} else {
|
||||
_yaw_angle = _yaw_rate = NAN;
|
||||
@@ -229,7 +229,7 @@ void FollowTarget::on_active()
|
||||
// 3 degrees of facing target
|
||||
|
||||
if (PX4_ISFINITE(_yaw_rate)) {
|
||||
if (fabsf(fabsf(_yaw_angle) - fabsf(_navigator->get_local_position()->yaw)) < math::radians(3.0F)) {
|
||||
if (fabsf(fabsf(_yaw_angle) - fabsf(_navigator->get_local_position()->heading)) < math::radians(3.0F)) {
|
||||
_yaw_rate = NAN;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user