-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Fix: Stop gimbal from spinning when an angular velocity setpoint stream times out #23825
Conversation
Thanks @MaEtUgR. I'll review this asap with fresh eyes. FYI, some other open loop on gimbals that I ought to close:
|
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.
Two comments, otherwise it makes sense.
To enable implementing a timeout when there's no new setpoint coming in.
The gimbal would otherwise continue to spin with whatever velocity was commanded before the input connection was lost.
f8a1fc4
to
cb7a83f
Compare
I rebased on main and applied the suggestion #23825 (comment) |
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.
Tested on top of #23476, works for me, thanks!
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: |
Solved Problem
When an angular velocity setpoint (
gimbal_manager_set_manual_control
) stops streaming while still commanding non-zero velocity, the gimbal continues turning indefinitely.Context:
I found this when working with a gimbal that can be steered by a lever but also a "level out" button it's crucial to not constantly send the lever-based angular velocity setpoint (
gimbal_manager_set_manual_control
) because that overrides any button-based attitude setpoint (gimbal_manager_set_attitude
) immediately again. Solution: only send angular velocity setpoints when the lever is actually deflected and stop sending them when they are zero. But what happens if you lose connection?Solution
Changelog Entry
Alternatives
@julianoes I'm eager to find out if you have any better idea or implementation architecture in mind to solve this problem.
Test coverage
I tested using MAVLink gimbal V2 as in- and output. I mapped a lever to gimbal pitch-rate and shut the input MAVLink connection while the lever was deflected and gimbal moving. Before the change it would continue spinning indefinitely, with my pr there is no update anymore for 2 seconds and then there is one single update that commands the gimbal to 0 pitch-rate and it stops. Note: When I tried NAN that caused the gimbal to reset its orientation which I consider undesired e.g. during connection dropouts.