-
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
Conversation
|
||
/* | ||
Sets only the target yaw rate | ||
Yaw is in earth frame, NED [rad/s] |
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."
e13b7d9
to
81b0a5d
Compare
81b0a5d
to
bdb9f43
Compare
8ec60a5
to
727c640
Compare
* Used when the whole vector being NaN is significant
* Used in DDS External Control
* And add const to external control * This method bypasses the loiter controller
727c640
to
eb73a10
Compare
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 would have expected the loiter center to also be re-set when the command is sent. Depending on the turn direction the center would be to the left or right of the current location by the loiter radius.
|
||
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
In-fact, set_radius_and_direction
does not change the center of the loiter point, so it might do quite odd things.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this begs to have a ::is_any_nan() too
Purpose
Add lower level controls ability for turn rate on Plane when using DDS that isn't tied to a waypoint loiter (ideally).
Usage
ros2 topic pub /ap/cmd_vel geometry_msgs/msg/TwistStamped "{header: {frame_id: base_link}, twist: {linear: {x: .nan, y: .nan, z: .nan}, angular: {z: -0.01}}}" --once
Problem
Seems like the navigation mode is overriding the lower level commands. I need to find a way to bypass it. Tips are appreciated.
Edit: It was suggested to make a patch to mode_guided if the yaw is set, then L1 needs to be bypassed. This wasn't necessary, it was an unrelated scaling issue.
Related
https://github.com/mavlink/mavlink/pull/2020/files#diff-9ef151b30f09d6d4f130434d941db479c3411ec15eca23580c5587b2c3b59ecdR5609
Mavlink body yaw rate
https://mavlink.io/en/messages/common.html#SET_ATTITUDE_TARGET