MCPcopy Create free account

hub / github.com/mujocolab/mjlab / functions

Functions2,812 in github.com/mujocolab/mjlab

↓ 8 callersMethodget_term
Return the recorder term registered under ``name``. Use this to reach a recorder's public methods (e.g. to start/stop logging) from outside t
src/mjlab/managers/recorder_manager.py:174
↓ 8 callersFunctioninitialize_entity
(entity, device, num_envs=1)
tests/test_learned_actuator.py:115
↓ 8 callersFunctionlist_tasks
List all registered task IDs.
src/mjlab/tasks/registry.py:43
↓ 8 callersMethodrecompute_constants
Recompute derived model constants after domain randomization. Args: level: Which constants to recompute. ``set_const`` is the most
src/mjlab/sim/sim.py:445
↓ 8 callersMethodstep
Run one environment step: apply actions, simulate, compute RL signals. When ``auto_reset=True`` (default), environments that terminate or time ou
src/mjlab/envs/manager_based_rl_env.py:378
↓ 8 callersMethodwrite_external_wrench_to_sim
Apply external wrenches to bodies in the simulation. Underneath the hood, this sets the `xfrc_applied` field in the MuJoCo data structure. Th
src/mjlab/entity/entity.py:1123
↓ 7 callersMethod__init__
(self, cfg: BaseActionCfg, env: ManagerBasedRlEnv)
src/mjlab/envs/mdp/actions/actions.py:49
↓ 7 callersFunction_foot_sensor_cfg
Match the shipped config: yaw alignment, max_distance=1.0, group 0.
tests/test_foot_height_sensor.py:49
↓ 7 callersFunction_iter_body_paths
Return ``[(path, body), ...]`` for the recursive body tree. Path is the body's path relative to the variant root (e.g. ``/prop``, ``/prop/lid``),
src/mjlab/entity/variants.py:278
↓ 7 callersFunction_make_cfg
(auto_reset: bool)
tests/test_auto_reset.py:16
↓ 7 callersFunction_make_env_and_reward
Build mocked env + upright reward instance. Args: terrain_sensor_names: If set, enables terrain-aware mode. body_quat_w: [B, 4] root orient
tests/test_velocity_rewards.py:36
↓ 7 callersFunction_make_env_cfg
( obs_func: Callable | None = None, num_envs: int = 2, events: dict | None = None, )
tests/test_encoder_bias.py:61
↓ 7 callersFunction_make_site_model
Create a model with all 5 site types.
tests/test_viser_conversions.py:397
↓ 7 callersMethod_resolve_common_term_cfg
(self, term_name: str, term_cfg: ManagerTermBaseCfg)
src/mjlab/managers/manager_base.py:141
↓ 7 callersFunction_select_default_values
Return default model values indexed as ``(env, entity, ...)``. Standard model defaults are stored as ``(nentity, ...)`` and are shared by every e
src/mjlab/envs/mdp/dr/_core.py:380
↓ 7 callersMethodadd_frame
( self, position: np.ndarray | torch.Tensor, rotation_matrix: np.ndarray | torch.Tensor, scale
src/mjlab/viewer/viser/scene.py:891
↓ 7 callersMethodcompute
(self, dt: float)
src/mjlab/managers/reward_manager.py:116
↓ 7 callersMethodcompute_substep
Accumulate per-substep metric values inside the decimation loop. No-op when no ``per_substep`` terms are configured.
src/mjlab/managers/metrics_manager.py:135
↓ 7 callersFunctioncreate_entity
(actuator_cfgs, robot_xml=ROBOT_XML, **kwargs)
tests/test_actuator_builtin_group.py:47
↓ 7 callersMethodfind_bodies
( self, name_keys: str | Sequence[str], preserve_order: bool = False )
src/mjlab/entity/entity.py:510
↓ 7 callersMethodfind_joints
( self, name_keys: str | Sequence[str], joint_subset: Sequence[str] | None = None, preserve_or
src/mjlab/entity/entity.py:515
↓ 7 callersFunctionfit_terrain_normal
Fit a plane normal from 3D points via covariance eigendecomposition. Args: points: [B, N, 3] world-frame positions. valid_mask: [B, N] bool
src/mjlab/tasks/velocity/mdp/terrain_utils.py:15
↓ 7 callersMethodget_env_indices
Get the environment indices to visualize. This helper method handles the show_all_envs logic so implementations don't need to repeat this boi
src/mjlab/viewer/debug_visualizer.py:28
↓ 7 callersFunctionmake_env
Create mock environment.
tests/test_actions.py:96
↓ 7 callersMethodrecord_post_step
Forward to each term's :meth:`RecorderTerm.record_post_step`.
src/mjlab/managers/recorder_manager.py:202
↓ 7 callersMethodreset
(self, env_ids: torch.Tensor | slice | None = None)
src/mjlab/managers/observation_manager.py:239
↓ 7 callersFunctionresolve_env_ids
Return ``env_ids`` unchanged, or all environment indices if ``None``. Event functions receive ``env_ids=None`` to mean "all environments" (a full
src/mjlab/envs/mdp/events.py:44
↓ 7 callersFunctionresolve_expr
Resolve a field value (scalar or dict) to a tuple of values matched by patterns.
src/mjlab/utils/string.py:5
↓ 7 callersFunctionresolve_matching_names_values
Match a list of regular expressions in a dictionary against a list of strings and return the matched indices, names, and values. If the :attr
src/mjlab/utils/lab_api/string.py:274
↓ 7 callersFunctionstep
()
tests/test_events.py:613
↓ 7 callersMethodsync
Create or update the batched mesh handle.
src/mjlab/viewer/viser/scene.py:101
↓ 6 callersFunction_get_body_indexes
( command: MotionCommand, body_names: tuple[str, ...] | None )
src/mjlab/tasks/tracking/mdp/rewards.py:16
↓ 6 callersFunction_get_counts
(entity: TerrainEntity, num_cols: int)
tests/test_terrain_proportion_spawning.py:34
↓ 6 callersMethod_handle_custom_action
(self, action: ViewerAction, payload: Optional[Any])
src/mjlab/viewer/base.py:208
↓ 6 callersFunction_make_actor
(obs_dim=8, output_dim=4, obs_normalization=True)
tests/test_runner.py:172
↓ 6 callersFunction_make_effort_env
Create a mock env with Builtin, Xml, and Ideal actuators for effort tests.
tests/test_events.py:223
↓ 6 callersFunction_make_inertia_env
Create an env with all inertia-related fields expanded.
tests/test_domain_randomization.py:614
↓ 6 callersMethod_should_submit_scene_update
Scene submits at 30Hz (every other 60Hz tick) with pause-aware gating.
src/mjlab/viewer/viser/viewer.py:487
↓ 6 callersFunction_simple_sphere_spec
Single-geom sphere for simple tests.
tests/test_variants.py:85
↓ 6 callersFunction_slot_is_padding
True if any variant leaves the slot at ``slot_index`` unfilled.
tests/test_variants.py:683
↓ 6 callersFunction_step_until_done_env
Step with zero actions until at least one env is done. Return step outputs.
tests/test_auto_reset.py:24
↓ 6 callersMethod_sync_model_fields
Sync visually relevant per-world model fields into the host MjModel.
src/mjlab/viewer/viser/scene.py:388
↓ 6 callersMethodadd_frame
(self, *_args, **kwargs)
tests/test_variants.py:1306
↓ 6 callersFunctionaxis_angle_from_quat
Convert rotations given as quaternions to axis/angle. Args: quat: The quaternion orientation in (w, x, y, z). Shape is (..., 4).
src/mjlab/utils/lab_api/math.py:478
↓ 6 callersMethodclose
(self)
src/mjlab/rl/vecenv_wrapper.py:91
↓ 6 callersFunctioncompute_velocity_from_cvel
Convert cvel quantities to world-frame velocities.
src/mjlab/entity/data.py:20
↓ 6 callersFunctionconfigure_torch_backends
Configure PyTorch CUDA and cuDNN backends for performance/reproducibility. Args: allow_tf32: If True, use TF32 precision for faster computation
src/mjlab/utils/torch.py:5
↓ 6 callersMethodedit_spec
(self, spec: mujoco.MjSpec)
src/mjlab/utils/spec_config.py:263
↓ 6 callersFunctionfind_flat_patches_from_heightfield
Find flat patches on a heightfield surface using morphological filtering. Slides a circular footprint over every pixel and keeps those where the
src/mjlab/terrains/utils.py:20
↓ 6 callersMethodget_active_iterable_terms
( self, env_idx: int )
src/mjlab/managers/manager_base.py:132
↓ 6 callersFunctioninitialize_entity
(entity, device, num_envs=1)
tests/test_actuator_builtin_group.py:56
↓ 6 callersFunctionmake_entity
(actuator_cfgs, num_envs, device)
tests/test_builtin_group.py:23
↓ 6 callersMethodprocess_action
Store the raw policy output and route slices to each action term. Called once per policy step. The raw action tensor is saved into the histor
src/mjlab/managers/action_manager.py:152
↓ 6 callersFunctionquat_inv
Computes the inverse of a quaternion. Args: q: The quaternion orientation in (w, x, y, z). Shape is (N, 4). eps: A small value to
src/mjlab/utils/lab_api/math.py:263
↓ 6 callersMethodreset
(self, env_ids: torch.Tensor | slice | None = None)
src/mjlab/scene/scene.py:190
↓ 6 callersMethodrun
Run the viewer (blocks until server is stopped).
src/mjlab/scripts/nan_viz.py:142
↓ 6 callersMethodsingle_ring
Create a single-ring pattern. Args: radius: Ring radius in meters. num_samples: Number of evenly spaced points on the ring. inc
src/mjlab/sensor/raycast_sensor.py:244
↓ 6 callersFunctionstep_and_settle
Run simulation steps to allow physics to stabilize and contacts to form. Useful after placing objects to let them fall under gravity and establish
tests/test_contact_sensor.py:113
↓ 6 callersMethodupdate_from_arrays
Update scene and sync debug visualizations.
src/mjlab/viewer/viser/scene.py:354
↓ 6 callersMethodwrite_data_to_sim
Convert actuator targets into low-level controls and write them to the sim. Called before each ``sim.step()`` within the decimation loop. Builtin
src/mjlab/entity/entity.py:844
↓ 5 callersFunction_color_uint8
(rgba: tuple[float, float, float, float])
src/mjlab/viewer/viser/scene.py:80
↓ 5 callersFunction_compute_flat_patches
Compute flat patches for a heightfield terrain if configured.
src/mjlab/terrains/heightfield_terrains.py:191
↓ 5 callersMethod_format_speed
(multiplier: float)
src/mjlab/viewer/base.py:465
↓ 5 callersMethod_get_cached_tensor
Get a cached tensor for the given parameter on the specified device.
src/mjlab/utils/noise/noise_cfg.py:27
↓ 5 callersMethod_get_export_paths
Resolve ONNX export paths from a checkpoint path.
src/mjlab/rl/runner.py:61
↓ 5 callersFunction_make_pd_env
Create a mock env with Builtin, Xml, and Ideal actuators for PD tests.
tests/test_events.py:174
↓ 5 callersFunction_make_termination_cfg
( params: dict | None = None, )
tests/test_envs_curriculums.py:33
↓ 5 callersFunction_make_termination_env
(step_counter, term_cfg)
tests/test_envs_curriculums.py:63
↓ 5 callersFunction_sample_se3_range
Sample uniform ``[x, y, z, roll, pitch, yaw]`` offsets. ``range_dict`` maps any subset of those keys to ``(min, max)`` ranges; missing keys defau
src/mjlab/envs/mdp/events.py:27
↓ 5 callersFunction_scene_env
Build a real scene/sim with one BuiltinPd-driven entity for DR tests.
tests/test_builtin_pd_actuator.py:239
↓ 5 callersMethodadd_batched_meshes_simple
(self, *args, **kwargs)
tests/test_variants.py:1320
↓ 5 callersMethodapply_actions
(self)
src/mjlab/managers/action_manager.py:62
↓ 5 callersMethodclear
Clear debug visualizations by resetting geom count.
src/mjlab/viewer/native/visualizer.py:267
↓ 5 callersFunctioncolor_by_height
Build a height-colored texture for a heightfield. Diverging colormap anchored at the ground plane (z=0): cool blue below ground, green at z=0, wa
src/mjlab/terrains/heightfield_terrains.py:39
↓ 5 callersMethodcompute_dq
Run one DLS IK step and return joint displacement. Returns: Joint displacement tensor of shape ``(num_envs, num_joints)``.
src/mjlab/envs/mdp/actions/differential_ik.py:196
↓ 5 callersFunctioncreate_entity_with_delayed_builtin
(delay_min_lag=0, delay_max_lag=3)
tests/test_delayed_actuator.py:23
↓ 5 callersFunctioncreate_floating_base_entity
Create a floating-base entity.
tests/test_entity_data.py:53
↓ 5 callersMethodedit_spec
Edit the scene spec to add this sensor. This is called during scene construction to add sensor elements to the MjSpec. Args: scene
src/mjlab/sensor/sensor.py:58
↓ 5 callersFunctionfunc
(_env, **_kwargs)
tests/test_observation_manager.py:26
↓ 5 callersMethodfunction
Generate terrain geometry. Returns: TerrainOutput containing spawn origin and list of geometries.
src/mjlab/terrains/terrain_generator.py:76
↓ 5 callersFunctioninitialize_entity_with_sim
Initialize an entity with a simulation.
tests/test_entity.py:164
↓ 5 callersFunctionlist_to_csv_str
Convert list to CSV string with specified decimal precision.
src/mjlab/rl/exporter_utils.py:11
↓ 5 callersFunctionmake_entity
Create and initialize entity.
tests/test_actions.py:69
↓ 5 callersFunctionmake_gen
Create a seeded generator for reproducible tests.
tests/test_delay_buffer.py:16
↓ 5 callersMethodpause
(self)
src/mjlab/viewer/base.py:263
↓ 5 callersFunctionpyramid_stairs
(**overrides: Any)
src/mjlab/terrains/config.py:46
↓ 5 callersFunctionquat_conjugate
Computes the conjugate of a quaternion. Args: q: The quaternion orientation in (w, x, y, z). Shape is (..., 4). Returns: The
src/mjlab/utils/lab_api/math.py:248
↓ 5 callersFunctionquat_error_magnitude
Computes the rotation difference between two quaternions. Args: q1: The first quaternion in (w, x, y, z). Shape is (..., 4). q2:
src/mjlab/utils/lab_api/math.py:688
↓ 5 callersMethodrequest_action
(self, name: str, payload: Optional[Any] = None)
src/mjlab/viewer/base.py:238
↓ 5 callersFunctionresolve_distribution
Resolve a string or Distribution instance to a Distribution. Raises: ValueError: If the string does not match a built-in distribution name.
src/mjlab/envs/mdp/dr/_types.py:150
↓ 5 callersMethodset_lags
Set delay lag values for specified environments. Built-in actuators with the same delay config share a fused delay buffer for performance. Ca
src/mjlab/actuator/actuator.py:296
↓ 5 callersFunctionsync_model_fields
Copy per-world model fields from sim_model[env_idx] into dst_model.
src/mjlab/viewer/model_sync.py:80
↓ 5 callersFunctionunitree_g1_flat_tracking_env_cfg
Create Unitree G1 flat terrain tracking configuration.
src/mjlab/tasks/tracking/config/g1/env_cfgs.py:15
↓ 5 callersFunctionunitree_go1_rough_env_cfg
Create Unitree Go1 rough terrain velocity configuration.
src/mjlab/tasks/velocity/config/go1/env_cfgs.py:32
↓ 4 callersMethod__init__
( self, cfg: BuiltinPdActuatorCfg, entity: Entity, target_ids: list[int], target_names: li
src/mjlab/actuator/builtin_actuator.py:138
↓ 4 callersMethod__post_init__
(self)
src/mjlab/actuator/builtin_actuator.py:121
↓ 4 callersMethod__setattr__
Prevent attribute setting to maintain CUDA graph safety.
src/mjlab/sim/sim_data.py:223
↓ 4 callersFunction_at_rest_with_targets
( entity: Entity, sim, device: str, pos_target: torch.Tensor, vel_target: torch.Tensor, )
tests/test_builtin_pd_actuator.py:60
↓ 4 callersFunction_build
(xml: str, device: str, num_envs: int = 2)
tests/test_projected_gravity_sensor.py:97
↓ 4 callersFunction_build_termination
(env, termination_name, stages)
tests/test_envs_curriculums.py:49
← previousnext →101–200 of 2,812, ranked by callers