PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.5k stars 13.51k forks source link

Camera capture feedback not working for Pixhawk4 #18812

Closed Jaeyoung-Lim closed 3 months ago

Jaeyoung-Lim commented 2 years ago

Describe the bug I am trying to get camera capture feedback from a hot shoe of a Sony A7R (image below)

Pixhawk FMUv5x boards use the board-specific camera capture pin (PI0). Other board use FMU PWM pin 6 (hardcoded) for camera capture.

According to the documentation, the FMU PWM pin 6 is hardcoded for camera capture for the Pixhawk4

However, this is quite confusing since Pixhawk4 actually has a dedicated CAP pin that is available.

I have tried wiring the hotshoe feedback to

But both of them don't work

To Reproduce Steps to reproduce the behavior:

  1. Wire the hotshoe adaptor to the pixhawk
  2. Run fake_gps start in the mavlink console
  3. Trigger the camera with QGC and not feedback is not captured

Expected behavior The hotshoe triggers the camera capture to keep track of precise timing of when the images are taken

Log Files and Screenshots Through the mavlink console;

nsh> camera_capture status
INFO  [camera_capture] Capture enabled : NO
INFO  [camera_capture] Frame sequence : 0
INFO  [camera_capture] No trigger yet
INFO  [camera_capture] Number of overflows : 0

But when trying to enable capture manually,

nsh> camera_capture on
ERROR [camera_capture] open fail

which means that it is failing in https://github.com/PX4/PX4-Autopilot/blob/1c6b1f755447ee64f46cdb89c9ad916d87707710/src/drivers/pwm_out/PWMOut.cpp#L1137

Additional Context

RomanBapst commented 2 years ago

@Jaeyoung-Lim Thanks for reporting Jay. I actually tried this on a Pixhawk 4 mini today and also did not get any good results. I can confirm that FMU pin 6 seems to be the capture pin. The other pins labeled "capture" seem quite tempting but rather useless (at least with the default configuration). I'll dig into this a bit.