Skip to content

Stop heading and world frame commands from overriding rel_forward_envs - #1214

Merged
kevinzakka merged 1 commit into
mujocolab:mainfrom
vssinghh:fix/forward-env-heading-override
Oct 6, 2026
Merged

kevinzakka merged 1 commit into
mujocolab:mainfrom
vssinghh:fix/forward-env-heading-override

Conversation

@vssinghh

@vssinghh vssinghh commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

rel_forward_envs is documented to give envs "positive lin_vel_x, zero lin_vel_y and ang_vel_z" (#827). But is_heading_env and is_world_env are sampled independently, and _update_command rewrites vel_command_b every step for both:

  • Heading: with the default config (rel_heading_envs=0.3, rel_forward_envs=0.2), about 30% of these envs are turned toward a random heading at up to 0.5 rad/s.
  • World frame: with rel_world_envs > 0, they can be commanded backwards or sideways.

This clears both flags for fwd_ids at resample time. Standing envs still take precedence. Side effect: the effective heading share drops from rel_heading_envs to rel_heading_envs * (1 - rel_forward_envs) (30% to 24% by default). If you would rather keep heading control with heading_target set to the current heading, happy to switch.

In UniformVelocityCommand._resample_command, is_heading_env and is_world_env are sampled independently of is_forward_env, and _update_command rewrites vel_command_b every step for both. Clear both flags for fwd_ids at resample time so envs sampled by rel_forward_envs keep their straight command.

@kevinzakka kevinzakka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kevinzakka
kevinzakka merged commit c5adfae into mujocolab:main Oct 6, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants