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

Add mavlink support for GIMBAL_DEVICE_INFORMATION #20585

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

cmic0
Copy link
Contributor

@cmic0 cmic0 commented Nov 10, 2022

Please use PX4 Discuss or Discord to align on pull requests if necessary. You can then open draft pull requests to get early feedback.

Describe problem solved by this pull request

gimbal_device_information message has quite some fields like gimbal vendor, model and firmware version that become very important when operators need to check which firmware version/model is currently installed on the gimbal.
The only way to propagate this information to the GCS is by requesting the message when the GCS connects to the autopilot, however in the current implementation PX4 would not forward the message.

Looking at the protocol (https://mavlink.io/en/services/gimbal_v2.html) seems that this case was not taken into consideration, but on the other hand the message definition states that "This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE (https://mavlink.io/en/messages/common.html#GIMBAL_DEVICE_INFORMATION).

another option would be to include the GIMBAL_DEVICE_INFORMATION into the GIMBAL_MANAGER_INFORMATION.
@julianoes, what do you think about the above?

Describe your solution

Allow forwarding GIMBAL_DEVICE_INFORMATION when requested

Describe possible alternatives

A clear and concise description of alternative solutions or features you've considered.

Test data / coverage

How was it tested? What cases were covered? Logs uploaded to https://review.px4.io/ and screenshots of the important plot parts.

Additional context

Add any other related context or media.

@cmic0 cmic0 requested a review from julianoes November 10, 2022 13:27
@julianoes
Copy link
Contributor

I think this works but alternatively PX4 could also copy the info of the device into the manager message. Doesn't that work?

@cmic0
Copy link
Contributor Author

cmic0 commented Jan 3, 2023

I think this works but alternatively PX4 could also copy the info of the device into the manager message. Doesn't that work?

Yes that would work but we'd need to extend the GIMBAL_MANAGER_INFORMATION to include the new fields

@julianoes
Copy link
Contributor

Yes that would work but we'd need to extend the GIMBAL_MANAGER_INFORMATION to include the new fields

Feel free 😄

@cmic0
Copy link
Contributor Author

cmic0 commented Jun 13, 2023

For the sake of keeping entropy low, i'd just stick with allowing forwarding the GIMBAL_DEVICE_INFORMATION when requested, which would make it work as described in "This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE"

@cmic0
Copy link
Contributor Author

cmic0 commented Jun 13, 2023

let's get this in if no further objections :)

@tstastny tstastny force-pushed the pr-gimbal-device-info branch from e4ce100 to c6219be Compare June 21, 2023 07:50
@tstastny tstastny force-pushed the pr-gimbal-device-info branch from c6219be to 5f17dd8 Compare July 19, 2023 12:33
@tstastny
Copy link

@julianoes is this acceptable as is for now? we can look at follow up after unblocking the current form (e.g. looking into directly forwarding the mavlink message after receiving from gimbal - @cmic0 was not successful in getting this to work so far)

@julianoes
Copy link
Contributor

@julianoes is this acceptable as is for now?

Not sure. Do you really need the vendor information etc. for a gimbal that is integrated via PWM and not a MAVLink gimbal by itself? If you really need that then I guess this is acceptable.

@tstastny tstastny force-pushed the pr-gimbal-device-info branch from 5f17dd8 to a794fc2 Compare November 8, 2023 14:44
Copy link

@tstastny tstastny left a comment

Choose a reason for hiding this comment

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

I guess in the case that PX4 has "its own" gimbal, e.g. a PWM one, it would have to fake the gimbal device message as you suggest in this PR.

approving and merging in current form accordingly to unblock this case

@tstastny tstastny dismissed julianoes’s stale review November 8, 2023 16:01

unblocking operations now, can implement alternate approach in follow up once figured out how

@tstastny tstastny merged commit 457d261 into main Nov 8, 2023
@tstastny tstastny deleted the pr-gimbal-device-info branch November 8, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants