System designHow-to

Apply camera trigger settings at startup without driver support

Apply trigger settings at startup when the driver has no launch parameters: save a user set, order line, mode and source calls, and read back each value.

LumaSpec Vision8 min read Share on LinkedIn

On this page 9 sections
  1. 01The settings the services control
  2. 02The order that works
  3. 03Step by step: make it come up configured
  4. 04Where the launch file runs
  5. 05Worked example: first-frame timeout at a 9 fps trigger ceiling
  6. 06When the saved user set is not enough
  7. 07Checklist before you ship
  8. 08Start the configuration
  9. 09Questions

Your driver exposes a service for every trigger setting — line mode, trigger mode, trigger source — but no launch-file parameter for any of them, so an externally triggered station comes up in free-run until someone calls the services by hand after every boot. You do not need a driver release to fix that. Persist the trigger configuration in the camera's own user set, make it the power-up default, and have the launch file re-apply and check the settings in a fixed order at startup. You get the write order, the launch-file call pattern for a multi-camera system, the readback checks, and a first-frame timeout with the arithmetic shown.

The settings the services control

Under GigE Vision and USB3 Vision, trigger configuration is a small block of GenICam features. TriggerSelector picks the event the trigger arms, normally the start of each frame. TriggerMode switches external triggering on. TriggerSource names the input line that provides the edge. The I/O block — LineSelector, LineMode and LineSource — decides what each physical line does, and it is the block drivers most often leave out of their parameter files.

AcquisitionMode stays on continuous under hardware trigger: the pulse starts each frame, not the mode. When a camera ignores its trigger wire, acquisition mode and the line block are the first two places to look, in that order — GigE camera ignores an external trigger and hardware trigger source not detected walk both checks. Any area scan camera holds this configuration, and a global shutter freezes a moving part at the trigger instant instead of scanning across it during exposure:

Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
Up to 3 MP
$309.00View partBuild a system with it

The order that works

TriggerSource points at a line, and the line must already be an input before the camera can register an edge on it. Write the I/O block first, then the trigger block, then arm. The full write order at the camera:

stop acquisition
line selector    -> the trigger input line
line mode        -> input
trigger selector -> frame start
trigger mode     -> on
trigger source   -> that line
start acquisition

Stopping acquisition first matters because several of these features refuse writes while the camera is streaming — apply camera settings while streaming without stalling capture covers the pattern, and GenICam attribute not writable covers the error you see when you skip it.

Step by step: make it come up configured

  1. Configure one camera by hand, in the vendor's viewer or a short script, in the order above. Pulse the line and confirm exactly one frame per pulse before you automate anything.
  2. Save the result to a spare user set slot and make that slot the power-up default. Power-cycle the camera with no driver running and read the settings back: if they survive, the camera alone now comes up triggered. Save camera parameters as a user set that loads on startup covers the save, and save camera settings across power cycles covers the test.
  3. Put one service call per setting in the launch file, wrapped as a launch node: package rosservice, type rosservice, the call in its args, and a unique node name. The call itself passes the value inline:
rosservice call /camera/right/set_line_mode 0
  1. Keep the camera's namespace in the path and the camera's initial in the node name: set_line_mode_r for the right camera, set_line_mode_l for the left. With duplicate node names a later call displaces an earlier one, and one camera stays misconfigured while the log looks clean.
  2. A launch file does not wait for one node to finish before starting the next. When order matters — line mode before trigger source — put the calls in one small startup script and launch that script as a single node.
  3. Read every setting back with the matching get service and compare it against what you wrote, not against what you expect. A mismatch is a failed start: camera trigger mode source readback mismatches lists the causes, with a cached driver value first among them.
  4. Arm acquisition last, after readback passes — camera trigger overlap configuration shows how to confirm the boot-time writes landed. Then block on the first armed frame with the timeout below and hand the stream to the hardware trigger grab loop.

Where the launch file runs

The host running the launch file shapes trigger timing as much as the camera does. A vision controller such as the MV-VC3301H-128G66 has 5+ LAN ports. On a right-and-left pair that is one dedicated link per camera, so a burst of frames from one camera never contends with the other's cable — the layout argument in multi-camera system design for reliable image capture.

Vision controllersHikrobot MV-VC3301H-128G66 I3-8100, 8GB+128G SSD, No PoE, PCIe expansion supported, Incl. VM6200Pro licenseMV-VC3301H-128G66
LAN ports
5+ LAN ports
USB 3 ports
3-4 USB 3 ports
Light outputs
4 built-in channels
Memory
8 GB
$2,419.00View partBuild a system with it

