Commit 72fd0677 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: CuasRender MB compensation + conditionSceneToGpuCuas motion wrapper (ERS omegas/velocities)

Per Andrey: of the 3 expected render-vs-oracle mismatch causes, the legitimate
one is the better photometric calibration; the other two - ERS and motion
blur - must be implemented in the RT chain:

- ERS: NEW CuasConditioning.conditionSceneToGpuCuas(scene, cfg, omegas,
  velocities, ...) - the ONE place per-scene motion enters the ingest. Sets
  the scene ERS rates (fully-preserved ErsCorrection path); velocities =
  provision ({0,0,0}/null for the rotation-only camera). In production the
  omegas come analytically from wobble radius + RPM; the GPU corr_vector
  imu_rot/imu_move feed is the future upgrade (after the double-application
  check vs CPU pXpYD ERS). Legacy conditionSceneToGpu delegates (unchanged
  behavior for the pose loop).
- MB: renderSceneVirtual takes mb_vectors/mb_tau/mb_max_gain; when enabled
  uses the ORACLE machinery (setInterTasksMotionBlur two-task-set +
  interCorrTDMotionBlur double convert: positive original + negative shifted
  scale pair summing to 1, ratio from 1-pix-time/tau, offset stretched when
  scales would exceed mb_max_gain). No erased re-convert in MB mode (would
  destroy the accumulation) - comparisons must mask to task tiles.
- testRenderSequence: MB gated by imp.mb_en (matching the oracle DBG
  products: ON -> compare vs MB DBG, OFF -> vs -NOMB DBG); vectors from the
  same OpticalFlow.getMotionBlur at borrowed pose + stored rates; ingest via
  the new wrapper.

Verified: mvn -DskipTests clean package OK.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 29c7239b
...@@ -129,6 +129,46 @@ public class CuasConditioning { ...@@ -129,6 +129,46 @@ public class CuasConditioning {
final Config cfg, final Config cfg,
final int threadsMax, final int threadsMax,
final int debugLevel) { final int debugLevel) {
return conditionSceneToGpuCuas(scene, cfg, null, null, threadsMax, debugLevel);
}
/**
* CUAS wrapper: the ONE place where per-scene MOTION enters the RT ingest (Andrey's
* design 2026-07-05). Sets the scene's ERS rates (when given) before the ingest so the
* downstream grid transform (transformToScenePxPyD -> ErsCorrection, the fully-preserved
* RGB-proven path) applies the rolling-shutter correction; omegas==null &&
* velocities==null leaves the scene's current ERS state untouched (legacy behavior).
* For CUAS: omegas from the wobble radius + rotation RPM (analytic, per scene phase);
* velocities - PROVISION only, pass {0,0,0} (or null) for the rotation-only camera.
* FUTURE (GPU migration): the same omegas/velocities feed the GPU corr_vector
* imu_rot/imu_move (get_tiles_offsets has per-sensor ERS support, currently dormant) -
* to be enabled after verifying no double-application against the CPU pXpYD ERS.
* By Claude on 07/05/2026, from Andrey's design.
* @param omegas angular rates {az, tilt, roll} rad/s, scene-vs-virtual-center
* relative (wobble-scale; the constant-rotation part cancels against
* the co-rotating center) - or null (with velocities null: keep state)
* @param velocities linear rates {vx, vy, vz} m/s (provision; null/{0,0,0} for CUAS)
*/
public static boolean conditionSceneToGpuCuas(
final QuadCLT scene,
final Config cfg,
final double [] omegas,
final double [] velocities,
final int threadsMax,
final int debugLevel) {
if ((omegas != null) || (velocities != null)) {
scene.getErsCorrection().setErsDt(
(velocities != null) ? velocities : new double [3],
(omegas != null) ? omegas : new double [3]);
}
return conditionSceneToGpuInner(scene, cfg, threadsMax, debugLevel);
}
private static boolean conditionSceneToGpuInner(
final QuadCLT scene,
final Config cfg,
final int threadsMax,
final int debugLevel) {
final double [][][] data = CuasMotion.readRawImageData(scene, threadsMax, debugLevel); final double [][][] data = CuasMotion.readRawImageData(scene, threadsMax, debugLevel);
if (data == null) { if (data == null) {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment