MCPcopy Create free account

hub / github.com/mujocolab/mjlab / functions

Functions2,812 in github.com/mujocolab/mjlab

↓ 4 callersFunction_classify_geom_role
Derive a geom's slot role from its contact bits. Visual: ``contype == 0`` and ``conaffinity == 0``. Collision: anything else. Shared by validatio
src/mjlab/entity/variants.py:294
↓ 4 callersFunction_compare_collection_topology
Compare a flat spec-level collection (actuators, sensors, ...). Length must match; per-element ``key_fn(item)`` tuples must match. Per-collection
src/mjlab/entity/variants.py:577
↓ 4 callersMethod_find
( self, query_names: tuple[str, ...], pool: tuple[str, ...], preserve_order: bool, )
tests/test_scene_entity_config.py:36
↓ 4 callersFunction_get_entity_indices
( indexing: EntityIndexing, asset_cfg: SceneEntityCfg, entity_type: str, use_address: bool, )
src/mjlab/envs/mdp/dr/_core.py:199
↓ 4 callersFunction_make_geom_size_env
(device, num_envs=NUM_ENVS)
tests/test_domain_randomization.py:1145
↓ 4 callersFunction_make_impulse_env
Create a mock env for apply_body_impulse tests.
tests/test_events.py:564
↓ 4 callersFunction_randomize_quat_field
Core implementation for quaternion randomization via RPY composition. Composes a sampled RPY perturbation with the default quaternion to produce
src/mjlab/envs/mdp/dr/_core.py:330
↓ 4 callersFunction_robot_xml
Free-floating box with an IMU site and the framezaxis up-vector sensor.
tests/test_projected_gravity_sensor.py:78
↓ 4 callersFunction_sample_angle
( distribution: Distribution | str, range_: tuple[float, float], shape: tuple[int, ...], device: str,
src/mjlab/envs/mdp/dr/_core.py:318
↓ 4 callersMethod_sample_cooldown
(self, n: int)
src/mjlab/envs/mdp/events.py:463
↓ 4 callersMethod_should_update_cameras
Camera feeds update continuously while running and on-demand while paused.
src/mjlab/viewer/viser/viewer.py:482
↓ 4 callersFunction_step_n
(entity, sim, device, n: int, *, pos_target=None, eff_target=None)
tests/test_builtin_dcmotor_actuator.py:334
↓ 4 callersMethodadd_sphere
( self, center: np.ndarray | torch.Tensor, radius: float, color: tuple[float, float, float, fl
src/mjlab/viewer/viser/scene.py:918
↓ 4 callersFunctionapply_target_overrides
Apply joint- or tendon-level overrides. ``None`` preserves the XML value. SITE transmission is a no-op (sites have no armature / frictionloss / dam
src/mjlab/utils/spec.py:123
↓ 4 callersMethodatomic
(self)
tests/test_variants.py:1329
↓ 4 callersFunctionattach_metadata_to_onnx
Attach metadata to an ONNX model file. Args: onnx_path: Path to the ONNX model file. metadata: Dictionary of metadata key-value pairs to at
src/mjlab/rl/exporter_utils.py:65
↓ 4 callersMethodclear_histories
Clear all overlay histories.
src/mjlab/viewer/viser/overlays.py:117
↓ 4 callersMethodcompile
(self, spec: mujoco.MjSpec)
src/mjlab/terrains/terrain_generator.py:192
↓ 4 callersMethodcompute
(self)
src/mjlab/managers/termination_manager.py:102
↓ 4 callersFunctioncompute_mpkpe
Compute Mean Per-Keybody Position Error (MPKPE). MPKPE measures the average Euclidean distance between the reference and actual key body position
src/mjlab/tasks/tracking/mdp/metrics.py:13
↓ 4 callersFunctioncreate_env
(device, fields, num_envs=NUM_ENVS)
tests/test_events.py:67
↓ 4 callersFunctioncreate_position_actuator
Creates a <position> actuator. An important note about this actuator is that we set `ctrllimited` to False. This is because we want to allow the
src/mjlab/utils/spec.py:278
↓ 4 callersMethodcreate_scene_gui
Add standard GUI controls plus debug visualization section.
src/mjlab/viewer/viser/scene.py:799
↓ 4 callersFunctioncreate_velocity_actuator
Creates a <velocity> actuator. Control inputs are not clamped so that velocity commands work for any joint, including continuous joints that have
src/mjlab/utils/spec.py:357
↓ 4 callersFunctiondisable_model_sameframe_shortcuts
Force MuJoCo's host model down the full local-to-global transform path. mujoco_warp does not implement MuJoCo's *_sameframe shortcuts: its kinema
src/mjlab/viewer/model_sync.py:61
↓ 4 callersMethodfind_joints
(self, query_names: tuple[str, ...], preserve_order: bool = False)
tests/test_scene_entity_config.py:49
↓ 4 callersMethodfind_joints_by_actuator_names
( self, actuator_name_keys: str | Sequence[str], )
src/mjlab/entity/entity.py:525
↓ 4 callersFunctionfix_spec_xml
Fix known issues in MjSpec.to_xml() output. 1. Remove empty ``<default/>`` and ``<default class="..."/>`` tags. 2. Collapse duplicate nested defa
src/mjlab/utils/xml.py:75
↓ 4 callersFunctionfn
(nworld: int)
tests/test_variants.py:230
↓ 4 callersFunctionget_base_metadata
Get base metadata common to all RL policy exports. Args: env: The RL environment. run_path: W&B run path or other identifier. Returns:
src/mjlab/rl/exporter_utils.py:22
↓ 4 callersMethodget_status
(self)
src/mjlab/viewer/base.py:474
↓ 4 callersFunctionget_wandb_checkpoint_path
Get checkpoint path from wandb, downloading if needed. Returns: Tuple of (checkpoint_path, was_cached)
src/mjlab/utils/os.py:63
↓ 4 callersFunctionget_yam_robot_cfg
()
src/mjlab/asset_zoo/robots/i2rt_yam/yam_constants.py:205
↓ 4 callersFunctiongradient
(h, x, y)
src/mjlab/terrains/heightfield_terrains.py:144
↓ 4 callersFunctionheight_scan
Height scan from a raycast sensor. Returns the height of the sensor frame above each hit point. Supports multi-frame sensors: each ray uses its o
src/mjlab/envs/mdp/observations.py:126
↓ 4 callersFunctionload_rl_cfg
Load RL configuration for a task. Returns a deep copy to prevent mutation of the registered config.
src/mjlab/tasks/registry.py:58
↓ 4 callersMethodon_env_switch
Clear histories when active environment changes.
src/mjlab/viewer/viser/overlays.py:86
↓ 4 callersFunctionprojected_gravity_from_sensor
Projected gravity from a ``framezaxis`` up-vector sensor. The sensor is expected to output the world Z-axis expressed in the sensor's frame (e.g.
src/mjlab/envs/mdp/observations.py:109
↓ 4 callersMethodrecord_pre_reset
Forward to each term's :meth:`RecorderTerm.record_pre_reset`.
src/mjlab/managers/recorder_manager.py:192
↓ 4 callersFunctionreflected_inertia_from_two_stage_planetary
Compute reflected inertia of a two-stage planetary gearbox.
src/mjlab/utils/actuator.py:25
↓ 4 callersMethodrefresh_visualization
Re-render, keeping needs_update set when debug viz is active.
src/mjlab/viewer/viser/scene.py:789
↓ 4 callersMethodrender
Render the environment.
src/mjlab/utils/wrappers/video_recorder.py:137
↓ 4 callersMethodrequest_single_step
(self)
src/mjlab/viewer/base.py:226
↓ 4 callersMethodreset
Zero out values and counters for specified batch rows. Args: batch_ids: Batch indices to reset, or None to reset all.
src/mjlab/utils/buffers/circular_buffer.py:177
↓ 4 callersMethodreset_environment
(self)
src/mjlab/viewer/base.py:339
↓ 4 callersFunctionresolve_operation
Resolve a string or Operation instance to an Operation. Raises: ValueError: If the string does not match a built-in operation name.
src/mjlab/envs/mdp/dr/_types.py:132
↓ 4 callersMethodset_sensor_context
Wire a SensorContext for camera/raycast sensing. Automatically re-captures CUDA graphs so the sense_graph includes the new sensor kernels.
src/mjlab/sim/sim.py:486
↓ 4 callersFunctionsubtract_frame_transforms
r"""Subtract transformations between two reference frames into a stationary frame. It performs the following transformation operation: :math:`T_{
src/mjlab/utils/lab_api/math.py:832
↓ 4 callersFunctionterrain_edge_reached
Terminate when robot displacement from spawn exceeds sub-terrain size. Intended as ``time_out=True`` (successful traversal, not penalized). Skips t
src/mjlab/tasks/velocity/mdp/terminations.py:71
↓ 4 callersFunctionupdate
()
scripts/tools/terrain_explorer.py:80
↓ 4 callersMethodwrite_ctrl
( self, ctrl: torch.Tensor, ctrl_ids: torch.Tensor | slice | None = None, env_ids: torch.Tenso
src/mjlab/entity/data.py:191
↓ 4 callersMethodwrite_mocap_pose_to_sim
Set the pose of a mocap body into the simulation. Args: mocap_pose: Tensor of shape (N, 7) where N is the number of environments. F
src/mjlab/entity/entity.py:1148
↓ 4 callersFunctionyam_lift_cube_vision_env_cfg
( cam_type: Literal["rgb", "depth"], play: bool = False, )
src/mjlab/tasks/manipulation/config/yam/env_cfgs.py:93
↓ 3 callersMethod_check_and_handle_nans
Check for NaN/Inf and handle according to policy. Args: tensor: Observation tensor to check. context: Context string for error/warnin
src/mjlab/managers/observation_manager.py:261
↓ 3 callersMethod_check_term_shape
(self, term_name: str, value: torch.Tensor)
src/mjlab/managers/manager_base.py:124
↓ 3 callersMethod_clear_histories
Clear histories and reset figures.
src/mjlab/viewer/native/viewer.py:628
↓ 3 callersMethod_compute_jacobian
Compute the frame Jacobian.
src/mjlab/envs/mdp/actions/differential_ik.py:304
↓ 3 callersMethod_configure_env_origins
( self, origins: np.ndarray | torch.Tensor | None = None, proportions: np.ndarray | None = None,
src/mjlab/terrains/terrain_entity.py:192
↓ 3 callersMethod_extract_sensor_data
(self)
src/mjlab/sensor/contact_sensor.py:400
↓ 3 callersMethod_invalidate_cache
Invalidate the cached data, forcing recomputation on next access.
src/mjlab/sensor/sensor.py:125
↓ 3 callersFunction_make_cnn_actor
(obs_normalization=True)
tests/test_runner.py:260
↓ 3 callersFunction_make_env
Build the env stub, typed as the real env for the functions under test.
tests/test_projected_gravity_sensor.py:68
↓ 3 callersFunction_make_mixed_visual_model
Create a model with both textured and color-only geoms on the same body.
tests/test_viser_conversions.py:255
↓ 3 callersFunction_matrix_from_quat
Convert wxyz quaternion(s) to 3x3 rotation matrix. Shape: (..., 4) → (..., 3, 3).
tests/test_domain_randomization.py:628
↓ 3 callersMethod_maybe_upsample
(self, image: np.ndarray)
src/mjlab/viewer/viser/camera_viewer.py:148
↓ 3 callersFunction_model_output
(actor, x_flat)
tests/test_runner.py:194
↓ 3 callersFunction_or_zeros
(t: tuple[float, ...] | None, n: int)
src/mjlab/actuator/builtin_actuator.py:244
↓ 3 callersFunction_quat_from_roll
(roll_rad: float, B: int = 1)
tests/test_velocity_rewards.py:24
↓ 3 callersFunction_reconstruct_J
Reconstruct pseudo-inertia matrix from MuJoCo fields (test helper). Correctly accounts for body_iquat (the principal-frame rotation) and the para
tests/test_domain_randomization.py:650
↓ 3 callersFunction_scene_env
( device, num_envs=2, mode: DcMotorInputMode = DcMotorInputMode.POSITION, )
tests/test_builtin_dcmotor_actuator.py:495
↓ 3 callersMethod_sync_debug_visualizations
(self, scene_offset: np.ndarray)
src/mjlab/viewer/viser/scene.py:1007
↓ 3 callersMethod_sync_model_fields
Sync visually relevant per-world model fields into the host MjModel.
src/mjlab/viewer/offscreen_renderer.py:161
↓ 3 callersMethod_sync_model_fields
Sync visually-relevant DR'd model fields from GPU to MjModel.
src/mjlab/viewer/native/viewer.py:376
↓ 3 callersFunction_train_normalizer
(actor, n_batches=50, batch_size=64)
tests/test_runner.py:186
↓ 3 callersMethod_update_state
Update the visualization to show the current state.
src/mjlab/scripts/nan_viz.py:126
↓ 3 callersMethodapply
( self, mode: EventMode, env_ids: torch.Tensor | slice | None = None, dt: float | None = None,
src/mjlab/managers/event_manager.py:235
↓ 3 callersFunctionbatch_space
(space: Dict, batch_size: int)
src/mjlab/utils/spaces.py:40
↓ 3 callersFunctionbuild
(history_length: int)
scripts/demos/contact_sensor_decimation.py:52
↓ 3 callersMethodbuild
(self, env: ManagerBasedRlEnv)
src/mjlab/envs/mdp/actions/actions.py:247
↓ 3 callersFunctioncartpole_balance_env_cfg
( play: bool = False, )
src/mjlab/tasks/cartpole/cartpole_env_cfg.py:251
↓ 3 callersMethodcleanup
Cleanup plotter resources.
src/mjlab/viewer/viser/overlays.py:121
↓ 3 callersMethodclear_state
Deprecated. Use ``reset`` instead.
src/mjlab/entity/entity.py:835
↓ 3 callersMethodclose
(self)
src/mjlab/viewer/base.py:201
↓ 3 callersFunctioncompute_ee_position_error
Compute end effector position error.
src/mjlab/tasks/tracking/mdp/metrics.py:49
↓ 3 callersFunctioncompute_root_relative_mpkpe
Compute Root-relative Mean Per-Keybody Position Error (R-MPKPE). R-MPKPE measures intrinsic pose error independent of global drift. It uses ``bod
src/mjlab/tasks/tracking/mdp/metrics.py:25
↓ 3 callersFunctioncreate_contact_sensor_scene
Create a scene with a contact sensor.
tests/test_sensor_caching.py:53
↓ 3 callersFunctioncreate_entity_with_delayed_ideal
(delay_min_lag=0, delay_max_lag=3)
tests/test_delayed_actuator.py:42
↓ 3 callersFunctioncreate_floating_articulated_entity
Create a floating-base articulated entity.
tests/test_entity.py:146
↓ 3 callersFunctioncreate_floating_base_entity
Create a floating-base entity.
tests/test_entity.py:122
↓ 3 callersMethodcreate_graph
Capture CUDA graphs for step, forward, and reset operations. This method must be called whenever GPU arrays in the model or data are replaced
src/mjlab/sim/sim.py:320
↓ 3 callersFunctiondump_yaml
Saves data to a YAML file. Args: filename: The path to the YAML file. data: The data to save. Must be a dictionary. sort_keys: Wh
src/mjlab/utils/os.py:8
↓ 3 callersMethodexport_policy_to_onnx
( self, path: str, filename: str = "policy.onnx", verbose: bool = False )
src/mjlab/tasks/tracking/rl/runner.py:61
↓ 3 callersMethodfind_bodies
(self, query_names: tuple[str, ...], preserve_order: bool = False)
tests/test_scene_entity_config.py:52
↓ 3 callersMethodfind_geoms
( self, name_keys: str | Sequence[str], geom_subset: Sequence[str] | None = None, preserve_ord
src/mjlab/entity/entity.py:549
↓ 3 callersMethodfind_sites
( self, name_keys: str | Sequence[str], site_subset: Sequence[str] | None = None, preserve_ord
src/mjlab/entity/entity.py:559
↓ 3 callersMethodfrom_mujoco_camera
Create config that references a MuJoCo camera. Camera parameters (resolution, FOV) are resolved at runtime from the model. Args: camer
src/mjlab/sensor/raycast_sensor.py:123
↓ 3 callersMethodfunction
( self, difficulty: float, spec: mujoco.MjSpec, rng: np.random.Generator )
src/mjlab/terrains/heightfield_terrains.py:868
↓ 3 callersFunctionget_g1_robot_cfg
Get a fresh G1 robot configuration instance. Returns a new EntityCfg instance each time to avoid mutation issues when the config is shared across
src/mjlab/asset_zoo/robots/unitree_g1/g1_constants.py:264
↓ 3 callersMethodis_enabled
Whether any contact visualization is currently enabled.
src/mjlab/viewer/viser/overlays.py:208
↓ 3 callersMethodis_running
(self)
src/mjlab/viewer/native/viewer.py:204
← previousnext →201–300 of 2,812, ranked by callers