-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
AP_Mount:Add GIMBAL_MANAGER_SET_ATTITUDE support #23307
Conversation
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.
Seem about right.
2ac4292
to
70de1a7
Compare
@peterbarker @amilcarlucas Thanks for the suggestions. |
Sorry. I was thinking we can request review from two people at the same time. Please ignore this. |
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.
Looks good to me. After this is merged we should add a new item to the developer gimbal control page too. https://ardupilot.org/dev/docs/mavlink-gimbal-mount.html. Not critical of course though.
@rmackay9 okay will make a pull on wiki also afterward merging. |
I have a concern here that we are not treating this mavlink message in the same way that we treat the vehicle The basic difference between this implementation and the vehicle handling of |
I've merged the mavlink part of this. |
I've tested this on a T3v3 and it does control the gimbal. The attitude always takes precedent over the rate, so if your quaternion is valid you will come to that attitude as fast as the gimbal allows (pretty damned fast in the T3 case!) If you have an invalid quaternion then it honours the rates (I have not checked the rate directions). These were the MAVProxy commands I was using to test:
|
I suggest we ignore (and probably throw a warning periodically) if we ever receive a SET_GIMBAL_ATTITUDE message that has both the attitude and the rate set. We don't sensibly handle that case right now, so it's a reasonable precaution and will allow us to implement the same semantics as the vehicle equivalent at some stage. |
Re callers who provide both rate and angle controls, I think that for now at least the correct behaviour is what we have in this PR which is to consume the angle targets and ignore the rate targets. There are no gimbals that support accepting both at the same time so it's a bit different than what Leonard did with our attitude controllers. |
@peterbarker thanks very much for the review by the way! |
I'm suggesting we enforce that somehow so we don't run into problems when we do accept both later. It's only a couple of lines of code, pretty sure. |
70de1a7
to
d128768
Compare
OK, I don't think it's necessary but it's a team effort so maybe you can provide a suggestion on those few extra lines. |
d128768
to
0fa6fb0
Compare
I've rebased this on master after merging the mavlink submodule update. |
https://github.com/peterbarker/ardupilot/pull/new/pr/no-att-and-rate-together |
You could reject messages that provide both angle and rate. That way we wouldn't find ourselves in a situation where we start supporting both and break someone's system. |
@khanasif786 did you want to cherry-pick my suggested change? |
@peterbarker. Yeah I have added your commit. |
ad0a19c
to
17394cf
Compare
Looks like PeterB's suggestion had a little typo in it. So might need to fix that somehow. Maybe it is "is_nan()" instead of "isn_nan()"? |
…ATTITUDE this will allow us to support both at the same time into the future without worrying about how it might break existing callers.
17394cf
to
09382c6
Compare
Fixed. |
@rmackay9 if you're happy I'm happy now :-) |
@peterbarker @rmackay9 can it be merged? |
I've marked it for DevCall to make sure there's a deadline it gets discussed for merging. Randy may choose to merge earlier. |
Merged, thanks! |
Task from Gimbal enhancement list #20985
consumes GIMBAL_MANAGER_SET_ATTITUDE messages
This needs to be merged before it
#308