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

Function init_cmd_hg

scripts/unitree_deploy/common/command_helper.py:36–47  ·  view source on GitHub ↗

Initialize an HG command with default motor fields.

(cmd: LowCmdHG, mode_machine: int, mode_pr: int)

Source from the content-addressed store, hash-verified

34
35
36def init_cmd_hg(cmd: LowCmdHG, mode_machine: int, mode_pr: int):
37 """Initialize an HG command with default motor fields."""
38 cmd.mode_machine = mode_machine
39 cmd.mode_pr = mode_pr
40 size = len(cmd.motor_cmd)
41 for i in range(size):
42 cmd.motor_cmd[i].mode = 1
43 cmd.motor_cmd[i].q = 0
44 cmd.motor_cmd[i].qd = 0
45 cmd.motor_cmd[i].kp = 0
46 cmd.motor_cmd[i].kd = 0
47 cmd.motor_cmd[i].tau = 0
48
49
50def init_cmd_go(cmd: LowCmdGo, weak_motor: list):

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected