mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-21 03:30:10 +00:00
wait for first actions
This commit is contained in:
@@ -372,6 +372,12 @@ def actor_thread(
|
|||||||
|
|
||||||
prev_action = current_action
|
prev_action = current_action
|
||||||
interp_idx = 0
|
interp_idx = 0
|
||||||
|
else:
|
||||||
|
# No action yet - hold current position while waiting for first inference
|
||||||
|
obs = robot.get_observation()
|
||||||
|
hold_pos = {k: v for k, v in obs.items() if k.endswith(".pos")}
|
||||||
|
robot.send_action(hold_pos)
|
||||||
|
robot_send_count += 1
|
||||||
|
|
||||||
if interp_idx < len(interpolated_actions):
|
if interp_idx < len(interpolated_actions):
|
||||||
action_to_send = interpolated_actions[interp_idx]
|
action_to_send = interpolated_actions[interp_idx]
|
||||||
|
|||||||
@@ -547,6 +547,11 @@ def main(cfg: RaCRTCConfig):
|
|||||||
|
|
||||||
prev_action = current_action
|
prev_action = current_action
|
||||||
interp_idx = 0
|
interp_idx = 0
|
||||||
|
else:
|
||||||
|
# No action yet - hold current position while waiting for first inference
|
||||||
|
hold_pos = {k: v for k, v in obs_filtered.items() if k.endswith(".pos")}
|
||||||
|
robot.send_action(hold_pos)
|
||||||
|
robot_send_count += 1
|
||||||
|
|
||||||
if interp_idx < len(interpolated_actions):
|
if interp_idx < len(interpolated_actions):
|
||||||
action_to_send = interpolated_actions[interp_idx]
|
action_to_send = interpolated_actions[interp_idx]
|
||||||
|
|||||||
Reference in New Issue
Block a user