yxma commited on
Commit
cbf39e1
·
verified ·
1 Parent(s): 299e110

Inspector: rotate about the raw mocap origin

Browse files
Files changed (1) hide show
  1. calib/pre/index.html +18 -4
calib/pre/index.html CHANGED
@@ -112,7 +112,7 @@ rotates and does not touch the other hand. Camera reprojection rmse is left 4.7
112
  <label><input type="range" id="fo" min="-10" max="10" step="1" value="0"><input type="number" class="num" id="fon" value="0"></label>
113
  <span id="foms" style="color:var(--dim);font-size:12px"></span>
114
  </div>
115
- <div class="grp"><b>world rotation about the mocap origin (deg) &mdash; rotation vector</b>
116
  <label>x<input type="range" id="rx" min="-10" max="10" step="0.05" value="0"><input type="number" class="num" id="rxn" value="0" step="0.05"></label>
117
  <label>y<input type="range" id="ry" min="-10" max="10" step="0.05" value="0"><input type="number" class="num" id="ryn" value="0" step="0.05"></label>
118
  <label>z<input type="range" id="rz" min="-10" max="10" step="0.05" value="0"><input type="number" class="num" id="rzn" value="0" step="0.05"></label>
@@ -188,10 +188,24 @@ function points(fr, side, view, s, useDelta){
188
  // A world-frame correction is a RIGID transform about the mocap origin:
189
  // it turns the orientation as well as moving the position. Rotating only
190
  // the position would be a different, unphysical thing.
191
- const Rd=rodrigues(rv);
192
- const pw=mv(Rd,[p[0]*1000,p[1]*1000,p[2]*1000]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  R=mm(Rd,R);
194
- const org=[pw[0]+wd[0], pw[1]+wd[1], pw[2]+wd[2]];
195
  const gel=D.gel[side].map((v,i)=>v+gd[i]);
196
  const add=(a,b)=>[a[0]+b[0],a[1]+b[1],a[2]+b[2]];
197
  const out={centre:project(add(org,mv(R,gel)),cam), origin:project(org,cam), tips:[]};
 
112
  <label><input type="range" id="fo" min="-10" max="10" step="1" value="0"><input type="number" class="num" id="fon" value="0"></label>
113
  <span id="foms" style="color:var(--dim);font-size:12px"></span>
114
  </div>
115
+ <div class="grp"><b>world rotation about the RAW mocap origin (deg) &mdash; rotation vector</b>
116
  <label>x<input type="range" id="rx" min="-10" max="10" step="0.05" value="0"><input type="number" class="num" id="rxn" value="0" step="0.05"></label>
117
  <label>y<input type="range" id="ry" min="-10" max="10" step="0.05" value="0"><input type="number" class="num" id="ryn" value="0" step="0.05"></label>
118
  <label>z<input type="range" id="rz" min="-10" max="10" step="0.05" value="0"><input type="number" class="num" id="rzn" value="0" step="0.05"></label>
 
188
  // A world-frame correction is a RIGID transform about the mocap origin:
189
  // it turns the orientation as well as moving the position. Rotating only
190
  // the position would be a different, unphysical thing.
191
+ // PIVOT ON THE RAW MOCAP ORIGIN, not on the published one.
192
+ //
193
+ // The published 2026-05-19 poses already carry the baked translation t =
194
+ // (230, 0, 175) mm. The true relation is p_pre = R p_raw + t_true, so
195
+ // rotating the PUBLISHED pose computes R(p_raw + t) = R p_raw + R t and
196
+ // drags the baked translation through the rotation with it. Measured, that
197
+ // spurious term is R t - t = (-0.1, -11.5, -0.3) mm — 11.5 mm of pure
198
+ // artefact that the world-offset slider then had to cancel, so part of any
199
+ // translation dialled in here was correcting the tool, not the rig.
200
+ //
201
+ // Undo t, rotate about the raw origin, put t back. R = identity leaves the
202
+ // pose exactly unchanged, and on a pre-reset page t is zero so nothing
203
+ // changes at all.
204
+ const Rd=rodrigues(rv), T=D.world_offset_mm;
205
+ const raw=[p[0]*1000-T[0], p[1]*1000-T[1], p[2]*1000-T[2]];
206
+ const pw=mv(Rd,raw);
207
  R=mm(Rd,R);
208
+ const org=[pw[0]+T[0]+wd[0], pw[1]+T[1]+wd[1], pw[2]+T[2]+wd[2]];
209
  const gel=D.gel[side].map((v,i)=>v+gd[i]);
210
  const add=(a,b)=>[a[0]+b[0],a[1]+b[1],a[2]+b[2]];
211
  const out={centre:project(add(org,mv(R,gel)),cam), origin:project(org,cam), tips:[]};