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

camera_manager_plugin: fix mavlink messages for camera info and video stream information #1051

Merged
merged 4 commits into from
Aug 9, 2024

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Aug 7, 2024

Problem

Can't update MAVLink in PX4 anymore because of
mavlink/mavlink#2121
mavlink/mavlink#2127
which are not breaking changes but because of the way they are invoked here end up breaking the build
which makes CI in PX4/PX4-Autopilot#23490 fail.

Solution

Like proposed by @dagar this time I fix it with the struct call instead of the direct pack_chan() calls. So it should hold longer.

Please check if I did any mistake with these string, component ID and MAVLink channel things. What was MAVLINK_COMM_1 used for?

… stream information

This time with structs instead of the direct pack_chan() calls that might break again quickly.
@MaEtUgR MaEtUgR requested a review from dagar August 7, 2024 18:20
@MaEtUgR MaEtUgR self-assigned this Aug 7, 2024
video_stream_information.hfov = 90; // made up
std::strcpy(video_stream_information.name, "Visual Spectrum");
std::strcpy(video_stream_information.uri, _videoURI.c_str());

Choose a reason for hiding this comment

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

Note, there is a new encoding field, which ideally you should set to VIDEO_STREAM_ENCODING_H264. If you don't it won't matter because the default value 0 means "don't know" and the recipient should detect. This is to reduce effort on recipient as cameras start to encode in H265.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

You're probably right, didn't even check what should be set in the extension 😇
I added it in 357396f

This will probably make CI fail again because the extension does not yet exist on PX4 main until PX4/PX4-Autopilot#23490 is merged...

@dagar
Copy link
Member

dagar commented Aug 8, 2024

The build on this side is broken.
Maybe just skip touching this unused field?
Screenshot 2024-08-07 at 9 22 49 PM

@hamishwillee
Copy link

FYI @julianoes This is touching the new camera ids.

@julianoes
Copy link
Contributor

FYI: you can always just set extensions to 0 if you don't want to do the work to use them yet.

MaEtUgR added 2 commits August 8, 2024 14:57
…ncpy with destination size, set H264 encoding
I don't understand if and why it's necessary but found a way to do it with the struct encode method.
@dagar
Copy link
Member

dagar commented Aug 9, 2024

Let's skip the new fields and get this through.

image

@dagar dagar merged commit f1d11a6 into main Aug 9, 2024
2 of 5 checks passed
@dagar dagar deleted the fix-camera-manager-mavlink branch August 9, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants