Skip to content

Commit d3fc33e

Browse files
masato-kaFrancesco Capuano
authored andcommitted
bug fix for #1071 When --display_data=true, Failed running control_robot. (#1073)
1 parent a1793bc commit d3fc33e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lerobot/common/robot_devices/control_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def control_loop(
250250
observation, action = robot.teleop_step(record_data=True)
251251
else:
252252
observation = robot.capture_observation()
253+
action = None
253254

254255
if policy is not None:
255256
pred_action = predict_action(
@@ -266,9 +267,10 @@ def control_loop(
266267

267268
# TODO(Steven): This should be more general (for RemoteRobot instead of checking the name, but anyways it will change soon)
268269
if (display_data and not is_headless()) or (display_data and robot.robot_type.startswith("lekiwi")):
269-
for k, v in action.items():
270-
for i, vv in enumerate(v):
271-
rr.log(f"sent_{k}_{i}", rr.Scalar(vv.numpy()))
270+
if action is not None:
271+
for k, v in action.items():
272+
for i, vv in enumerate(v):
273+
rr.log(f"sent_{k}_{i}", rr.Scalar(vv.numpy()))
272274

273275
image_keys = [key for key in observation if "image" in key]
274276
for key in image_keys:

0 commit comments

Comments
 (0)