Camera Trigger Interface (Still Images)
-
System Image: 1.7.6-M0054-14.1a-perf
kernel: 4.19.125
platform: M0054
mach var: 1.0
voxl-suite: 1.2.0Good afternoon!
We're trying to configure a Voxl2 for use with 3 still image cameras, and I'm struggling to determine the best way to interface with the control pins and input pins (center-of-exposure) from the cameras.
I would ultimately prefer to use a GPIO pin interface directly from PX4, but that seems fairly unlike without major modifications at this point. However, it appears that the Mavlink Trigger Interface is also disabled. Does anyone know of a straightforward way to enable that interface? We will need to trigger multiple devices, but I can configure our control system to use a single output if needed.
Once the camera output is fixed, we will also need to determine the best course for input - this would also ideally go straight into PX4, to avoid the timing delay. We have the GPIO/Modem breakout board. Can you provide any guidance on this step?
Thanks!
-Nathan
-
Are you trying to synchronize all 3 cameras to capture the still images at the same time (so that center of exposure is the same for all cameras)? or do you just need the still images from the 3 cameras which are roughly taken around the desired (trigger) time?
Also, which cameras are you using and how are you grabbing the images from the camera server?
Alex
-
We are trying to trigger all three at the same time, but they will likely not all respond at the same time so we will need individual feedback. The cameras are controllable via physical pins, not through a software interface. They can be triggered via software (Sony SDK) but that is not something that works within the VOXL platform on it's own today, in my understanding, nor do we really want to go that way as it's been the source of delays in our experience (the Sony SDK for triggering, that is). The camera feedback, similarly, is a rising edge that must be received by some sort of GPIO. FWIW, we're using the LTE/IO expansion board.
We're getting the images directly from the camera after the fact via USB and the Sony SDK.
-Nathan
-
@Nathan-Sullivan-0 , it seems you just need to control GPIO to trigger the cameras. You have an expansion board, which is good. GPIOs can be controlled using standard Linux commands, see the following link:
https://docs.modalai.com/voxl2-linux-user-guide/#gpios
You will just need to pick the GPIO you want to use on your expansion board, set it output and control the state. Please pay attention to the following note :
the GPIO have an offest of 1100 (e.g. GPIO 84 = 1184)
echo out > /sys/class/gpio/gpio${GPIO}/direction #set output value (1 or 0) echo 0 > /sys/class/gpio/gpio${GPIO}/value echo 1 > /sys/class/gpio/gpio${GPIO}/value
Once you confirm that this is working manually, you should be able to set up PX4 to trigger this for you, although I personally do not know how to do it.
Please let me know if you have any other questions.
Alex
-
@Nathan-Sullivan-0 would you be willing to share your methods/code for using the Sony SDK? I have a similar application.
-
@Alex-Kushleyev we needed three outputs and three inputs, so we ended up using an entirely different board (an AVR system) connected to the VOXL2 via ttyHS1 through the expansion board, and that seems to be doing what we need, with the added benefit of the pulldown resistors being built into that control board. There is certainly something odd about the PX4 build on this unit, both in terms of available camera controls and GPS options, which is the next thing we're trying to tackle.
@restore unfotunately I'm under an NDA and can't say much about what we're doing with the Sony hardware, but I will say that their documented processes for the Raspberry Pi 4 also work on the Voxl2, as long as you have the USB3 available. Try not to use the SDK to trigger the camera though; the performance there isn't exactly consistent. The hardwired options (be it through the not-quite-USB port or the phsyical interface on something like an ILX-LR1) are rock solid, but as they're designed to be button-triggered, you'll need a resistor between your control board and some sort of transistor (2N222) and then control the actual interface with the transistor. Otherwise, the trigger input is looking for the output from its own source, which is an indeterminate voltage and will quite likely damage the VOXL. The transistor will take essentially whatever current you give it, so that resistor is also mandatory - 10kOhm works for me with the AVR 440 chip controlling it.