simulated camera seems ok

This commit is contained in:
steve 2024-11-18 18:28:57 +01:00
parent 58495d5c86
commit 039beb20de
2 changed files with 4 additions and 2 deletions

View File

@ -21,7 +21,7 @@ import numpy as np
import torch
from lerobot.common.robot_devices.cameras.utils import Camera
from reachy2_sdk import ReachySDK
from copy import copy
@ -122,7 +122,7 @@ class ReachyRobot():
images[name] = self.cameras[name].read() #Reachy cameras read() is not blocking?
print(f'name: {name} img: {images[name]}')
if images[name] is not None:
images[name] = torch.from_numpy(images[name][0])
images[name] = torch.from_numpy(copy(images[name][0])) #seems like I need to copy?
self.logs[f"read_camera_{name}_dt_s"] = images[name][1] #full timestamp, TODO dt
# Populate output dictionnaries

View File

@ -22,6 +22,7 @@ from lerobot.common.utils.utils import (init_hydra_config, init_logging,
log_say, none_or_int)
import time
import cv2
if __name__ == '__main__':
init_logging()
@ -35,3 +36,4 @@ if __name__ == '__main__':
print(robot.get_state())
print(robot.capture_observation())
time.sleep(6)