|
5 | 5 |
|
6 | 6 | """Haply device controller for SE3 control with force feedback.""" |
7 | 7 |
|
| 8 | +from __future__ import annotations |
| 9 | + |
8 | 10 | import asyncio |
9 | 11 | import json |
10 | 12 | import numpy as np |
|
25 | 27 | from ..retargeter_base import RetargeterBase |
26 | 28 |
|
27 | 29 |
|
28 | | -@dataclass |
29 | | -class HaplyDeviceCfg(DeviceCfg): |
30 | | - """Configuration for Haply device. |
31 | | -
|
32 | | - Attributes: |
33 | | - websocket_uri: WebSocket URI for Haply SDK connection |
34 | | - pos_sensitivity: Position sensitivity scaling factor |
35 | | - data_rate: Data exchange rate in Hz |
36 | | - limit_force: Maximum force magnitude in Newtons (safety limit) |
37 | | - """ |
38 | | - |
39 | | - websocket_uri: str = "ws://localhost:10001" |
40 | | - pos_sensitivity: float = 1.0 |
41 | | - data_rate: float = 200.0 |
42 | | - limit_force: float = 2.0 |
43 | | - |
44 | | - |
45 | 30 | class HaplyDevice(DeviceBase): |
46 | 31 | """A Haply device controller for sending SE(3) commands with force feedback. |
47 | 32 |
|
@@ -387,3 +372,21 @@ async def _websocket_loop(self): |
387 | 372 | await asyncio.sleep(2.0) |
388 | 373 | else: |
389 | 374 | break |
| 375 | + |
| 376 | + |
| 377 | +@dataclass |
| 378 | +class HaplyDeviceCfg(DeviceCfg): |
| 379 | + """Configuration for Haply device. |
| 380 | +
|
| 381 | + Attributes: |
| 382 | + websocket_uri: WebSocket URI for Haply SDK connection |
| 383 | + pos_sensitivity: Position sensitivity scaling factor |
| 384 | + data_rate: Data exchange rate in Hz |
| 385 | + limit_force: Maximum force magnitude in Newtons (safety limit) |
| 386 | + """ |
| 387 | + |
| 388 | + websocket_uri: str = "ws://localhost:10001" |
| 389 | + pos_sensitivity: float = 1.0 |
| 390 | + data_rate: float = 200.0 |
| 391 | + limit_force: float = 2.0 |
| 392 | + class_type: type[DeviceBase] = HaplyDevice |
0 commit comments