cduss Claude Opus 4.5 commited on
Commit
d3be31f
·
1 Parent(s): 9389ef0

Fix set_target matrix format: send 4x4 nested array

Browse files

The backend expects np.array() to produce a 4x4 matrix, so we need
to send nested arrays instead of a flat 16-element array.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Files changed (1) hide show
  1. index.html +5 -4
index.html CHANGED
@@ -664,11 +664,12 @@
664
  const cy = Math.cos(yawRad), sy = Math.sin(yawRad);
665
  const cp = Math.cos(pitchRad), sp = Math.sin(pitchRad);
666
 
 
667
  const matrix = [
668
- cy * cp, -sy, cy * sp, 0,
669
- sy * cp, cy, sy * sp, 0,
670
- -sp, 0, cp, 0,
671
- 0, 0, 0, 1
672
  ];
673
 
674
  dataChannel.send(JSON.stringify({ set_target: matrix }));
 
664
  const cy = Math.cos(yawRad), sy = Math.sin(yawRad);
665
  const cp = Math.cos(pitchRad), sp = Math.sin(pitchRad);
666
 
667
+ // 4x4 transformation matrix (nested array for numpy compatibility)
668
  const matrix = [
669
+ [cy * cp, -sy, cy * sp, 0],
670
+ [sy * cp, cy, sy * sp, 0],
671
+ [-sp, 0, cp, 0],
672
+ [0, 0, 0, 1]
673
  ];
674
 
675
  dataChannel.send(JSON.stringify({ set_target: matrix }));