-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dds yaw control plane #26143
base: master
Are you sure you want to change the base?
Dds yaw control plane #26143
Changes from all commits
3c8b13c
4696b11
3bd3248
72fa233
0857408
79f7439
eb73a10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -884,6 +884,24 @@ bool Plane::set_target_location(const Location &target_loc) | |
plane.set_guided_WP(loc); | ||
return true; | ||
} | ||
|
||
bool Plane::set_target_yaw_rate(const float yaw_rate) | ||
{ | ||
if (plane.control_mode != &plane.mode_guided) { | ||
// only accept yaw rate updates when in GUIDED mode | ||
return false; | ||
} | ||
|
||
const auto direction_is_ccw = yaw_rate < 0; | ||
if (!is_zero(yaw_rate)) { | ||
auto const speed = plane.ahrs.groundspeed(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using ground speed here might result in funny shape circles in wind, but maybe that is OK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In-fact, |
||
auto const radius = speed / yaw_rate; | ||
plane.mode_guided.set_radius_and_direction(abs(radius), direction_is_ccw); | ||
} else { | ||
plane.mode_guided.set_radius_and_direction(0.0, true); | ||
} | ||
return true; | ||
} | ||
#endif //AP_SCRIPTING_ENABLED || AP_EXTERNAL_CONTROL_ENABLED | ||
|
||
#if AP_SCRIPTING_ENABLED | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,6 +366,12 @@ bool Vector3<T>::is_nan(void) const | |
return isnan(x) || isnan(y) || isnan(z); | ||
} | ||
|
||
template <typename T> | ||
bool Vector3<T>::is_all_nan(void) const | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this begs to have a ::is_any_nan() too |
||
{ | ||
return isnan(x) && isnan(y) && isnan(z); | ||
} | ||
|
||
template <typename T> | ||
bool Vector3<T>::is_inf(void) const | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd like a comment on what the intention is with coordinated turns. I would expected we would implement it with roll and coordinated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"A configured yaw rate of 2* pi / 30 will result in a complete circle in 30 seconds."