Skip to content

Commit d82e102

Browse files
skaladepre-commit-ci[bot]
authored andcommitted
update KochFollower.get_observation() so it returns same observation structure as SO101 (#1248)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ca5adb7 commit d82e102

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lerobot/common/robots/koch_follower/koch_follower.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from typing import Any
2121

2222
from lerobot.common.cameras.utils import make_cameras_from_configs
23-
from lerobot.common.constants import OBS_STATE
2423
from lerobot.common.errors import DeviceAlreadyConnectedError, DeviceNotConnectedError
2524
from lerobot.common.motors import Motor, MotorCalibration, MotorNormMode
2625
from lerobot.common.motors.dynamixel import (
@@ -175,11 +174,9 @@ def get_observation(self) -> dict[str, Any]:
175174
if not self.is_connected:
176175
raise DeviceNotConnectedError(f"{self} is not connected.")
177176

178-
obs_dict = {}
179-
180177
# Read arm position
181178
start = time.perf_counter()
182-
obs_dict[OBS_STATE] = self.bus.sync_read("Present_Position")
179+
obs_dict = self.bus.sync_read("Present_Position")
183180
obs_dict = {f"{motor}.pos": val for motor, val in obs_dict.items()}
184181
dt_ms = (time.perf_counter() - start) * 1e3
185182
logger.debug(f"{self} read state: {dt_ms:.1f}ms")

0 commit comments

Comments
 (0)