diff --git a/src/lerobot/robots/lekiwi/lekiwi_client.py b/src/lerobot/robots/lekiwi/lekiwi_client.py index 1bc3dadc4..2850842a2 100644 --- a/src/lerobot/robots/lekiwi/lekiwi_client.py +++ b/src/lerobot/robots/lekiwi/lekiwi_client.py @@ -323,6 +323,10 @@ class LeKiwiClient(Robot): np.ndarray: the action sent to the motors, potentially clipped. """ + # Action values may be torch tensors (e.g. replayed from a dataset) or numpy + # scalars; json.dumps only serializes Python primitives, so coerce each value to a + # plain float before sending. + action = {key: float(value) for key, value in action.items()} self.zmq_cmd_socket.send_string(json.dumps(action)) # action is in motor space # TODO(Steven): Remove the np conversion when it is possible to record a non-numpy array value diff --git a/src/lerobot/scripts/lerobot_replay.py b/src/lerobot/scripts/lerobot_replay.py index 1851f7c2b..b2ab2b731 100644 --- a/src/lerobot/scripts/lerobot_replay.py +++ b/src/lerobot/scripts/lerobot_replay.py @@ -61,6 +61,7 @@ from lerobot.robots import ( # noqa: F401 earthrover_mini_plus, hope_jr, koch_follower, + lekiwi, make_robot_from_config, omx_follower, openarm_follower,