MCPcopy Create free account
hub / github.com/RoboVerseOrg/RoboVerse / RemoteController

Class RemoteController

scripts/unitree_deploy/common/remote_controller.py:25–44  ·  view source on GitHub ↗

Lightweight parser for Unitree wireless remote payloads.

Source from the content-addressed store, hash-verified

23
24
25class RemoteController:
26 """Lightweight parser for Unitree wireless remote payloads."""
27
28 def __init__(self):
29 self.lx = 0
30 self.ly = 0
31 self.rx = 0
32 self.ry = 0
33 self.button = [0] * 16
34
35 def set(self, data):
36 """Decode raw bytes into axis and button state."""
37 # wireless_remote
38 keys = struct.unpack("H", data[2:4])[0]
39 for i in range(16):
40 self.button[i] = (keys & (1 << i)) >> i
41 self.lx = struct.unpack("f", data[4:8])[0]
42 self.rx = struct.unpack("f", data[8:12])[0]
43 self.ry = struct.unpack("f", data[12:16])[0]
44 self.ly = struct.unpack("f", data[20:24])[0]

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected