diff --git a/lerobot/common/constants.py b/lerobot/common/constants.py index bd22201b..9e83bf33 100644 --- a/lerobot/common/constants.py +++ b/lerobot/common/constants.py @@ -4,8 +4,8 @@ from pathlib import Path from huggingface_hub.constants import HF_HOME -OBS_ENV = "observation.environment_state" -OBS_ROBOT = "observation.state" +OBS_ENV_STATE = "observation.environment_state" +OBS_STATE = "observation.state" OBS_IMAGE = "observation.image" OBS_IMAGES = "observation.images" ACTION = "action" diff --git a/lerobot/common/robots/koch/configuration_koch.py b/lerobot/common/robots/koch/configuration_koch.py index 1db724c5..d6ec3da5 100644 --- a/lerobot/common/robots/koch/configuration_koch.py +++ b/lerobot/common/robots/koch/configuration_koch.py @@ -16,10 +16,6 @@ class KochRobotConfig(RobotConfig): # the number of motors in your follower arms. max_relative_target: int | None = None - # Sets the leader arm in torque mode with the gripper motor set to this angle. This makes it possible - # to squeeze the gripper and have it spring back to an open position on its own. - gripper_open_degree: float = 35.156 - mock: bool = False # motors diff --git a/lerobot/common/robots/koch/robot_koch.py b/lerobot/common/robots/koch/robot_koch.py index f206b0bf..469953c2 100644 --- a/lerobot/common/robots/koch/robot_koch.py +++ b/lerobot/common/robots/koch/robot_koch.py @@ -21,6 +21,7 @@ import time import numpy as np from lerobot.common.cameras.utils import make_cameras_from_configs +from lerobot.common.constants import OBS_IMAGES, OBS_STATE from lerobot.common.errors import DeviceAlreadyConnectedError, DeviceNotConnectedError from lerobot.common.motors.dynamixel import ( DynamixelMotorsBus, @@ -118,8 +119,8 @@ class KochRobot(Robot): self.arm.read("Present_Position") # Connect the cameras - for name in self.cameras: - self.cameras[name].connect() + for cam in self.cameras.values(): + cam.connect() self.is_connected = True @@ -156,13 +157,13 @@ class KochRobot(Robot): # Read arm position before_read_t = time.perf_counter() - obs_dict["observation.state"] = self.arm.read("Present_Position") + obs_dict[OBS_STATE] = self.arm.read("Present_Position") self.logs["read_pos_dt_s"] = time.perf_counter() - before_read_t # Capture images from cameras for cam_key, cam in self.cameras.items(): before_camread_t = time.perf_counter() - obs_dict[f"observation.images.{cam_key}"] = cam.async_read() + obs_dict[f"{OBS_IMAGES}.{cam_key}"] = cam.async_read() self.logs[f"read_camera_{cam_key}_dt_s"] = cam.logs["delta_timestamp_s"] self.logs[f"async_read_camera_{cam_key}_dt_s"] = time.perf_counter() - before_camread_t