A depth camera riding a rotator streams depth and RGB through the swing whether the frames are usable or not: the link carries every pixel, and the frames taken in motion come back smeared and frayed. The fix is to make capture event-driven. Leave the motion stream open for the whole session, open the depth and RGB streams only when the gyro magnitude says the rotator is parked, and close them the moment motion resumes. This guide gives you the threshold and dwell to start from, the code structure that opens and closes streams safely, the exposure arithmetic for the frames you cannot avoid, and the wiring option when the camera has no IMU of its own.
Why gating beats streaming through the swing
Keep the motion stream open from power-up to shutdown and treat the image streams as event-driven. The motion stream sends a few hundred samples per second — kilobytes per second at most — while the image streams are orders of magnitude hungrier. For scale: a 640 × 480 depth frame at 16 bits is 640 × 480 × 2 B ≈ 0.6 MB, so 30 fps is about 18 MB/s before RGB adds its share. With the gate in place the link carries that traffic only during the parked windows, and the motion stream keeps flowing regardless at a cost of kilobytes.
Bandwidth is only half the case. Structured-light and ToF depth assume the scene holds still while the frame integrates, and stereo depth needs sharp IR frames to match against. Mid-swing, correlation and matching break down, and the depth cloud frays exactly where you will later stitch neighbouring stops together. Frames taken in motion are not lower-grade data you might keep; they are frames you will delete. The gate is a quality control that happens to save bandwidth, not the other way round.
Operate the streams in place. Enable and disable depth and RGB per cycle instead of tearing the device down; the stop-and-start sequence for paired depth and RGB sensors is the pattern to follow. Continuous acquisition mode for live image loops stays right for cameras that never stop, and a host serving several cameras should size its links with the four-camera RGB and depth bandwidth method.
What you need
- A depth camera whose SDK lets your code enable and disable each stream on its own — depth, RGB and the motion (IMU) stream — without closing the device.
- The gyro's units and sample rate — deg/s or rad/s, and samples per second — because the threshold is set in those units.
- Host code with a fixed-rate loop or callback for motion samples and a small state machine for the gate.
- For the machine variant: a digital input on the host or controller, reached over camera power and I/O cabling.
The gate itself is a dozen lines of host code; everything else is plumbing you already have.
Set the stationary threshold and the dwell
Compute the magnitude of the three gyro components for every motion sample, subtract the at-rest bias, then compare against a threshold with a dwell behind it. Start at 0.5 deg/s held for 100 ms. A bench rotator parked at a station sits far below that value, and the same swing passes tens of deg/s, so the two states separate widely.
Two things move the number:
- Vibration. On a machine that shakes, the parked floor rises. Raise the threshold until the recorded trace at the stop sits clearly under it; expect to land between 1 and 2 deg/s on vibrating machinery.
- Settling. A stop command rings down through the mechanics after the axis halts. The dwell rides out that ring: extend it to 200 or 300 ms when the trace is still moving where the gate would open.
Add hysteresis so sensor noise cannot flap the gate: close the streams at a second threshold set about twice the open threshold — 1.0 deg/s against the 0.5 deg/s start. Record the gyro's parked reading during commissioning and subtract it as the bias before any comparison; a warm gyro can sit off zero enough to matter against a 0.5 deg/s bar.
Worked example: an indexer that parks at each station for a scan
Inputs, and where each comes from:
- Motion stream rate 200 Hz — read from the stream at start-up; 200 Hz is the low end of the few hundred hertz these motion streams run at.
- Open threshold 0.5 deg/s — the starting value from the section above.
- Dwell 100 ms — the starting value from the section above.
- Close threshold 1.0 deg/s — twice the open threshold, per the hysteresis rule.
Rule in words: convert the dwell into a count of consecutive motion samples that must sit under the open threshold before the gate opens, and close the gate on a single sample above the close threshold.
Arithmetic:
- Dwell in samples: 100 ms × 200 samples/s ÷ 1000 ms/s = 20 samples.
- Gate reaction when motion resumes: 1 s ÷ 200 Hz = 5 ms to the first sample above the close threshold.
Result: the image streams open after 100 ms of confirmed stillness and close within about 5 ms of the rotator moving off.
Decision: if the logged trace still moves when the 20th sample arrives, the settling ring outlasts the dwell — double it to 200 ms, which is 40 samples at 200 Hz, so the first enabled frame lands after the ring dies. Keep the close threshold at twice whatever open threshold you settle on, and keep the motion stream running through every transition.
Gate the streams: step by step
- Open the device once at start-up and enable the motion stream only. It stays on for the whole session.
- Park the rotator, record the gyro reading per axis and store those three numbers as the bias.
- In the sample loop or callback, read the three components, subtract the bias and compute the magnitude.
- Count consecutive samples under the open threshold; when the count reaches the dwell count, enable the depth and RGB streams.
- Discard the first frame or two after enabling, then capture the frame set for that stop — the multi-image capture per trigger pattern shows how to take a whole set from one gate event.
- Disable the image streams — only the streams — when the magnitude exceeds the close threshold.
- Tag each frame set with the rotator angle or a motion-data timestamp; the IMU and depth timestamp alignment guide covers keeping the clock domains straight, and the out-of-order timestamps fix covers the scramble under load.
- If the SDK forces a stop-and-start per cycle instead of enable and disable, follow that clean sequence rather than killing the context mid-frame.
// Illustrative names and values — call your SDK's stream enable and disable functions.
double bias_x = 0.02, bias_y = -0.01, bias_z = 0.03; // deg/s, recorded parked at step 2
double open_threshold = 0.5; // deg/s
double close_threshold = 1.0; // deg/s
int dwell_samples = 20; // 100 ms at a 200 Hz motion stream
int still_count = 0;
bool streams_open = false;
// for each motion sample (gx, gy, gz in deg/s):
double mx = gx - bias_x, my = gy - bias_y, mz = gz - bias_z;
double mag = sqrt(mx*mx + my*my + mz*mz);
if (streams_open) {
if (mag > close_threshold) { disable_depth(); disable_rgb(); streams_open = false; still_count = 0; }
} else {
still_count = (mag < open_threshold) ? still_count + 1 : 0;
if (still_count >= dwell_samples) { enable_depth(); enable_rgb(); discard_frames(2); streams_open = true; }
}
Depth cameras that fit the gated pattern
Any depth camera whose streams your host code can open and close fits the pattern. Structured-light and ToF cameras are the natural class for station-by-station capture: they deliver a full frame per capture, and their depth model assumes a static scene — the exact condition the gate enforces. Positioning at each station then follows the ordinary working-distance rules in the 3D camera working distance and positioning guide.
The shop's 3D-sensor range includes structured-light and ToF models in exactly that class, all under 3D sensors:
- Type
- Stereo / structured light
- Type
- Depth / ToF camera
Browse the range with the card below or go straight to the 3D camera finder.
Laser profilers and stereo 3D cameras
170 models · from $699.00Exposure when frames must be taken in motion
Some processes only slow down; they never stop. Depth sensors for this work are commonly global shutter, so in-motion smear is set by exposure alone:
An illustrative check for a mid-range depth sensor: a 90° horizontal field spread over 1280 pixels is about 14 px/deg. At 30 deg/s with a 10 ms exposure, the scene smears 30 × 0.010 × 14 ≈ 4 px — enough to break stereo matching. Cut the exposure to 2 ms on the same swing and the smear falls below 1 px, paid for in light. Fix the exposure manually for the moving capture, because auto exposure stretches the integration through the dark part of the swing and multiplies the smear exactly when you can least afford it.
Exposure repairs RGB and IR sharpness only. Structured-light correlation in motion stays broken no matter how short the exposure, which is why the gate remains the primary control and short exposure is the fallback.
No IMU on the camera? Take the stationary signal from the machine
On a machine, the cleanest stationary flag is not an IMU at all — it is the drive that positions the rotator. Servo drives, inverters and motion controllers expose a motion-complete or in-position digital output that asserts when the axis holds position. Wire it to a digital input on your host or controller and treat assertion as the gate-open condition and deassertion as gate-close. Debounce the edge with the same dwell logic; a 100 ms timer plays the role of the 100 ms gyro dwell.
An external gyro module bolted to the rotating plate is the second option. It feeds the host over its own link, and the threshold arithmetic is unchanged.
Where the camera accepts a hardware trigger, the same drive signal can fire the capture itself — the shared-pulse pattern for paired stereo capture covers wiring one source to two sensors. Run the signal wiring in drag-chain-rated cable on the moving side:
- Type
- Power and I/O cables
- Length
- 6-8 m
When not to gate
- Laser profilers. They are built to profile while material moves under the laser, so a stillness gate defeats their purpose. On a stopped line they produce nothing; drive them from the line encoder instead and let them run.
- A camera that never stops. Mobile mapping and continuous rotation starve on a stillness gate. Cut exposure, lower the stream rate or narrow the camera ROI instead — bandwidth falls without waiting for stillness.
- A rotator that cannot repeat its parked position. Gating fixes bandwidth, not geometry. Position repeatability is a mechanics problem, and the stereo depth camera calibration workflow is where the remaining error gets measured.
Verify the gate before the first model
Prove the gate on the bench, in this order:
- Trace test. Log the magnitude against time through a full cycle and mark the gate-open moments. The gate must open only inside the parked windows — never mid-swing, never on the settling ring.
- Stream test. Let a script cycle the gate for a few hundred opens and closes. Every enable and disable must return cleanly; an error at the close is a stream-teardown problem, not a threshold problem.
- Frame test. Inspect the captured sets at the seams between stops. Doubled edges or ghosted surfaces mean frames slipped in during settling — discard one more frame or extend the dwell.
- Bandwidth test. Read the interface counters with the gate on and off across the same cycle. The saving should track the fraction of the cycle spent parked, minus a small overhead for the motion stream.
Common mistakes that keep the gate shut
- Bias never subtracted. The parked magnitude then sits above the threshold and the gate never opens. Record the parked reading and subtract it, per axis.
- Threshold under the vibration floor. The gate opens mid-swing on a shake or flaps open and closed. Raise the open threshold until the parked trace clears it with margin.
- Device torn down each cycle. Closing and reopening the camera per stop costs seconds and occasionally breaks the stream pair; enable and disable the streams in place.
- Dwell shorter than the settling ring. The first enabled frames land while the mechanics still ring. Extend the dwell or discard one more frame after enabling.
Next step: choose the camera class first, then the wiring. The camera configurator starts at the camera step and carries the choice through to mounts and cabling, and the 3D topic page gathers the rest of the integration guides.
Questions
Does the stationary check use one gyro axis or all three?
Use the magnitude over all three axes, not a single component: a rotator that has stopped can still wobble on a second axis, and a single-axis check misses it. Keep units straight as well — a 0.5 deg/s threshold is about 0.0087 rad/s — because typing 0.5 into an interface that reports rad/s sets a bar almost nothing passes, and the gate never opens.
Do I need to synchronize the IMU samples with the frames?
Not for the gate itself: the threshold only asks whether the axis is still now, so small offsets between motion samples and frames are harmless. Alignment matters later, when motion data fuses with frames for pose or trajectory work — that is a timestamp problem for after the capture, not a gating one.
Can I skip the stops and model while the camera rotates?
You can stream, but the frames rarely model well: exposure smears the RGB and IR frames, and structured-light or ToF depth assumes the scene holds still while the frame integrates. If you must capture in motion, fix the exposure so the smear stays within a pixel or two and expect to filter the depth cloud afterwards. For a modeled environment, capture at the stops and let the gate decide when.
My depth camera has no built-in IMU — how do I gate the capture?
Mount an external gyro on the rotator, or take the stationary flag from the machine: a servo drive or inverter's in-position (motion-complete) output wired to a digital input behaves exactly like the gyro gate — asserted means enable the image streams, dropped means disable them. Debounce the edge with the same dwell timer, and run the wiring in drag-chain-rated cable.
How much link bandwidth does IMU-gated streaming save?
Image traffic then flows only for the fraction of the cycle the rotator spends parked. If a station cycle holds still 30 percent of the time, depth and RGB traffic drops by roughly 70 percent while the motion stream adds only kilobytes per second. Measure the real duty from the gate's open time in your trace log.
Should I discard the first frames after enabling the depth stream?
Yes — drop one or two frames after the gate opens so exposure and any internal adjustment settle before you record. Count them in the station time: at a 30 fps stream, discarding two frames costs about 67 ms per stop, which matters when the parked window is short.


