mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-28 06:59:44 +00:00
linter pt4
This commit is contained in:
@@ -347,6 +347,7 @@ if __name__ == "__main__":
|
||||
)
|
||||
|
||||
# reset legs and start locomotion thread
|
||||
try:
|
||||
groot_controller.reset_robot()
|
||||
groot_controller.start_locomotion_thread()
|
||||
|
||||
@@ -356,7 +357,6 @@ if __name__ == "__main__":
|
||||
logger.info("Press Ctrl+C to stop")
|
||||
|
||||
# keep robot alive
|
||||
try:
|
||||
while True:
|
||||
time.sleep(1.0)
|
||||
except KeyboardInterrupt:
|
||||
|
||||
@@ -11,8 +11,9 @@ from unitree_sdk2py.idl.unitree_hg.msg.dds_ import LowCmd_ as hg_LowCmd, LowStat
|
||||
from unitree_sdk2py.utils.crc import CRC
|
||||
|
||||
# DDS topic names follow Unitree SDK naming conventions
|
||||
kTopicLowCommand_Debug = "rt/lowcmd" # action to robot # ruff: noqa: N816
|
||||
kTopicLowState = "rt/lowstate" # observation from robot # ruff: noqa: N816
|
||||
# ruff: noqa: N816
|
||||
kTopicLowCommand_Debug = "rt/lowcmd" # action to robot
|
||||
kTopicLowState = "rt/lowstate" # observation from robot
|
||||
|
||||
LOWCMD_PORT = 6000
|
||||
LOWSTATE_PORT = 6001
|
||||
|
||||
@@ -43,8 +43,9 @@ from .config_unitree_g1 import UnitreeG1Config
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# DDS topic names follow Unitree SDK naming conventions
|
||||
kTopicLowCommand_Debug = "rt/lowcmd" # ruff: noqa: N816
|
||||
kTopicLowState = "rt/lowstate" # ruff: noqa: N816
|
||||
# ruff: noqa: N816
|
||||
kTopicLowCommand_Debug = "rt/lowcmd"
|
||||
kTopicLowState = "rt/lowstate"
|
||||
|
||||
G1_29_Num_Motors = 35
|
||||
G1_23_Num_Motors = 35
|
||||
|
||||
@@ -12,7 +12,7 @@ LOWCMD_PORT = 6000
|
||||
LOWSTATE_PORT = 6001
|
||||
|
||||
|
||||
def ChannelFactoryInitialize(*args, **kwargs): # DDS to socket bridge #noqa : N802
|
||||
def ChannelFactoryInitialize(*args, **kwargs): # noqa: N802
|
||||
global _ctx, _lowcmd_sock, _lowstate_sock
|
||||
# read socket config
|
||||
config = UnitreeG1Config()
|
||||
@@ -40,7 +40,7 @@ class ChannelPublisher: # send action to robot
|
||||
def Init(self): # noqa: N802
|
||||
pass
|
||||
|
||||
def Write(self, msg):
|
||||
def Write(self, msg): # noqa: N802
|
||||
_lowcmd_sock.send(pickle.dumps((self.topic, msg)))
|
||||
|
||||
|
||||
@@ -52,6 +52,6 @@ class ChannelSubscriber: # read observation from robot
|
||||
def Init(self): # noqa: N802
|
||||
pass
|
||||
|
||||
def Read(self):
|
||||
def Read(self): # noqa: N802
|
||||
topic, msg = pickle.loads(_lowstate_sock.recv())
|
||||
return msg
|
||||
|
||||
Reference in New Issue
Block a user