MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / _quat_to_R

Function _quat_to_R

visualize_benchmark_web.py:1261–1269  ·  view source on GitHub ↗
(qw, qx, qy, qz)

Source from the content-addressed store, hash-verified

1259 import re
1260
1261 def _quat_to_R(qw, qx, qy, qz):
1262 q = np.array([qw, qx, qy, qz], dtype=np.float64)
1263 q /= np.linalg.norm(q)
1264 qw, qx, qy, qz = q
1265 return np.array([
1266 [1-2*(qy*qy+qz*qz), 2*(qx*qy-qz*qw), 2*(qx*qz+qy*qw)],
1267 [2*(qx*qy+qz*qw), 1-2*(qx*qx+qz*qz), 2*(qy*qz-qx*qw)],
1268 [2*(qx*qz-qy*qw), 2*(qy*qz+qx*qw), 1-2*(qx*qx+qy*qy)]
1269 ], dtype=np.float64)
1270
1271 def _dsc_num(name):
1272 m = re.search(r'DSC_(\d+)', name)

Callers 1

_load_eth3dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected