|
18 | 18 | from dimos_lcm.sensor_msgs import CameraInfo |
19 | 19 |
|
20 | 20 | from dimos.core.blueprints import autoconnect |
| 21 | +from dimos.core.global_config import global_config |
21 | 22 | from dimos.core.transport import LCMTransport |
22 | 23 | from dimos.hardware.sensors.camera import zed |
23 | 24 | from dimos.hardware.sensors.camera.module import camera_module # type: ignore[attr-defined] |
|
29 | 30 | from dimos.msgs.sensor_msgs import Image, PointCloud2 |
30 | 31 | from dimos.msgs.std_msgs import Bool |
31 | 32 | from dimos.navigation.frontier_exploration import wavefront_frontier_explorer |
32 | | -from dimos.robot.foxglove_bridge import foxglove_bridge |
| 33 | +from dimos.protocol.pubsub.impl.lcmpubsub import LCM |
33 | 34 | from dimos.web.websocket_vis.websocket_vis_module import websocket_vis |
34 | 35 |
|
| 36 | +rerun_config = { |
| 37 | + "pubsubs": [LCM(autoconf=True)], |
| 38 | + "visual_override": { |
| 39 | + "world/camera_info": lambda camera_info: camera_info.to_rerun( |
| 40 | + image_topic="/world/color_image", |
| 41 | + optical_frame="camera_optical", |
| 42 | + ), |
| 43 | + "world/global_map": lambda grid: grid.to_rerun(voxel_size=0.1, mode="boxes"), |
| 44 | + "world/navigation_costmap": lambda grid: grid.to_rerun( |
| 45 | + colormap="Accent", |
| 46 | + z_offset=0.015, |
| 47 | + opacity=0.2, |
| 48 | + background="#484981", |
| 49 | + ), |
| 50 | + }, |
| 51 | + "static": { |
| 52 | + "world/tf/base_link": lambda rr: [ |
| 53 | + rr.Boxes3D( |
| 54 | + half_sizes=[0.2, 0.15, 0.75], |
| 55 | + colors=[(0, 255, 127)], |
| 56 | + fill_mode="MajorWireframe", |
| 57 | + ), |
| 58 | + rr.Transform3D(parent_frame="tf#/base_link"), |
| 59 | + ] |
| 60 | + }, |
| 61 | +} |
| 62 | + |
| 63 | +match global_config.viewer_backend: |
| 64 | + case "foxglove": |
| 65 | + from dimos.robot.foxglove_bridge import foxglove_bridge |
| 66 | + |
| 67 | + _with_vis = autoconnect(foxglove_bridge()) |
| 68 | + case "rerun": |
| 69 | + from dimos.visualization.rerun.bridge import rerun_bridge |
| 70 | + |
| 71 | + _with_vis = autoconnect(rerun_bridge(**rerun_config)) |
| 72 | + case "rerun-web": |
| 73 | + from dimos.visualization.rerun.bridge import rerun_bridge |
| 74 | + |
| 75 | + _with_vis = autoconnect(rerun_bridge(viewer_mode="web", **rerun_config)) |
| 76 | + case _: |
| 77 | + _with_vis = autoconnect() |
| 78 | + |
35 | 79 | uintree_g1_primitive_no_nav = ( |
36 | 80 | autoconnect( |
| 81 | + _with_vis, |
37 | 82 | camera_module( |
38 | 83 | transform=Transform( |
39 | 84 | translation=Vector3(0.05, 0.0, 0.6), # height of camera on G1 robot |
|
53 | 98 | wavefront_frontier_explorer(), |
54 | 99 | # Visualization |
55 | 100 | websocket_vis(), |
56 | | - foxglove_bridge(), |
57 | 101 | ) |
58 | 102 | .global_config(n_dask_workers=4, robot_model="unitree_g1") |
59 | 103 | .transports( |
|
0 commit comments