Update workstation UI, ROS task control and device integration

This commit is contained in:
cheng
2026-10-20 15:46:13 +08:00
parent 2b74c50ba8
commit e5b06df6da
141 changed files with 91520 additions and 748 deletions
+21
View File
@@ -0,0 +1,21 @@
import hashlib
import json
from pathlib import Path
from unittest import TestCase
import numpy as np
from station.operator_gripper_mesh import rgi_cad_gl
class GripperCadTest(TestCase):
def test_tessellation_is_from_supplied_step_and_units_are_metres(self):
folder=Path(__file__).resolve().parents[1]/'src/station/assets/models/rgi-100-30'
meta=json.loads((folder/'mesh.json').read_text())
self.assertEqual(hashlib.sha256((folder/'source.step').read_bytes()).hexdigest(),meta['source_sha256'])
self.assertEqual(meta['source_units'],'mm');self.assertEqual(meta['units'],'m')
self.assertFalse(meta['articulated'])
blob,count,center,radius=rgi_cad_gl()
vertices=np.frombuffer(blob,np.float32).reshape(-1,6)
self.assertEqual(count,meta['triangles']*3);self.assertEqual(len(vertices),count)
self.assertTrue(np.isfinite(vertices).all());self.assertGreater(radius,.01)
self.assertTrue(np.allclose(np.ptp(vertices[:,:3],axis=0)*1000,meta['dimensions_mm'],atol=.001))
self.assertLess(np.max(np.abs(vertices[:,:3])),1.)