Skip to content
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

Gimbal: add angular rate test and fix deg/rad input #23476

Merged
merged 5 commits into from
Oct 30, 2024
Merged

Conversation

julianoes
Copy link
Contributor

@julianoes julianoes commented Aug 1, 2024

This adds a test to test angular rate input, not just angles.

Also, this fixes MAVLink angular rate input which is in degrees but needs conversion to radians.
At least this second part should probably be backported to v1.15.

Also, make sure to forward gimbal traffic in SITL as it is required for proper discovery of a MAVLink gimbal.

Tested in SITL using typhoon_h480 model

@github-actions github-actions bot added the stale label Sep 1, 2024
@julianoes julianoes force-pushed the pr-gimbal-test-rates branch from bb3d57e to bceb669 Compare October 17, 2024 00:55
@julianoes julianoes requested a review from bkueng October 17, 2024 00:55
@julianoes
Copy link
Contributor Author

Probably should have merged this months ago...

bkueng
bkueng previously approved these changes Oct 25, 2024
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, makes sense

@@ -568,5 +618,6 @@ Test the output by setting a angles (all omitted axes are set to 0):
PRINT_MODULE_USAGE_ARG("<sysid> <compid>", "MAVLink system ID and MAVLink component ID", false);
PRINT_MODULE_USAGE_COMMAND_DESCR("test", "Test the output: set a fixed angle for one or multiple axes (gimbal must be running)");
PRINT_MODULE_USAGE_ARG("roll|pitch|yaw <angle>", "Specify an axis and an angle in degrees", false);
PRINT_MODULE_USAGE_ARG("rollrate|pitchrate|yawrate <angle rate>", "Specify an axis and an angle rate in degrees / second", false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module docs ci fails to extract the yawrate here.
We should make sure this split also splits by space: https://github.com/PX4/PX4-Autopilot/blob/main/Tools/px4moduledoc/srcparser.py#L445

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I don't quite understand why but it seems to fix the issue indeed :).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a simple consistency check that parses the module docs and tries to ensure all parsed arguments in the code are actually documented.

This is handy to test angular rate input, not just angles.
The command is in degrees, but the rest in radians.

Also, set roll to NAN, rather than 0 when not set.
A gimbal user needs to be able to receive gimbal device messages such as
GIMBAL_DEVICE_INFORMATION. Therefore, we need to forward this MAVLink
instance.
This is required in the case where there are 3 commands on one line.
@julianoes julianoes force-pushed the pr-gimbal-test-rates branch from 2721994 to 26f6a07 Compare October 30, 2024 03:47
@bkueng bkueng merged commit 951c981 into main Oct 30, 2024
56 of 57 checks passed
@bkueng bkueng deleted the pr-gimbal-test-rates branch October 30, 2024 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants