bug fix for #1071 When --display_data=true, Failed running control_robot. (#1073)

This commit is contained in:
masato-ka
2025-05-09 23:53:40 +09:00
committed by GitHub
parent f24030d4d8
commit a445d9c9da

View File

@@ -250,6 +250,7 @@ def control_loop(
observation, action = robot.teleop_step(record_data=True) observation, action = robot.teleop_step(record_data=True)
else: else:
observation = robot.capture_observation() observation = robot.capture_observation()
action = None
if policy is not None: if policy is not None:
pred_action = predict_action( pred_action = predict_action(
@@ -266,6 +267,7 @@ def control_loop(
# TODO(Steven): This should be more general (for RemoteRobot instead of checking the name, but anyways it will change soon) # 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")): if (display_data and not is_headless()) or (display_data and robot.robot_type.startswith("lekiwi")):
if action is not None:
for k, v in action.items(): for k, v in action.items():
for i, vv in enumerate(v): for i, vv in enumerate(v):
rr.log(f"sent_{k}_{i}", rr.Scalar(vv.numpy())) rr.log(f"sent_{k}_{i}", rr.Scalar(vv.numpy()))