-
Notifications
You must be signed in to change notification settings - Fork 225
Open
Description
With regards to unitree_sdk2py/g1/loco/g1_loco_client.py and
def SetStandHeight(self, stand_height: float):
p = {}
p["data"] = stand_height
parameter = json.dumps(p)
code, data = self._Call(ROBOT_API_ID_LOCO_SET_STAND_HEIGHT, parameter)
return code
I have altered the teleop_hand_and_arm.py to set height based on left controller A/X and B/Y, and added this within the code.
from unitree_sdk2py.core.channel import ChannelFactoryInitialize
from unitree_sdk2py.g1.loco.g1_loco_client import LocoClient
UINT32_MAX = (1 << 32) - 1
ChannelFactoryInitialize(0, networkInterface=None) # or our robot interface, e.g. enx4865ee11aae1
client = LocoClient()
client.SetTimeout(5.0)
client.Init()
# Both calls return code=0 but the robot does not change stand height:
code_low = client.SetStandHeight(0.0)
code_high = client.SetStandHeight(float(UINT32_MAX))
# code_low == 0, code_high == 0
I get code=0, and the following response from my script, but no movement :
10:34:18.026662 INFO Body height lowered: 0.90 (left A/X) teleop_hand_and_arm.py:413
10:34:18.359611 INFO Body height lowered: 0.85 (left A/X) teleop_hand_and_arm.py:413
10:34:18.735073 INFO Body height raised: 0.90 (left B/Y) teleop_hand_and_arm.py:407
10:34:19.270162 INFO Body height lowered: 0.85 (left A/X) teleop_hand_and_arm.py:413
10:34:19.542676 INFO Body height raised: 0.90 (left B/Y) teleop_hand_and_arm.py:407
10:34:19.880495 INFO Body height lowered: 0.85 (left A/X) teleop_hand_and_arm.py:413
I have also tested with this script
test_body_height.py
Is there a specific state/pose or similar that the robot need to be in for this to work? I have tested with the --motion flag
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels