diff --git a/lerobot/common/robot_devices/control_utils.py b/lerobot/common/robot_devices/control_utils.py index 4e42a9896..76e264999 100644 --- a/lerobot/common/robot_devices/control_utils.py +++ b/lerobot/common/robot_devices/control_utils.py @@ -250,6 +250,7 @@ def control_loop( observation, action = robot.teleop_step(record_data=True) else: observation = robot.capture_observation() + action = None if policy is not None: pred_action = predict_action( @@ -266,9 +267,10 @@ def control_loop( # TODO(Steven): This should be more general (for RemoteRobot instead of checking the name, but anyways it will change soon) if (display_data and not is_headless()) or (display_data and robot.robot_type.startswith("lekiwi")): - for k, v in action.items(): - for i, vv in enumerate(v): - rr.log(f"sent_{k}_{i}", rr.Scalar(vv.numpy())) + if action is not None: + for k, v in action.items(): + for i, vv in enumerate(v): + rr.log(f"sent_{k}_{i}", rr.Scalar(vv.numpy())) image_keys = [key for key in observation if "image" in key] for key in image_keys: