Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dimos/agents/skills/person_follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,18 @@ def __init__(self, **kwargs: Any) -> None:
self._should_stop: Event = Event()
self._lock = RLock()

# Use MuJoCo camera intrinsics in simulation mode
# Use simulator camera intrinsics in simulation mode
camera_info = self.config.camera_info
if self.config.g.simulation:
if self.config.g.simulation == "mujoco":
from dimos.robot.unitree.mujoco_connection import MujocoConnection

camera_info = MujocoConnection.camera_info_static
elif self.config.g.simulation == "dimsim":
from dimos.robot.unitree.dimsim_connection import DimSimConnection

self._visual_servo = VisualServoing2D(camera_info, self.config.g.simulation)
camera_info = DimSimConnection.camera_info_static

self._visual_servo = VisualServoing2D(camera_info, bool(self.config.g.simulation))
self._detection_navigation = DetectionNavigation(self.tf, camera_info)

@rpc
Expand Down
7 changes: 5 additions & 2 deletions dimos/core/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GlobalConfig(BaseSettings):
xarm7_ip: str | None = None
xarm6_ip: str | None = None
can_port: str = "can0"
simulation: bool = False
simulation: str = ""
replay: bool = False
replay_dir: str = "go2_sf_office"
new_memory: bool = False
Expand Down Expand Up @@ -70,12 +70,15 @@ def update(self, **kwargs: object) -> None:
raise AttributeError(f"GlobalConfig has no field '{key}'")
setattr(self, key, value)

dimsim_scene: str = "apt"
dimsim_port: int = 8090

@property
def unitree_connection_type(self) -> str:
if self.replay:
return "replay"
if self.simulation:
return "mujoco"
return self.simulation
return "webrtc"

@property
Expand Down
5 changes: 5 additions & 0 deletions dimos/msgs/sensor_msgs/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ def lcm_encode(self, frame_id: str | None = None) -> bytes:
@classmethod
def lcm_decode(cls, data: bytes, **kwargs: Any) -> Image:
msg = LCMImage.lcm_decode(data)

# JPEG-compressed images use a different decode path.
if msg.encoding == "jpeg":
return cls.lcm_jpeg_decode(data, **kwargs)

fmt, dtype, channels = _parse_lcm_encoding(msg.encoding)
arr: np.ndarray[Any, Any] = np.frombuffer(msg.data, dtype=dtype)
if channels == 1:
Expand Down
Loading
Loading