Triggering camera from missions with HereLink Seagull REC2 scripts

I’ve been using the excellent LUA script tyo control my camera using the HereLink from here - Seagull #REC2 Camera Controller Lua Script For Herelink

I’ve been trying to fly some planned mapping missions but have run into an issue, in that I can’t trigger the camera from a mission using that script.

Has anyone found a way to make this work as I would prefer to be able to do it all from the same setup, rather than having to change my setup for a mapping mission, then have to switch back for manually triggered mission?

I’ve been looking at the script itself, and I think it should be possible monitor another channel that is set as camera trigger in ArduCopter, and so effectively have two camera trigger options?

Seems I may have have been majorly over thinking this. I realised I just have to set my camera trigger to match what is set in the script and all will just work as it should :slight_smile:

If anyone knows of a way, I’d still be interested to know if the output can be read easily, I think the SRV_Channels:get_output_pwm(output_function) would work but I got erreos when I tried that. Thinking about it I was using a channel number, and should maybe have been using a function name?

I also wonder if its possible to read mavlink commands through a script as it would save having to read servo out commands?

I think you would have to get the script to read from the mapping mission when it needs the camera triggered then get the script to trigger the camera. That is the script would look at a button press and the mapping mission to know when to trigger the camera.
The experts I’m sure would know how the script could read the mapping mission camera trigger commands?
Anyone out there that could help???

Hi,

Did anyone from Herelink find a solution for this simple query !

Not to my knowledge. :frowning:

I’ve not had a chance to look at it recently really as was flying so I’ve just been manually swapping the camera trigger setting between that for the script and that for camera trigger in the missions.

I’ve got a bit of down time so want to look at it, but I’m fairly new to lua scripting, so it may be slow going

Now that I’m on holiday the weather has typically taken a turn for the rainier, but that does mean I’ve been able to look at the properly.

I couln’t see a way to intercept MavLink messages directly (probabaly my limited code knowledge) but by using an RC channel as normal for camera trigger and reading this I was able to trigger the camera from the QGC UI, and so this will also work for missions.

In my case, I have set the camera trigger to be Channel 7, using the setting below, though you could use any spare channel I expect
image

My updated version of the script is linked below
Seagull #REC2 V2.lua (13.9 KB)

I think because of the dwells in the script, there is going to be a lower limit to trigger intervals, but I think this is more limited by the camearas autofocus speed. I tested on the ground and I don;t expect there to be any issues if you have an interval of 2 seconds or more

That’s a good addition and thanks for that!