Skip to content
Merged
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
3 changes: 0 additions & 3 deletions data/.lfs/astar_corner_general.png.tar.gz

This file was deleted.

3 changes: 0 additions & 3 deletions data/.lfs/astar_general.png.tar.gz

This file was deleted.

2 changes: 0 additions & 2 deletions dimos/core/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from pydantic_settings import BaseSettings, SettingsConfigDict

from dimos.mapping.occupancy.path_map import NavigationStrategy
from dimos.navigation.global_planner.types import AStarAlgorithm

ViewerBackend: TypeAlias = Literal["rerun-web", "rerun-native", "foxglove"]

Expand Down Expand Up @@ -48,7 +47,6 @@ class GlobalConfig(BaseSettings):
robot_width: float = 0.3
robot_rotation_diameter: float = 0.6
planner_strategy: NavigationStrategy = "simple"
astar_algorithm: AStarAlgorithm = "min_cost"
planner_robot_speed: float | None = None

model_config = SettingsConfigDict(
Expand Down
12 changes: 9 additions & 3 deletions dimos/hardware/sensors/camera/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import queue
import time

from dimos_lcm.sensor_msgs import CameraInfo
import reactivex as rx
from reactivex import operators as ops
from reactivex.disposable import Disposable
Expand All @@ -30,6 +29,7 @@
from dimos.hardware.sensors.camera.webcam import Webcam
from dimos.msgs.geometry_msgs import Quaternion, Transform, Vector3
from dimos.msgs.sensor_msgs import Image
from dimos.msgs.sensor_msgs.CameraInfo import CameraInfo
from dimos.msgs.sensor_msgs.Image import Image, sharpness_barrier
from dimos.spec import perception as spec # type: ignore[no-redef]

Expand All @@ -48,6 +48,7 @@ class CameraModuleConfig(ModuleConfig):
frame_id: str = "camera_link"
transform: Transform | None = field(default_factory=default_transform)
hardware: Callable[[], CameraHardware] | CameraHardware = Webcam # type: ignore[type-arg]
frequency: float = 5.0


class CameraModule(Module[CameraModuleConfig], spec.Camera):
Expand Down Expand Up @@ -84,7 +85,7 @@ def start(self): # type: ignore[no-untyped-def]

# camera_info_stream = self.camera_info_stream(frequency=5.0)

def publish_info(camera_info: CameraInfo): # type: ignore[no-untyped-def]
def publish_info(camera_info: CameraInfo) -> None:
self.camera_info.publish(camera_info)

if self.config.transform is None:
Expand All @@ -103,7 +104,7 @@ def publish_info(camera_info: CameraInfo): # type: ignore[no-untyped-def]
self.tf.publish(camera_link, camera_optical)

self._camera_info_subscription = self.camera_info_stream().subscribe(publish_info) # type: ignore[assignment]
self._module_subscription = stream.subscribe(self.image.publish) # type: ignore[attr-defined]
self._module_subscription = stream.subscribe(self.color_image.publish) # type: ignore[attr-defined]

@skill(stream=Stream.passive, output=Output.image, reducer=Reducer.latest) # type: ignore[arg-type]
def video_stream(self) -> Image: # type: ignore[misc]
Expand Down Expand Up @@ -149,3 +150,8 @@ def stop(self): # type: ignore[no-untyped-def]
if self.hardware and hasattr(self.hardware, "stop"):
self.hardware.stop()
super().stop()


camera_module = CameraModule.blueprint

__all__ = ["CameraModule", "camera_module"]
2 changes: 1 addition & 1 deletion dimos/hardware/sensors/camera/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
from abc import ABC, abstractmethod, abstractproperty
from typing import Generic, Protocol, TypeVar

from dimos_lcm.sensor_msgs import CameraInfo
from reactivex.observable import Observable

from dimos.msgs.sensor_msgs import Image
from dimos.msgs.sensor_msgs.CameraInfo import CameraInfo
from dimos.protocol.service import Configurable # type: ignore[attr-defined]


Expand Down
4 changes: 2 additions & 2 deletions dimos/mapping/occupancy/test_path_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from dimos.msgs.geometry_msgs import Pose
from dimos.msgs.geometry_msgs.Vector3 import Vector3
from dimos.msgs.sensor_msgs import Image
from dimos.navigation.global_planner.astar import astar
from dimos.navigation.replanning_a_star.min_cost_astar import min_cost_astar
from dimos.utils.data import get_data


Expand All @@ -37,7 +37,7 @@ def test_make_path_mask(occupancy_gradient, pose_index, max_length, expected_ima
start = Vector3(4.0, 2.0, 0)
goal_pose = Pose(6.15, 10.0, 0, 0, 0, 0, 1)
expected = Image.from_file(get_data(expected_image))
path = astar("min_cost", occupancy_gradient, goal_pose.position, start, use_cpp=False)
path = min_cost_astar(occupancy_gradient, goal_pose.position, start, use_cpp=False)
path = smooth_resample_path(path, goal_pose, 0.1)
robot_width = 0.4
path_mask = make_path_mask(occupancy_gradient, path, robot_width, pose_index, max_length)
Expand Down
4 changes: 2 additions & 2 deletions dimos/mapping/occupancy/test_path_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from dimos.msgs.geometry_msgs.Vector3 import Vector3
from dimos.msgs.nav_msgs.OccupancyGrid import OccupancyGrid
from dimos.msgs.sensor_msgs.Image import Image
from dimos.navigation.global_planner.astar import astar
from dimos.navigation.replanning_a_star.min_cost_astar import min_cost_astar
from dimos.utils.data import get_data


Expand All @@ -36,7 +36,7 @@ def test_resample_path(costmap, method) -> None:
start = Vector3(4.0, 2.0, 0)
goal_pose = Pose(6.15, 10.0, 0, 0, 0, 0, 1)
expected = Image.from_file(get_data(f"resample_path_{method}.png"))
path = astar("min_cost", costmap, goal_pose.position, start, use_cpp=False)
path = min_cost_astar(costmap, goal_pose.position, start, use_cpp=False)

match method:
case "simple":
Expand Down
1 change: 0 additions & 1 deletion dimos/navigation/bt_navigator/__init__.py

This file was deleted.

Loading