From 8eaa0327311b47384f11f8483ef7b763836e5e75 Mon Sep 17 00:00:00 2001 From: Ivan Nikolic Date: Mon, 29 Jun 2026 15:06:12 +0300 Subject: [PATCH 1/6] spec for trajectory / obstacle avoidance --- dimos/spec/nav.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 dimos/spec/nav.py diff --git a/dimos/spec/nav.py b/dimos/spec/nav.py new file mode 100644 index 0000000000..89af4b856d --- /dev/null +++ b/dimos/spec/nav.py @@ -0,0 +1,40 @@ +# Copyright 2026 Dimensional Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Protocol + +from dimos.core.stream import Out +from dimos.msgs.nav_msgs.Odometry import Odometry as OdometryMsg +from dimos.msgs.nav_msgs.Path import Path +from dimos.msgs.sensor_msgs.Odometry import Odometry +from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 + + +class TrajectoryController(Protocol): + odometry: In[OdometryMsg] + path: In[Path] + + cmd_vel: Out[Twist] + goal_reached: Out[bool] + + # equivalent to emitting an empty path? + stop_movement: In[bool] + + +class ObstacleAvoidance(Protocol): + # LoGlo/terrainmap perception within some radius + lidar: In[PointCloud2] + odometry: In[Odometry] + cmd_vel: In[Twist] + safe_cmd_vel: Out[Twist] From c28bd11aca1319b7e5282c24401ee85b1aca020f Mon Sep 17 00:00:00 2001 From: Ivan Nikolic Date: Mon, 29 Jun 2026 15:07:42 +0300 Subject: [PATCH 2/6] one comment --- dimos/spec/nav.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dimos/spec/nav.py b/dimos/spec/nav.py index 89af4b856d..067980401a 100644 --- a/dimos/spec/nav.py +++ b/dimos/spec/nav.py @@ -32,6 +32,9 @@ class TrajectoryController(Protocol): stop_movement: In[bool] +# this can take a radius of a robot +# or even better some more precise shape of the robot (e.g. a polygon) to avoid collisions +# probably force based repelling (like native go2 obstacle avoidance is better than just stopping the robot) class ObstacleAvoidance(Protocol): # LoGlo/terrainmap perception within some radius lidar: In[PointCloud2] From c3d3454b2efd1a085e52d09bf48bc0dd808dbced Mon Sep 17 00:00:00 2001 From: Ivan Nikolic Date: Mon, 29 Jun 2026 15:09:07 +0300 Subject: [PATCH 3/6] path, not twist --- dimos/spec/nav.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dimos/spec/nav.py b/dimos/spec/nav.py index 067980401a..cce5989127 100644 --- a/dimos/spec/nav.py +++ b/dimos/spec/nav.py @@ -39,5 +39,5 @@ class ObstacleAvoidance(Protocol): # LoGlo/terrainmap perception within some radius lidar: In[PointCloud2] odometry: In[Odometry] - cmd_vel: In[Twist] - safe_cmd_vel: Out[Twist] + path: In[Path] + safe_path: Out[Path] From 09dae24ed41cbd33dbd1e2b679f491193794d27d Mon Sep 17 00:00:00 2001 From: Ivan Nikolic Date: Mon, 29 Jun 2026 15:10:25 +0300 Subject: [PATCH 4/6] renamed to localplanner --- dimos/spec/nav.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dimos/spec/nav.py b/dimos/spec/nav.py index cce5989127..99dcc71b1e 100644 --- a/dimos/spec/nav.py +++ b/dimos/spec/nav.py @@ -35,9 +35,9 @@ class TrajectoryController(Protocol): # this can take a radius of a robot # or even better some more precise shape of the robot (e.g. a polygon) to avoid collisions # probably force based repelling (like native go2 obstacle avoidance is better than just stopping the robot) -class ObstacleAvoidance(Protocol): +class LocalPlanner(Protocol): # LoGlo/terrainmap perception within some radius - lidar: In[PointCloud2] + lidar: In[PointCloud2] # or occupancygrid? odometry: In[Odometry] path: In[Path] safe_path: Out[Path] From 9e5ba6c0922b71275935175f3d99e84fb8e9c6af Mon Sep 17 00:00:00 2001 From: leshy Date: Mon, 29 Jun 2026 15:34:03 +0300 Subject: [PATCH 5/6] Apply suggestion from @greptile-apps[bot] Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- dimos/spec/nav.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dimos/spec/nav.py b/dimos/spec/nav.py index 99dcc71b1e..f8709e7583 100644 --- a/dimos/spec/nav.py +++ b/dimos/spec/nav.py @@ -14,7 +14,7 @@ from typing import Protocol -from dimos.core.stream import Out +from dimos.core.stream import In, Out from dimos.msgs.nav_msgs.Odometry import Odometry as OdometryMsg from dimos.msgs.nav_msgs.Path import Path from dimos.msgs.sensor_msgs.Odometry import Odometry From 3b842cafc64a8798ed10417582392b967baefafa Mon Sep 17 00:00:00 2001 From: Ivan Nikolic Date: Mon, 29 Jun 2026 17:45:01 +0300 Subject: [PATCH 6/6] fix nav spec imports: add Twist, fix broken Odometry module - import Twist for TrajectoryController.cmd_vel (greptile fix added In/Out but missed Twist) - repoint Odometry from nonexistent sensor_msgs to nav_msgs - collapse duplicate Odometry imports onto one name --- dimos/spec/nav.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dimos/spec/nav.py b/dimos/spec/nav.py index f8709e7583..6abf32d792 100644 --- a/dimos/spec/nav.py +++ b/dimos/spec/nav.py @@ -15,14 +15,14 @@ from typing import Protocol from dimos.core.stream import In, Out -from dimos.msgs.nav_msgs.Odometry import Odometry as OdometryMsg +from dimos.msgs.geometry_msgs.Twist import Twist +from dimos.msgs.nav_msgs.Odometry import Odometry from dimos.msgs.nav_msgs.Path import Path -from dimos.msgs.sensor_msgs.Odometry import Odometry from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 class TrajectoryController(Protocol): - odometry: In[OdometryMsg] + odometry: In[Odometry] path: In[Path] cmd_vel: Out[Twist]