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

[Bug] Mission camera commands should target specified component #23083

Open
hamishwillee opened this issue May 2, 2024 · 0 comments
Open

[Bug] Mission camera commands should target specified component #23083

hamishwillee opened this issue May 2, 2024 · 0 comments

Comments

@hamishwillee
Copy link
Contributor

Describe the bug

void Navigator::publish_vehicle_cmd(vehicle_command_s *vcmd) in https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/navigator/navigator_main.cpp emits camera commands found in missions to MAVLink network, targeting same system (correct) and component id 100.

That assumes a single mavlink camera is attached, and that it uses the first camera-allocated ID. From a mavlink perspective that is wrong because those ids are suggestions for component IDs. Historically it should be 0 "broadcast".

Now the component id should be set according to the value of the camera command id parameter. For example, https://mavlink.io/en/messages/common.html#MAV_CMD_IMAGE_START_CAPTURE , param 1 is:

Target camera ID. 7 to 255: MAVLink camera component id. 1 to 6 for cameras that don't have a distinct component id (such as autopilot-attached cameras). 0: all cameras. This is used to specifically target autopilot-connected cameras or individual sensors in a multi-sensor MAVLink camera. It is also used to target specific cameras when the MAV_CMD is used in a mission

So I would expect the component id to simply use whatever this says. If the value is 1 to 6 it should swallow the command being emitted. It would ideally also trigger the pins, but that would be up to the camera trigger driver (separate)

There are a number of other messages that also have this id.

This approach allows targetting of multiple cameras.

To Reproduce

Look at the code.

Expected behavior

Emitted camera messages should target indicated cameras.

Screenshot / Media

No response

Flight Log

Not relevant.

Software Version

main / all

Flight controller

NA

Vehicle type

Multicopter

How are the different components wired up (including port information)

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant