Merged
Conversation
Introduce a 'mujoco_profile' concept allowing self-contained MuJoCo
simulation bundles (MJCF + ONNX policy + assets) to be loaded by name.
Key changes:
- GlobalConfig: new 'mujoco_profile' field (--mujoco-profile CLI flag)
- model.py: profile-scoped asset loading and bundle.json support
- mujoco_process.py: read camera names from bundle.json per profile
- policy.py: MjlabVelocityOnnxController reads joint_names,
default_joint_pos, action_scale from ONNX metadata for exact
MJLab action contract (per-joint scaling & named ordering)
- mujoco_connection.py: skip menagerie download when profile is set
- blueprints.py / rerun_init.py: gate Rerun init on rerun_enabled
Bundle added to data/.lfs/mujoco_sim.tar.gz (LFS-tracked):
data/mujoco_sim/unitree_g1_mjlab/
├── model.xml (MJLab-compiled G1 MJCF with correct actuators)
├── policy.onnx (trained velocity policy with metadata)
├── bundle.json (camera name mappings)
└── assets/ (STL meshes from MJLab asset_zoo)
Usage:
dimos --simulation \
--mujoco-profile unitree_g1_mjlab \
run unitree-g1-basic-sim
- mujoco_process.py: only use mujoco_profile when explicitly set (fixes GO2 accidentally being treated as a profile bundle) - model.py: rewrite scene XML to remove meshdir/texturedir attrs and prefix mesh/texture filenames explicitly, preventing scene compiler settings from hijacking robot mesh resolution
Adds a built-in timing breakdown for the MuJoCo simulation subprocess. When enabled, logs rolling averages of time spent in each component: - physics_ms: mj_step loop - viewer_sync_ms: MuJoCo viewer synchronization - rgb_render_ms, depth_render_ms: camera rendering - pcd_ms: depth-to-pointcloud + voxel downsample - *_shm_ms: shared memory writes - ctrl_calls, ctrl_obs_ms, ctrl_onnx_ms: policy cost breakdown This helps diagnose performance issues (e.g. 'molasses' effect) by showing exactly where frame time is being spent. Usage: # Standard G1 sim with profiler: dimos --simulation --mujoco-profiler --mujoco-profiler-interval-s 2 run unitree-g1-basic-sim # MJLab bundle with profiler: dimos --simulation --mujoco-profile unitree_g1_mjlab --mujoco-profiler --mujoco-profiler-interval-s 2 run unitree-g1-basic-sim New GlobalConfig flags: - mujoco_profiler: bool (default False) - mujoco_profiler_interval_s: float (default 2.0)
* fix print to be correct URL based on rerun web or not * make width of rerun/command center adjustable * swap sides
* minimal edit * rice the readme * grammar * formatting * fix examples * change links to reduce change count * improve wording * wording * remove acknowledgements * improve the humancli example * formatting * Update README.md * switch to dev branch for development * changes for paul * Update README.md * fix broken link * update broken link
* add uv to nix and fix resulting problems * fix for linux
* capitalization * punctuation * more small fixes
* raw rospubsub and benchmarks * typefixes, shm added to the benchmark * SHM is not so important to tell us every time when it starts * greptile comments * Add co-authorship line to commit message filter patterns * Remove unused contextmanager import * lcmservice correct kernel settings reintroduced * mixin mixin resolved * lcmservice tests fix * macos lcm rmem fix
- Changed GlobalConfig.viewer_backend default from rerun-native to rerun-web - WebsocketVisModule now opens dashboard in browser automatically on start - Requested by Jeff Co-authored-by: s <pomichterstash@gmail.com>
* refactor(policy): update inference session initialization * refactor(policy): simplify inference session provider initialization * Log the policy directory and provider
…eline and replaced with Object Scene Registration (#936) * added rate limiting and backpressure to pointcloud publishing CI code cleanup updated ZED module to the same standard as realsense CI code cleanup fixed stash's comments CI code cleanup mypy fixes + comments removed property of camera_info should pass CI now added detection3d pointcloud types from depth image added yoloe support and 3D object segmentation CI code cleanup use yoloe-s instead for nuc CI code cleanup removed deprecated perception code some pointcloud color changes major refactor and added object class for object scene registration CI code cleanup refactored, added objectDB for persistent object memory CI code cleanup made objectDB a normal class instead of a module CI code cleanup revert to dev reverted more files CI code cleanup completely refactored object scene registration to work natively in dimos instead of using ROS as transport. Made everything super clean and working CI code cleanup bug fixed + use yoloe-l by default added yolo object exlusion list CI code cleanup added zed camera to the object registration demo CI code cleanup added image and pointclou2 fixes and as_numpy function working promptable object scene registration CI code cleanup bug fixes bug fix + remove ros imports should not fail CI now CI code cleanup more CI fixes, somehow local CI did not catch changed prompt fixed bug CI code cleanup reverted some changes Cleanup very dead code and fixed mypy errors CI code cleanup fixed more mypy CI code cleanup * one last mypy fix * added default to imagedetection2d to not set off mypy * fixed bug and default to open vocab for detection * mypy fixes * fixed one last mypy error * fixed all of Stash's comments * should pass mypy now * added uv lock * sync uv.lock with dev * fixed the last mypy error * fixed mypy errors from source * reverted mypy import error fixes * fixed Ivan's comment * fixed last of ivan's comment * remove all to_ros_msgs stuff in this commit * passed Ivan's detector tests * added README for depth camera integration * fixed last of Stash's comments
#988) * feat(cli): type-free topic echo via /topic#pkg.Msg inference, this mirrors ros topic echo functionality. - Make type_name optional in 'dimos topic echo' - Infer message type from LCM channel suffix (e.g. /odom#nav_msgs.Odometry) - Dynamically import dimos.msgs.<pkg> and call cls.lcm_decode(data) - Keep existing explicit-type mode working - Update transports.md docs * fix(cli): use LCMPubSubBase instead of raw lcm.LCM for topic echo, my bad
* verify blueprints * Fix geometry msgs check failure in CI --------- Co-authored-by: stash <pomichterstash@gmail.com>
…sed RAG (#973) * temporal memory + vlm agent + blueprints * fixing module issue and style * fix skill registration * removing state functions unpickable * inheritancefixes and memory management * docstring for query * microcommit: fixing memory buffer * sharpness filter and simplified frame filtering * CI code cleanup * initial graph database implementation * db implementation, working and stylized, best reply is unitree_go2_office_walk2 * type checking issues * final edits, move into experimental, revert non-memory code edits, typechecking * persistent db flag enabled in config * Fix test to not run in CI due to LFS pull * Fix CLIP filter to use dimensional clip * Add path to temporal memory * revert video operators * Revert moondream * added temporal memory docs * Refactor move to /experimental/temporal_memory --------- Co-authored-by: Paul Nechifor <paul@nechifor.net> Co-authored-by: Stash Pomichter <pomichterstash@gmail.com> Co-authored-by: shreyasrajesh0308 <shreyasrajesh0308@users.noreply.github.com> Co-authored-by: spomichter <12108168+spomichter@users.noreply.github.com>
… controller (#970) * archive old driver to manipulators_old for redesign * spec.py defining minimal protocol for an arm driver * xarm driver driver added - driver owns control thread and robot state threads also invokes rpc calls to arm specific SDK backends * xarm SDK specific wrapper to interface with dimos RPC calls from the driver * removed type checking for old armdriver spec from the cartesian controller * replicated piper driver to meet the new architecture * added mock backend * updated all blueprints to add new arm module * Added readme explaining new driver architecture overview * config now parsed in backend init instead of connect method * addded dual arm control blueprint using trajectory controller * adding a control orchestrator for single control loop for multiple arms and joint control - added dataclasses for orchestrator and protocol for ControlTask * hardware interface protocol that wraps specific arm SDK to work with orchestrator. Also solves namespace for multiple arm and hardware * main orchestrator module and control loop that claims resources computes next commands, and arbitrates priority of different tasks and controllers * added a trajectory task implementation that performs trajecotry control * added blueprints to launch orchestratory module with differnt arms for testing * updated blueprints to add piper + xarm blueprint * orchestrator client that can send tasks to the control orchestrator module * added a readme * added pytest and e2e test * Update dimos/control/hardware_interface.py explicit false added to the Torque Mode command sent, to avoid silent failing scenario * CI code cleanup * Fixed issues flagged by greptile Mode conflict detection in routing: Added check in _route_to_hardware Preemption tracking: Changed structure to {preempted_task: {joint: winning_task}} Mode conflict preemption: Tasks dropped due to mode conflict at same priority Trajectory completion edge case: Returns final position instead of None on completion Dead code removal: and Piper backend cleanup * Renamed deprecated old manipuialtion test file and Mypy type fixes * fix mypy test * mypy test fix added explicit type * Remove deprecated manipulators_old folder * fixed redef error in dual trajectory setter * Fixed bugs identified by greptile overview: 1. tick_loop.py - Race condition in _route_to_hardware 2. orchestrator.py - Added hardware_added tracking list and rollback in outer except block 3. hardware_interface.py - Added disconnect() to both HardwareInterface protocol and BackendHardwareInterface 4. Added disconnect() to both HardwareInterface protocol and BackendHardwareInterface 5. orchestrator.py - Start order fix Moved super().start() to end, after tick loop starts successfully 6. trajectory_task.py - Added Empty joint_names validation * addressed greptile suggestion: hardware_interface.py - Torque mode logging fix orchestrator.py - Fail hardware removal if joints in use tick_loop.py - Rate control drift fix * undo change to pyproject.toml * Replaced _running bool with threading.Event (_stop_event) for thread safety Removed duplicate _auto_start() call from __init__ - connection now only happens in start() orchestrator_client.py IPython conversion * added type ignore for ipythin * removed check for has attribute in hardware interface Moved super.start() at the beginning replaced running bool with stop_event in tick_loop to improve thread safety removed default ip from init removed simple dataclasses test * orchestrator.py: Use match statement for backend factory, restructure backend cleanup task.py: Use match statement in get_values() tick_loop.py: Add JointWinner NamedTuple for cleaner arbitration logic xarm/backend.py: Extract unit conversions into static helper methods * tick_loop.py: Notify preemption when lower-priority task loses to existing winner hardware_interface.py: Call set_control_mode() before mode-specific writes, Convert if/elif to match statement for control mode dispatch * tick_loop.py: Notify preemption when lower-priority task loses to existing winner hardware_interface.py: Call set_control_mode() before mode-specific writes, convert if/elif to match statement trajectory_task.py: Defer start time to first compute() for consistent timing orchestrator.py: Extract _setup_hardware() helper for cleaner config setup piper and xarm/backend.py: Fail fast on read_joint_positions(), map SERVO_POSITION to mode 1 hardware_interface.py: Retry initialization with proper error propagation, spec.py: Add SERVO_POSITION control mode for confusion between position planning and position servo task.py: added SERVO_POSITION to JointCommandOutput helper * cleaned up legacy blueprints for manipulator drivers * enforce ManipulatorBackend Protocol on the backend.py * feat: add runtime protocol checks for manipulator backends * added runtime checking for controlTask protocol * Add TaskStatus dataclass, refactor get_trajectory_status and Explicitly inherit from ControlTask protocol --------- Co-authored-by: stash <pomichterstash@gmail.com>
* raw rospubsub and benchmarks * typefixes, shm added to the benchmark * SHM is not so important to tell us every time when it starts * greptile comments * Add co-authorship line to commit message filter patterns * Remove unused contextmanager import --------- Co-authored-by: Ivan Nikolic <lesh@sysphere.org>
Replace base64 string encoding with native IDL bytearray type to eliminate buffer overflow issues. The original base64 encoding exceeded CycloneDDS's default string size limit (~256 bytes) and caused crashes on messages >= 1KB. Key changes: - Use make_idl_struct with bytearray field instead of string - Convert bytes to bytearray when publishing to DDS - Convert bytearray back to bytes when receiving from DDS - Add _DDSMessageListener for async message dispatch - Implement thread-safe DataWriter/DataReader management - Add pickle support via __getstate__/__setstate__ Result: All 12 DDS benchmark tests pass (64B to 10MB messages).
Contributor
Greptile OverviewGreptile SummaryThis PR adds comprehensive MJLab G1 humanoid robot simulation support with new transport protocols and performance benchmarking. Major additions:
Critical issue found:
Documentation simplified with reorganized README and new development guides. Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Blueprint as G1 Blueprint
participant MujocoSim as MuJoCo Simulation
participant Policy as ONNX Policy Controller
participant Transport as DDS/ROS Transport
participant Sensors as Sensors/Camera
User->>Blueprint: Initialize G1 (basic_sim)
Blueprint->>Blueprint: Check ROS availability
alt ROS Available
Blueprint->>Transport: Setup ROS Nav
else ROS Not Available
Blueprint->>Blueprint: Use simulation-friendly stack
end
Blueprint->>MujocoSim: load_model(profile="unitree_g1_mjlab")
MujocoSim->>MujocoSim: Load bundle.json config
MujocoSim->>MujocoSim: Resolve assets (meshdir/texturedir)
MujocoSim->>Policy: Initialize MjlabVelocityOnnxController
Policy->>Policy: Parse ONNX metadata (joint_names, scales)
Policy->>Policy: Build joint/actuator mappings
loop Simulation Step
MujocoSim->>MujocoSim: mj_step (physics)
MujocoSim->>Policy: get_control()
Policy->>Policy: get_obs() - read sensors
Policy->>Policy: Run ONNX inference
Policy->>Policy: Remap actions to MuJoCo actuators
Policy->>MujocoSim: Set data.ctrl
MujocoSim->>Sensors: Render RGB/Depth cameras
MujocoSim->>Sensors: Generate point cloud
Sensors->>Transport: Publish via SharedMemory
end
Transport->>User: Stream sensor data (DDS/LCM)
Transport->>User: Publish odometry
|
Comment on lines
+135
to
+144
| def subscribe(self, topic: Topic, callback: Callable[[Any, Topic], None]) -> Callable[[], None]: | ||
| """Subscribe to a DDS topic with a callback.""" | ||
|
|
||
| # Create a DataReader for this topic if needed | ||
| self._get_reader(topic) | ||
|
|
||
| # Add callback to our list | ||
| if topic not in self._callbacks: | ||
| self._callbacks[topic] = [] | ||
| self._callbacks[topic].append(callback) |
Contributor
There was a problem hiding this comment.
DataReader is created but never polled for incoming messages. Callbacks will never fire because there's no mechanism to read from the DataReader and invoke the registered callbacks. Need to either use a DDS Listener or add a background thread that polls reader.read() or reader.take().
|
|
||
| while m_viewer.is_running() and not shm.should_stop(): | ||
| step_start = time.time() | ||
| time.perf_counter() |
Contributor
There was a problem hiding this comment.
Result of time.perf_counter() is unused and has no effect.
Suggested change
| time.perf_counter() | |
| # Step simulation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.