MCPcopy Create free account

hub / github.com/pollen-robotics/microduck_rl / functions

Functions681 in github.com/pollen-robotics/microduck_rl

Functionmouth_perpendicular_phased
mouth_perpendicular_to_ground gaté par la down-gate segmentée.
src/mjlab_microduck/tasks/mdp.py:3005
Functionmouth_perpendicular_to_ground
Reward the mouth tip x-axis being vertical (pointing down) during the approach phase. A perfectly perpendicular contact gives alignment=1; horizo
src/mjlab_microduck/tasks/mdp.py:1866
Functionmultistage_height_l1_penalty
L1 companion to multistage_height_target.
src/mjlab_microduck/tasks/mdp.py:2382
Functionmultistage_height_target
Multi-waypoint Gaussian on trunk z.
src/mjlab_microduck/tasks/mdp.py:2367
Functionmultistage_pose_l1_penalty
L1 companion to multistage_pose_target_match.
src/mjlab_microduck/tasks/mdp.py:2351
Functionmultistage_pose_target_match
Multi-waypoint variant of interpolated_pose_target_match. waypoints: [{"frac": 0.0, "overrides": None}, {"frac": 0.4, "overrides"
src/mjlab_microduck/tasks/mdp.py:2325
Functionneck_action_acceleration_l2
Penalize neck action accelerations (action_t - 2*action_{t-1} + action_{t-2}). Neck joints are indices 5-8 (4 joints total). Args:
src/mjlab_microduck/tasks/mdp.py:468
Functionneck_action_rate_l2
Penalize the rate of change of neck actions (action_t - action_{t-1}). Neck joints are indices 5-8 (4 joints total). Args: env:
src/mjlab_microduck/tasks/mdp.py:392
Functionneck_joint_pos_l2
Penalize neck/head joint position deviation from default (L2 squared). Uses find_joints() every call to avoid stale cached indices when the same
src/mjlab_microduck/tasks/mdp.py:1555
Functionneck_joint_vel_l2
Penalize neck joint velocities to keep head stable. Neck joints are indices 5-8 (4 joints total). Args: env: The environment
src/mjlab_microduck/tasks/mdp.py:1407
Functionneck_vel_descent_penalty
Pénalise la vitesse des joints du cou pendant la DESCENTE+palier (freine le piqué de la tête). Coût = mean(joint_vel²) sur les joints donnés,
src/mjlab_microduck/tasks/mdp.py:3061
Functionno_stepping_penalty
Penalize feet in the air when the commanded speed is below threshold. Discourages marching in place when the robot should stand still. Returns th
src/mjlab_microduck/tasks/mdp.py:5546
Functionphase_height_track
Reward trunk_z tracking a sin-interpolated target between stand and sit heights. Used for the sitstand task instead of joint-angle matching for t
src/mjlab_microduck/tasks/mdp.py:2029
Functionphase_pose_match
Reward matching a target pose, weighted by phase-cycle command. Generic helper for phase-conditioned tasks (e.g. sit/stand). The command enco
src/mjlab_microduck/tasks/mdp.py:2863
Functionpose_command_range_curriculum
Ramp a UniformPoseCommand's per-dim ranges over training. range_stages: list of {step: int, ranges: tuple[(lo, hi), ...]}. The first stage ap
src/mjlab_microduck/tasks/mdp.py:5512
Functionpose_l1_penalty
L1 companion to ``pose_target_match`` (constant gradient toward target).
src/mjlab_microduck/tasks/mdp.py:2421
Functionpose_target_match
Always-on Gaussian on joint positions vs a target pose. Non-phase analog of ``phase_pose_match``: useful for episodic tasks (e.g. the sit env
src/mjlab_microduck/tasks/mdp.py:2059
Functionposture_composite
Multiplicative goal score vs the commanded posture (height·upright·pose [·head]). The posture-conditioned version of ``standing_composite_sco
src/mjlab_microduck/tasks/mdp.py:6447
Functionposture_height_gaussian
Gaussian on trunk z against the commanded posture's target height.
src/mjlab_microduck/tasks/mdp.py:6415
Functionposture_height_l1
L1 companion to ``posture_height_gaussian`` — the transition driver. While the robot rests in the *wrong* posture this charges a constant per
src/mjlab_microduck/tasks/mdp.py:6429
Functionposture_pose_l1
L1 companion to ``posture_pose_match`` (constant gradient to target).
src/mjlab_microduck/tasks/mdp.py:6400
Functionposture_pose_match
Gaussian pose-match against the commanded posture's target pose.
src/mjlab_microduck/tasks/mdp.py:6384
Functionposture_rise_bootstrap
Upward-vz reward, active only when STAND is commanded and z < max_height. The standup-env lesson: destination-only rewards have zero gradient at
src/mjlab_microduck/tasks/mdp.py:6551
Functionposture_stillness
Reward trunk stillness while AT the commanded posture, upright. Generalizes ``seated_stillness`` to both rest states: exp(-(|v|/std)²) gated
src/mjlab_microduck/tasks/mdp.py:6507
Functionprojected_gravity
Projected gravity vector in body frame. Returns the gravity vector projected into the robot's body frame, representing pure orientation witho
src/mjlab_microduck/tasks/mdp.py:3601
Functionprojected_gravity_imu_misaligned
projected_gravity with a per-env constant IMU mounting misalignment.
src/mjlab_microduck/tasks/mdp.py:3641
Functionpush_curriculum
Update push velocity range based on training progress. Starts with no/small pushes to learn clean walking, then gradually increases to build
src/mjlab_microduck/tasks/mdp.py:3378
Functionrandomize_bam_friction
Per-episode joint-friction randomization for the BAM actuator (NON-accumulating). Under BAM, MuJoCo's dof_frictionloss is zeroed (BAM computes fr
src/mjlab_microduck/tasks/mdp.py:3212
Functionrandomize_base_orientation
Randomize base orientation at episode start to force reactive behavior. Adds random pitch and roll to the robot's base orientation at the start o
src/mjlab_microduck/tasks/mdp.py:4019
Functionrandomize_com
Randomize body CoM (body_ipos) per episode WITHOUT accumulating. Drop-in replacement for the buggy mdp.randomize_field(add, body_ipos, reset).
src/mjlab_microduck/tasks/mdp.py:5602
Functionrandomize_delayed_actuator_gains
Randomize firmware PD gains per episode (NON-accumulating). Under the canonical BAM actuator (``bam.mjlab.BamActuator``) gains are scaled per
src/mjlab_microduck/tasks/mdp.py:3146
Functionrandomize_dof_field_scaled
Scale a per-dof model field (e.g. dof_frictionloss/dof_damping) per episode WITHOUT accumulating: restore nominal, then apply a fresh scale.
src/mjlab_microduck/tasks/mdp.py:5650
Functionrandomize_imu_orientation
Randomize IMU sensor mounting orientation by small angles. Simulates slight mounting errors or calibration offsets in the real robot. The
src/mjlab_microduck/tasks/mdp.py:3706
Functionrandomize_mass_and_inertia
Randomize body mass and inertia together with the same scaling factor. This maintains physical consistency - mass and inertia must scale together
src/mjlab_microduck/tasks/mdp.py:3243
Functionraw_accelerometer
Raw accelerometer reading (includes gravity + linear acceleration). Returns normalized raw accelerometer which mimics what a real IMU measures.
src/mjlab_microduck/tasks/mdp.py:3663
Functionrecovery_stepping_reward
Reward foot air time only when at zero command AND robot has high velocity (recovering from push). This encourages the robot to take steps to rec
src/mjlab_microduck/tasks/mdp.py:3931
Functionrecovery_success
One-shot bounty on a COMPLETED recovery: fires on the frame where an env that has been fallen (tilt > fallen_tilt for ≥ min_fallen_s) becomes
src/mjlab_microduck/tasks/mdp.py:646
Functionrender_readme
A model card that says how to run the policy on a robot, generated so it cannot go stale.
src/mjlab_microduck/publish/manifest.py:327
Methodreset
(self, env_ids: torch.Tensor | None)
src/mjlab_microduck/tasks/mdp.py:5002
Functionreset_action_history
Reset cached action history for environments that are being reset. This is critical for action rate and acceleration penalty terms. This
src/mjlab_microduck/tasks/mdp.py:229
Functionreset_ball_in_front_of_foot
Place the ball in front of the (right) foot; store the kick direction. ``offset`` is the nominal ball-center position in the robot's yaw frame:
src/mjlab_microduck/tasks/mdp.py:5710
Functionreset_rolling_entry
Départ en ROULEMENT sans glissement (élan aux roues). Tire une vitesse d'avance v par env ; met la vitesse LINÉAIRE de base (x monde) = v ET
src/mjlab_microduck/tasks/mdp.py:1055
Functionreset_roulade_state
Reset to a standing start or a mid-roll state (reverse curriculum). Standing bucket: upright (±standing_tilt_max pitch/roll noise), random yaw,
src/mjlab_microduck/tasks/mdp.py:6785
Functionreset_with_forward_velocity
Warm-start a fraction of reset environments with a random forward velocity. The robot spawns already moving in its body-forward direction, so it
src/mjlab_microduck/tasks/mdp.py:158
Functionreward_weight
Step-staged reward weight curriculum. mjlab 1.3.0 dropped the built-in ``mdp.reward_weight`` helper, so microduck provides its own. ``weight_
src/mjlab_microduck/tasks/mdp.py:3442
Functionrollout_sim_bam
Sim rollout using bam's MujocoController on a vanilla MuJoCo step loop. Pros: 200 Hz inner-step logging, no torch/mjwarp. Cons: not the exact
scripts/testbench_sim2real.py:104
Functionrollout_sim_mjlab
Sim rollout via the actual mjlab testbench env (same BAM M6 the policy was trained against). Boots make_testbench_env_cfg() with num_envs=1, over
scripts/testbench_sim2real.py:213
Functionroot_height_below
Terminate when the trunk drops below ``min_height`` in world z. Utilisé par roller_slope comme « tombé dans le vide » : le terrain a un plat
src/mjlab_microduck/tasks/mdp.py:1017
Functionroulade_flatness_penalty
(lateral-axis world-z)² — dense gradient toward a sagittal roll. Positive quantity; use a negative weight. Zero when standing, zero through a
src/mjlab_microduck/tasks/mdp.py:7155
Functionroulade_head_pivot
Reward head-ground contact while rotating forward mid-roll. contact × window(accum ∈ [angle_lo, angle_hi]) × clamp(ω_fwd/rate_norm, 0, 1) × (
src/mjlab_microduck/tasks/mdp.py:6947
Functionroulade_height_after_roll
Broad height Gaussian × completion gate — pull up to standing height.
src/mjlab_microduck/tasks/mdp.py:7036
Functionroulade_landing_composite
standing_composite_score × completion gate. The big annuity: once the roll is (nearly) complete, every step spent standing at HOME pose pays
src/mjlab_microduck/tasks/mdp.py:6981
Functionroulade_landing_sharp
Tight-std upright × height Gaussians × completion gate — the last mile. Run-4 fix for the 27°-lean / 1-cm-crouch end basin: the broad landing
src/mjlab_microduck/tasks/mdp.py:7054
Functionroulade_lateral_velocity_penalty
Body-frame lateral (y) linear velocity² — keeps the roll straight.
src/mjlab_microduck/tasks/mdp.py:7182
Functionroulade_overspeed_penalty
max(0, |ω_y| − omega_max)² — quadratic tax on whip-speed rotation. Positive quantity; use a negative weight. Complements the paid-rate cap in
src/mjlab_microduck/tasks/mdp.py:7136
Functionroulade_progress
Pay increments of the progress frontier, up to one full roll. reward = Δ(min(max_accum, target)) / (step_dt · target), CAPPED at max_paid_rat
src/mjlab_microduck/tasks/mdp.py:6918
Functionroulade_rise_velocity
com_upward_velocity × late-roll gate — bootstrap the exit rise. The second half of a roulade (supine → sitting-up → standing) is the face-up
src/mjlab_microduck/tasks/mdp.py:7111
Functionroulade_sagittal_penalty
Rotation out of the sagittal plane: body-frame ω_x² + ω_z² (positive; use a negative weight). ω_y is the roll axis and stays free.
src/mjlab_microduck/tasks/mdp.py:7171
Functionroulade_stand_tax
SELF-NEGATING height L1 below target, active only after roll completion. Returns −max(0, target − z) × completion_gate — use a POSITIVE weight
src/mjlab_microduck/tasks/mdp.py:7084
Functionroulade_upright_after_roll
Linear cos(tilt) × completion gate — bootstrap pull toward vertical. Gradient from ANY orientation (the composite is near-zero far from the g
src/mjlab_microduck/tasks/mdp.py:7015
Functionsample_mouth_payload
Event de reset : tire une masse d'objet 'tenu dans la bouche' par env (kg), stockée sur env._mouth_payload_kg. Utilisée par apply_mouth_payload_fo
src/mjlab_microduck/tasks/mdp.py:3085
Methodscene
(self)
tests/test_wheel_glide.py:42
Functionseated_stillness
Reward trunk stillness while seated UPRIGHT: |v| Gaussian, z- and tilt-gated. exp(-(|v|/vel_std)²) · smoothstep(z) · smoothstep(tilt). The z gate
src/mjlab_microduck/tasks/mdp.py:2514
Functionset_face_down_orientation
Set the robot to a prone (belly-down) orientation for stand-up training. Rotates the robot 90° forward around the pitch axis (Y) so the front/bel
src/mjlab_microduck/tasks/mdp.py:4082
Functionset_random_ground_state
Reset to a random ground state: face-down, face-up, sitting, or standing. Broader than ``set_random_prone_orientation`` — used by the stand-up en
src/mjlab_microduck/tasks/mdp.py:4157
Functionsingle_foot_grounded_reward
Binary reward: 1 while the sensed foot touches the terrain. Single-foot variant of ``feet_grounded_reward`` — used to pin the SUPPORT foot du
src/mjlab_microduck/tasks/mdp.py:5809
Functionsingle_support_reward
Reward single-support (a skating stride), mildly discourage the swizzle. Real skating is a STRIDE: push off one blade while the other swings, i.e
src/mjlab_microduck/tasks/mdp.py:4701
Functionsit_grounded
Positive reward for trunk-ground contact WHILE upright. Gated additionally on the trunk's body-frame +Z axis pointing in roughly the world-up
src/mjlab_microduck/tasks/mdp.py:1891
Functionsit_stability
Bonus for low body angular velocity. Phase-gated when ``command_name`` is set (sit window of a phase command). Always-on otherwise, optionall
src/mjlab_microduck/tasks/mdp.py:1943
Functionskating_air_time_reward
Reward feet air time only when pushing (cmd_x > 0). Encourages the robot to lift each foot during the recovery phase of the skating stroke ra
src/mjlab_microduck/tasks/mdp.py:4653
Functionsmoke_run_onnx
Run the network on plausible inputs and refuse a NaN/inf or a saturated output. Not a physics rehearsal — `scripts/infer_policy.py` is that — but
src/mjlab_microduck/publish/manifest.py:279
Functionspin_grounded
Les deux lames au sol pendant le spin — empêche « je saute et je vrille ». Variante de `grounded_reward` du swizzle, qui n'est pas réutilisable i
src/mjlab_microduck/tasks/mdp.py:6074
Functionspin_rate_l1
Bootstrap L1 : gradient constant vers la cible même quand la gaussienne de `spin_rate_track` sature loin de la cible. À utiliser avec un poids
src/mjlab_microduck/tasks/mdp.py:5968
Functionspin_rate_track
Objectif principal du spin : suivre la vitesse de lacet cible ω*(φ). ω_z est pris en repère corps (c'est ce que voit le gyro de l'IMU, donc ce qu
src/mjlab_microduck/tasks/mdp.py:5946
Functionspin_stay_in_place
Coût ‖v_xy‖² du tronc : tourner SUR PLACE, et tuer l'élan d'entrée. Pas d'état de référence (contrairement à une dérive mesurée depuis le reset),
src/mjlab_microduck/tasks/mdp.py:5989
Functionspin_wheel_differential
Récompense la rotation EN ROULEMENT (et non en patinage). Pour un spin anti-horaire, le patin gauche recule et le droit avance ; les 4 roues
src/mjlab_microduck/tasks/mdp.py:6044
Functionstanding_envs_curriculum
Update the relative number of standing environments based on training progress. Args: env: The RL environment env_ids: Environmen
src/mjlab_microduck/tasks/mdp.py:3295
Functionstanding_phase
Simple time-based phase for standing task. Returns a scalar phase value that cycles from 0 to 1 based on time. This allows the policy to have
src/mjlab_microduck/tasks/mdp.py:3774
Functionstanding_success_bonus
Binary bonus: 1.0 iff height, uprightness AND pose are all within tol. Creates a discrete goal-state attractor that gradient-based pose/upright/
src/mjlab_microduck/tasks/mdp.py:856
Functionstillness_at_zero_command
Reward staying still when command is near zero. Returns exp(-body_vel² / vel_std²) when command < threshold, else 0. This is monotonically de
src/mjlab_microduck/tasks/mdp.py:3841
Functiontarget_angle_tracking
exp(-error^2 / std^2) reward for single-joint position tracking.
src/mjlab_microduck/tasks/testbench_env_cfg.py:99
Functiontermination_param_curriculum
Mutate a termination term's params at scheduled steps. TerminationManager keeps its own deepcopy of the cfg dict, so the live term_cfgs list
src/mjlab_microduck/tasks/mdp.py:5370
Functionterrain_levels_slope
Curriculum de raideur pour roller_slope (pas de vitesse commandée). Progression basée sur la distance en x parcourue depuis l'origine de spawn.
src/mjlab_microduck/tasks/mdp.py:3521
Functiontest_a_61_to_14_graph_passes_and_smoke_runs
(tmp_path)
tests/test_publish_manifest.py:213
Functiontest_a_constant_network_fails_the_smoke_run
A graph that ignores its input is not a policy — the shape gate alone would pass it.
tests/test_publish_manifest.py:232
Functiontest_a_gait_is_perpetual_with_nothing_to_unwind
A walking policy is perpetual too, and goes in a slot — no hold, no unwind, no skill.
tests/test_publish_manifest.py:191
Functiontest_a_legacy_51d_graph_is_refused_before_upload
(tmp_path)
tests/test_publish_manifest.py:220
Functiontest_a_name_is_a_bare_word
()
tests/test_publish_manifest.py:186
Functiontest_a_perpetual_manifest_says_how_to_come_back
()
tests/test_publish_manifest.py:155
Functiontest_a_present_and_wrong_claim_is_refused
(bad, why)
tests/test_publish_manifest.py:126
Functiontest_a_wrong_action_width_is_refused
(tmp_path)
tests/test_publish_manifest.py:226
Functiontest_absence_is_not_evidence
()
tests/test_publish_manifest.py:131
Functiontest_action_rate_ramp_is_the_standup_one_not_the_roller_one
()
tests/test_roller_standup_cfg.py:339
Functiontest_actor_observation_keeps_the_61d_slot_layout
()
tests/test_spin_cfg.py:83
Functiontest_actuators_converted_like_warp
(bam_sim)
tests/test_infer_policy_bam.py:56
Functiontest_already_negative_penalties_use_positive_weights
Verrou sur la classe de bug qui rendait la policy violente. mdp.py mélange DEUX conventions de signe : certaines fonctions de pénalité renvoi
tests/test_roller_standup_cfg.py:456
Functiontest_an_episodic_manifest_is_a_loadable_skill
()
tests/test_publish_manifest.py:139
Functiontest_angular_momentum_reward_is_removed
()
tests/test_spin_cfg.py:46
Functiontest_arrival_starts_from_zero_then_charges_true_bias
()
tests/test_head_pose_bias.py:95
Functiontest_balance_rewards_no_fixed_pose
()
tests/test_roller_slope_cfg.py:44
← previousnext →401–500 of 681, ranked by callers