ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.26k stars 16.87k forks source link

AP_Camera: 2nd camera should use different PWM output #27015

Open rmackay9 opened 2 months ago

rmackay9 commented 2 months ago

Similar to https://github.com/ArduPilot/ardupilot/issues/23164, if two camera servo backends are setup (e.g. CAM1_TYPE=1, CAM2_TYPE=1) then they should use different PWM outputs. Currently they will both output to any SERVOx_FUNCTION = 10 (CameraTrigger).

There are two possible solutions:

  1. create a new servo function called something like "Camera2Trigger" or "CameraTrigger2"
  2. enhance SRV_FUNCTION library so that a caller can get just the X instance of the servo output. Then camera1 could use the first instance (e.g. the one with the lower servo output) and camera2 could use the 2nd.

This issue was brought up on this 4.5 discussion https://discuss.ardupilot.org/t/separate-cam1-and-cam2-triggering/117468

Ryanf55 commented 2 months ago

Would you like a multi-cam gazebo simulator set up to develop this against, or do you have hardware capable of doing it?

rmackay9 commented 2 months ago

Hi @Ryanf55,

Thanks for the kind offer! I think it's actually fairly straight forward to test even without the real hardware though.