Zero out all fields in the command.
(cmd: LowCmdGo | LowCmdHG)
| 23 | |
| 24 | |
| 25 | def create_zero_cmd(cmd: LowCmdGo | LowCmdHG): |
| 26 | """Zero out all fields in the command.""" |
| 27 | size = len(cmd.motor_cmd) |
| 28 | for i in range(size): |
| 29 | cmd.motor_cmd[i].q = 0 |
| 30 | cmd.motor_cmd[i].qd = 0 |
| 31 | cmd.motor_cmd[i].kp = 0 |
| 32 | cmd.motor_cmd[i].kd = 0 |
| 33 | cmd.motor_cmd[i].tau = 0 |
| 34 | |
| 35 | |
| 36 | def init_cmd_hg(cmd: LowCmdHG, mode_machine: int, mode_pr: int): |