mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-23 20:50:02 +00:00
Merge remote-tracking branch 'refs/remotes/origin/update_html_visualizer' into update_html_visualizer
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 align="center">
|
<h2 align="center">
|
||||||
<p><a href="https://github.com/huggingface/lerobot/blob/main/examples/12_use_so101.md">
|
<p><a href="https://huggingface.co/docs/lerobot/so101">
|
||||||
Build Your Own SO-101 Robot!</a></p>
|
Build Your Own SO-101 Robot!</a></p>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
@@ -48,11 +48,11 @@
|
|||||||
<p>Train it in minutes with a few simple moves on your laptop.</p>
|
<p>Train it in minutes with a few simple moves on your laptop.</p>
|
||||||
<p>Then sit back and watch your creation act autonomously! 🤯</p>
|
<p>Then sit back and watch your creation act autonomously! 🤯</p>
|
||||||
|
|
||||||
<p><a href="https://github.com/huggingface/lerobot/blob/main/examples/12_use_so101.md">
|
<p><a href="https://huggingface.co/docs/lerobot/so101">
|
||||||
See the full SO-101 tutorial here.</a></p>
|
See the full SO-101 tutorial here.</a></p>
|
||||||
|
|
||||||
<p>Want to take it to the next level? Make your SO-101 mobile by building LeKiwi!</p>
|
<p>Want to take it to the next level? Make your SO-101 mobile by building LeKiwi!</p>
|
||||||
<p>Check out the <a href="https://github.com/huggingface/lerobot/blob/main/examples/11_use_lekiwi.md">LeKiwi tutorial</a> and bring your robot to life on wheels.</p>
|
<p>Check out the <a href="https://huggingface.co/docs/lerobot/lekiwi">LeKiwi tutorial</a> and bring your robot to life on wheels.</p>
|
||||||
|
|
||||||
<img src="media/lekiwi/kiwi.webp?raw=true" alt="LeKiwi mobile robot" title="LeKiwi mobile robot" width="50%">
|
<img src="media/lekiwi/kiwi.webp?raw=true" alt="LeKiwi mobile robot" title="LeKiwi mobile robot" width="50%">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -225,16 +225,19 @@ class OpenCVCamera(Camera):
|
|||||||
def _validate_width_and_height(self) -> None:
|
def _validate_width_and_height(self) -> None:
|
||||||
"""Validates and sets the camera's frame capture width and height."""
|
"""Validates and sets the camera's frame capture width and height."""
|
||||||
|
|
||||||
success = self.videocapture.set(cv2.CAP_PROP_FRAME_WIDTH, float(self.capture_width))
|
width_success = self.videocapture.set(cv2.CAP_PROP_FRAME_WIDTH, float(self.capture_width))
|
||||||
actual_width = int(round(self.videocapture.get(cv2.CAP_PROP_FRAME_WIDTH)))
|
height_success = self.videocapture.set(cv2.CAP_PROP_FRAME_HEIGHT, float(self.capture_height))
|
||||||
if not success or self.capture_width != actual_width:
|
|
||||||
raise RuntimeError(f"{self} failed to set capture_width={self.capture_width} ({actual_width=}).")
|
|
||||||
|
|
||||||
success = self.videocapture.set(cv2.CAP_PROP_FRAME_HEIGHT, float(self.capture_height))
|
actual_width = int(round(self.videocapture.get(cv2.CAP_PROP_FRAME_WIDTH)))
|
||||||
actual_height = int(round(self.videocapture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
|
if not width_success or self.capture_width != actual_width:
|
||||||
if not success or self.capture_height != actual_height:
|
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f"{self} failed to set capture_height={self.capture_height} ({actual_height})."
|
f"{self} failed to set capture_width={self.capture_width} ({actual_width=}, {width_success=})."
|
||||||
|
)
|
||||||
|
|
||||||
|
actual_height = int(round(self.videocapture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
|
||||||
|
if not height_success or self.capture_height != actual_height:
|
||||||
|
raise RuntimeError(
|
||||||
|
f"{self} failed to set capture_height={self.capture_height} ({actual_height=}, {height_success=})."
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from functools import cached_property
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from lerobot.common.cameras.utils import make_cameras_from_configs
|
from lerobot.common.cameras.utils import make_cameras_from_configs
|
||||||
from lerobot.common.constants import OBS_STATE
|
|
||||||
from lerobot.common.errors import DeviceAlreadyConnectedError, DeviceNotConnectedError
|
from lerobot.common.errors import DeviceAlreadyConnectedError, DeviceNotConnectedError
|
||||||
from lerobot.common.motors import Motor, MotorCalibration, MotorNormMode
|
from lerobot.common.motors import Motor, MotorCalibration, MotorNormMode
|
||||||
from lerobot.common.motors.dynamixel import (
|
from lerobot.common.motors.dynamixel import (
|
||||||
@@ -175,11 +174,9 @@ class KochFollower(Robot):
|
|||||||
if not self.is_connected:
|
if not self.is_connected:
|
||||||
raise DeviceNotConnectedError(f"{self} is not connected.")
|
raise DeviceNotConnectedError(f"{self} is not connected.")
|
||||||
|
|
||||||
obs_dict = {}
|
|
||||||
|
|
||||||
# Read arm position
|
# Read arm position
|
||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
obs_dict[OBS_STATE] = self.bus.sync_read("Present_Position")
|
obs_dict = self.bus.sync_read("Present_Position")
|
||||||
obs_dict = {f"{motor}.pos": val for motor, val in obs_dict.items()}
|
obs_dict = {f"{motor}.pos": val for motor, val in obs_dict.items()}
|
||||||
dt_ms = (time.perf_counter() - start) * 1e3
|
dt_ms = (time.perf_counter() - start) * 1e3
|
||||||
logger.debug(f"{self} read state: {dt_ms:.1f}ms")
|
logger.debug(f"{self} read state: {dt_ms:.1f}ms")
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export const VideosPlayer = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
videoRefs.current.forEach((video) => {
|
videoRefs.current.forEach((video) => {
|
||||||
if (video) {
|
if (video) {
|
||||||
// If already ready, call the handler immediately
|
// If already ready, call the handler immediately
|
||||||
@@ -182,7 +182,7 @@ export const VideosPlayer = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
videoRefs.current.forEach((video) => {
|
videoRefs.current.forEach((video) => {
|
||||||
if (video) {
|
if (video) {
|
||||||
@@ -191,7 +191,7 @@ export const VideosPlayer = ({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Error message */}
|
{/* Error message */}
|
||||||
|
|||||||
Reference in New Issue
Block a user