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
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,9 @@ def explore(self, stop_event: Optional[threading.Event] = None) -> bool:

# Navigate to the frontier
logger.info(f"Navigating to frontier at {next_goal}")
navigation_successful = self.set_goal(next_goal, stop_event=stop_event)
navigation_successful = self.set_goal(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to re-handle the stop event here I removed to get it to work @alexlin2

next_goal,
)

if not navigation_successful:
logger.warning("Failed to navigate to frontier, continuing exploration")
Expand Down
32 changes: 19 additions & 13 deletions dimos/robot/global_planner/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ def __init__(self):
Module.__init__(self)
Visualizable.__init__(self)

# def set_goal(
# self,
# goal: VectorLike,
# goal_theta: Optional[float] = None,
# stop_event: Optional[threading.Event] = None,
# ):
# path = self.plan(goal)
# if not path:
# logger.warning("No path found to the goal.")
# return False
@rpc
def set_goal(
self,
goal: VectorLike,
goal_theta: Optional[float] = None,
stop_event: Optional[threading.Event] = None,
):
path = self.plan(goal)
if not path:
logger.warning("No path found to the goal.")
return False

# print("pathing success", path)
# return self.set_local_nav(path, stop_event=stop_event, goal_theta=goal_theta)
print("pathing success", path)


class AstarPlanner(Planner):
Expand All @@ -59,17 +59,20 @@ class AstarPlanner(Planner):

get_costmap: Callable[[], Costmap]
get_robot_pos: Callable[[], Vector3]
set_local_nav: Callable[[Path, Optional[threading.Event], Optional[float]], bool]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't rely on threading events anymore


conservativism: int = 8

def __init__(
self,
get_costmap: Callable[[], Costmap],
get_robot_pos: Callable[[], Vector3],
set_local_nav: Callable[[Path, Optional[threading.Event], Optional[float]], bool] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

):
super().__init__()
self.get_costmap = get_costmap
self.get_robot_pos = get_robot_pos
self.set_local_nav = set_local_nav

@rpc
def start(self):
Expand All @@ -80,9 +83,10 @@ def plan(self, goal: VectorLike) -> Path:
goal = to_vector(goal).to_2d()
pos = self.get_robot_pos()
print("current pos", pos)
costmap = self.get_costmap().smudge()
costmap = self.get_costmap()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.smudge() wasn't an issue? can be put back


print("current costmap", costmap)

self.vis("target", goal)

print("ASTAR ", costmap, goal, pos)
Expand All @@ -92,5 +96,7 @@ def plan(self, goal: VectorLike) -> Path:
path = path.resample(0.1)
self.vis("a*", path)
self.path.publish(path)
if hasattr(self, "set_local_nav"):
self.set_local_nav(path)
return path
logger.warning("No path found to the goal.")
7 changes: 0 additions & 7 deletions dimos/robot/local_planner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
from dimos.robot.local_planner.local_planner import (
BaseLocalPlanner,
navigate_to_goal_local,
navigate_path_local,
)

from dimos.robot.local_planner.vfh_local_planner import VFHPurePursuitPlanner
Loading