Worked example: first-frame timeout at a 9 fps trigger ceiling

Inputs: one LS-CMR-0053, a 12 MP GigE camera with a printed 9 fps ceiling; a trigger pulse at that ceiling, one per frame period; and a startup check that must tell a dead trigger line from a slow first frame.

Two rules set the numbers, each with its basis. Exposure gets about half a period, leaving the other half for readout and transfer inside the same frame. The first-frame timeout gets two periods: one for a pulse that lands just after arming, one for jitter.

T_frame = 1 / f t_exposure ≈ T_frame / 2 t_timeout = 2 × T_frame

T_frame = 1 ÷ 9 fps = 0.111 s ≈ 111 ms. Exposure cap ≈ 111 ms ÷ 2 ≈ 55 ms, so configure 50 ms. Timeout = 2 × 111 ms = 222 ms, so configure 250 ms.

Decision: no frame within 250 ms of arming fails the start, loudly, with no silent retry into free-run. Frames arriving but every other pulse empty means the trigger outruns the camera — space pulses at least 111 ms apart, or cut exposure further. Pulses closer than 111 ms cannot buy more than 9 frames per second at full resolution, because 9 fps is the camera's own maximum.

Area scan cameras12 MP GigE area scan camera, IMX226, 1/1.7" rolling shutter, 9 fps (LS-CMR-0053)LS-CMR-0053
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
12 MP
$560.00View partBuild a system with it

When the saved user set is not enough

The user set covers power cycles with no software attached. Two cases fall outside it, and the launch calls exist for both.

The driver writes over it on connect. Drivers commonly push exposure, gain and sometimes trigger mode when they open a camera, after the user set has loaded. With the driver up, read trigger mode following a cold boot: off after a boot that saved it on means your startup calls are doing real work — keep them.

The I/O lines sit outside the set. On some cameras line mode does not survive the power-cycle test in step 2. If it reverts, move the line settings into the startup script permanently and let the user set carry the rest.

Discovery fails before any of this. GigE Vision finds cameras with broadcast packets, and a router between controller and camera drops them, so the camera never appears to the driver. Put cameras on their own subnet behind a switch, or add the camera by its IP address where your tool supports a remote-camera entry; trigger settings are irrelevant until the camera is open.

Checklist before you ship

  • Line mode reads back as input on the trigger line.
  • Trigger mode on, trigger source names that line, trigger selector at frame start.
  • Acquisition mode continuous, armed only after readback passes.
  • Settings survive a power cycle with no driver connected.
  • Settings still read back correctly after the driver connects and initializes.
  • Every launch call has a unique node name; ordered calls share one script.
  • The first armed frame lands inside the timeout — 250 ms in the worked example.
  • A failed check stops the start; there is no free-run fallback.

Start the configuration

Choose the camera in GigE area scan cameras or the camera finder, run the configurator from the camera step to match lens and light to it, and pick the host from vision controllers. If the stack needs a look before you order, send the trigger rate and camera count through the contact page and we will mark the decision points in your launch file.

Questions

How long should I wait for the first hardware-triggered frame?

Two trigger periods, measured from the moment acquisition arms. One period covers a pulse that lands just after arming; the second covers readout, transfer and jitter. In the worked example that is 2 × 111 ms = 222 ms, configured as 250 ms. Shorter timeouts fail healthy stations whenever the first pulse arrives late in a period; much longer ones hide a dead trigger line.

Why does readback pass but the camera still produces no frames?

TriggerSource can name a line that is still configured as an output: the write lands and reads back correctly, but no edge ever reaches the trigger engine, so the camera arms and streams nothing. Read line mode in the same startup check and treat line mode plus trigger source as one verified item, not two independent ones.

If the launch file applies everything, do I still need the user set?

Yes. The launch calls run only when your stack starts; a bench session with a viewer, a firmware tool or a colleague's laptop opens the camera directly, and the user set is the configuration those sessions see. The user set also covers the window between camera power-up and driver connect. Set both layers to the same values so neither can surprise you.

How do I configure two cameras differently in one launch file?

One service call per launch node, a unique node name per call, and each call on its own camera's service path — under /camera/right/ for one camera, /camera/left/ for the other, with node names like set_line_mode_r and set_line_mode_l. Duplicate node names make a later call displace an earlier one while the launch log still looks clean, which is how one camera ends up in free-run.

Can I retest the startup sequence without power-cycling the camera?

Yes, in two parts. Relaunching the launch file re-runs the service calls and the readback check against the running camera, which tests the software layer. Only the user set needs a real power cycle: cut camera power, restore it, and read the settings before any driver connects. That split tells you which layer owns any failure you see.