Skip to content

fix: replace incorrect .qd with .dq in motor commands (deploy_real.py)#88

Open
dcol91863 wants to merge 1 commit intounitreerobotics:mainfrom
dcol91863:fix/deploy-real-dq-typo
Open

fix: replace incorrect .qd with .dq in motor commands (deploy_real.py)#88
dcol91863 wants to merge 1 commit intounitreerobotics:mainfrom
dcol91863:fix/deploy-real-dq-typo

Conversation

@dcol91863
Copy link

Summary

Fixes #61

The MotorCmd struct field for desired joint velocity is named dq, not qd. All five occurrences in deploy_real.py were using the wrong field name:

# Before (incorrect)
self.low_cmd.motor_cmd[motor_idx].qd = 0

# After (correct)
self.low_cmd.motor_cmd[motor_idx].dq = 0

Affected lines

Line Location
125 move_to_default_pos() — leg joints interpolation loop
139 default_pos_state() — leg joints hold loop
146 default_pos_state() — arm/waist joints hold loop
209 run() — leg joints command build
217 run() — arm/waist joints command build

Impact

Using .qd silently assigns to a non-existent (or unintended) attribute on the MotorCmd object, so the desired joint velocity is never actually zeroed out during deployment. This can cause unexpected motor behavior on real hardware.

Test plan

  • Verify MotorCmd field name against unitree_sdk2_python IDL definition (dq is correct)
  • Deploy with corrected script and confirm motors respond as expected

The MotorCmd field for desired velocity is named 'dq', not 'qd'.
Using 'qd' silently sets an unrelated (or non-existent) attribute,
meaning the desired joint velocity is never actually zeroed out.

Fixes unitreerobotics#61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong typing in deploy/deploy_real/deploy_real.py

1 participant