feat: add viser as new manipulation vis backend#2475
Conversation
# Conflicts: # dimos/manipulation/planning/monitor/world_monitor.py
283a6da to
9087b4d
Compare
Greptile SummaryThis PR adds Viser as a new manipulation visualization backend and replaces the old
Confidence Score: 5/5Safe to merge; the only findings are cosmetic improvements to the fallback path of the adapter and a dead config field. The new Viser backend is well-structured: server lifecycle, scene management, GUI panel, and threading model are cleanly separated. The initialization ordering is correct. Previously identified state-race issues in the GUI have been addressed. The only noteworthy items are a dead preview_request_timeout config field, a duplicate FK call in the fallback evaluation path, and a semantically misleading success=True for collision returns in the same fallback path, none of which affect the happy path. dimos/manipulation/visualization/viser/adapter.py - the evaluate_joint_target fallback path has two minor issues worth cleaning up. Important Files Changed
Sequence DiagramsequenceDiagram
participant MM as ManipulationModule
participant WM as WorldMonitor
participant VF as VisualizationFactory
participant VV as ViserManipulationVisualizer
participant GUI as ViserPanelGui
participant ADP as InProcessViserAdapter
MM->>WM: create_planning_specs()
MM->>VF: create_manipulation_visualization(config, world, world_monitor, self)
VF->>VV: ViserManipulationVisualizer(...)
VV->>ADP: InProcessViserAdapter(world_monitor, manipulation_module)
VV->>GUI: ViserPanelGui(server, adapter, config, scene)
GUI->>GUI: start() - refresh() - WAITING_FOR_ROBOT
VF-->>MM: visualization
MM->>WM: add_robot(config) x N
MM->>WM: finalize()
MM->>WM: set_visualization(visualization)
MM->>WM: sync_visualization_scene()
WM->>VV: initialize_scene(PlanningSceneInfo)
VV->>GUI: refresh() - READY
Note over GUI,ADP: User interaction
GUI->>ADP: evaluate_joint_target(joints, robot_name)
ADP->>WM: is_state_valid(robot_id, target)
ADP-->>GUI: result
GUI->>ADP: plan_to_joints(target, robot_name)
ADP->>MM: plan_to_joints(joints)
MM-->>GUI: bool
GUI->>ADP: preview_path(robot_name)
ADP->>MM: preview_path()
MM->>VV: animate_path(robot_id, path, duration)
VV->>VV: PreviewAnimator.animate() blocking
Reviews (5): Last reviewed commit: "fix: make viser theme test tolerate fall..." | Re-trigger Greptile |
Closes #2412 and supersedes #2413
Adds Viser as a manipulation planning visualizer and rewires manipulation visualization config around a single validated
visualizationfield. The new visualizer is more feature-rich than the original drake-bundled meshcat vis and provides a moveit style UI for plan/preview/execute.Main changes:
visualization_backend/visualization_optionsconfig with a Pydantic discriminatedvisualizationconfig fornone,meshcat, andviser.WorldSpecPlanningSpecsVisualizationSpecWorldMonitor.viser[urdf]in themanipulationextra and move Viser usage docs into the manipulation docs.Notes
allow_plan_execute.set_planning_target/clear_planning_targetVisualizationSpecAPI was reverted; target controls remain internal to the Viser GUI/scene.How to Test
Contributor License Agreement