Skip to content

Commit 0c18313

Browse files
committed
add office environment for mujoco
1 parent d0d2ee4 commit 0c18313

13 files changed

Lines changed: 148 additions & 366 deletions

File tree

assets/policies/go1_policy.onnx

Lines changed: 0 additions & 3 deletions
This file was deleted.
-166 KB
Binary file not shown.
-1.53 MB
Binary file not shown.

assets/robots/go1/robot.xml

Lines changed: 0 additions & 306 deletions
This file was deleted.

bin/explore-cmd

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Simple command line tool to trigger robot exploration.
5+
6+
Usage:
7+
explore_cmd.py start # Start exploration
8+
explore_cmd.py stop # Stop exploration
9+
"""
10+
11+
import sys
12+
from dimos.protocol.pubsub.lcmpubsub import LCM, Topic
13+
from dimos_lcm.std_msgs import Bool
14+
15+
16+
def main():
17+
if len(sys.argv) != 2 or sys.argv[1] not in ["start", "stop"]:
18+
print("Usage: bin/explore-cmd [start|stop]")
19+
sys.exit(1)
20+
21+
command = sys.argv[1]
22+
23+
lcm = LCM()
24+
25+
msg = Bool()
26+
msg.data = True
27+
28+
if command == "start":
29+
topic = Topic("/explore_cmd", Bool)
30+
lcm.publish(topic, msg)
31+
print("✓ Sent start exploration command")
32+
elif command == "stop":
33+
topic = Topic("/stop_explore_cmd", Bool)
34+
lcm.publish(topic, msg)
35+
print("✓ Sent stop exploration command")
36+
37+
38+
if __name__ == "__main__":
39+
main()

data/.lfs/mujoco_sim.tar.gz

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:e3d607ce57127a6ac558f81ebb9c98bd23a71a86f9ffd5700b3389bf1a19ddf2
3+
size 59341859

dimos/navigation/frontier_exploration/wavefront_frontier_goal_selector.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ class WavefrontFrontierExplorer(Module):
9393
costmap: In[OccupancyGrid] = None
9494
odometry: In[PoseStamped] = None
9595
goal_reached: In[Bool] = None
96+
explore_cmd: In[Bool] = None
97+
stop_explore_cmd: In[Bool] = None
9698

9799
# LCM outputs
98100
goal_request: Out[PoseStamped] = None
@@ -159,6 +161,12 @@ def start(self):
159161
if self.goal_reached.transport is not None:
160162
self.goal_reached.subscribe(self._on_goal_reached)
161163

164+
# Subscribe to exploration commands
165+
if self.explore_cmd.transport is not None:
166+
self.explore_cmd.subscribe(self._on_explore_cmd)
167+
if self.stop_explore_cmd.transport is not None:
168+
self.stop_explore_cmd.subscribe(self._on_stop_explore_cmd)
169+
162170
logger.info("WavefrontFrontierExplorer started")
163171

164172
@rpc
@@ -180,6 +188,18 @@ def _on_goal_reached(self, msg: Bool):
180188
if msg.data:
181189
self.goal_reached_event.set()
182190

191+
def _on_explore_cmd(self, msg: Bool):
192+
"""Handle exploration command messages."""
193+
if msg.data:
194+
logger.info("Received exploration start command via LCM")
195+
self.explore()
196+
197+
def _on_stop_explore_cmd(self, msg: Bool):
198+
"""Handle stop exploration command messages."""
199+
if msg.data:
200+
logger.info("Received exploration stop command via LCM")
201+
self.stop_exploration()
202+
183203
def _count_costmap_information(self, costmap: OccupancyGrid) -> int:
184204
"""
185205
Count the amount of information in a costmap (free space + obstacles).

0 commit comments

Comments
 (0)