-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Tune Newton MJWarp locomotion environments #6861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 4 commits
1113a64
9d881d2
d832f83
0c20987
ec8d3ef
a446a82
5df3020
d96038b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added :func:`~isaaclab.envs.mdp.body_lin_vel_out_of_manual_limit` to terminate environments when an | ||
| articulation body exceeds a configured linear speed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,3 +189,14 @@ def illegal_contact(env: ManagerBasedRLEnv, threshold: float, sensor_cfg: SceneE | |
| return torch.any( | ||
| torch.max(torch.linalg.norm(net_contact_forces[:, :, sensor_cfg.body_ids], dim=-1), dim=1)[0] > threshold, dim=1 | ||
| ) | ||
|
|
||
|
|
||
| def body_lin_vel_out_of_manual_limit( | ||
| env: ManagerBasedRLEnv, max_speed: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot") | ||
| ) -> torch.Tensor: | ||
| """Terminate when any of the asset's bodies moves faster than the provided limit.""" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 Suggestion · Api — Docstring lacks Args and SI unit Public API docstrings must be Google-style with an |
||
| # extract the used quantities (to enable type-hinting) | ||
| asset: Articulation = env.scene[asset_cfg.name] | ||
| # compute any violations | ||
| speed = torch.linalg.norm(asset.data.body_lin_vel_w.torch[:, asset_cfg.body_ids], dim=-1) | ||
| return torch.any(speed > max_speed, dim=1) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Fixed | ||
| ^^^^^ | ||
|
|
||
| * Fixed Newton MJWarp locomotion training instability by tuning contact capacity and parameters, adjusting the | ||
| ANYmal-D initial height, and terminating excessively fast bodies. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,8 +52,8 @@ class RoughPhysicsCfg(PresetCfg): | |
| physx = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) | ||
| newton_mjwarp = NewtonCfg( | ||
| solver_cfg=MJWarpSolverCfg( | ||
| njmax=200, | ||
| nconmax=100, | ||
| njmax=1000, | ||
| nconmax=300, | ||
| cone="pyramidal", | ||
| impratio=1.0, | ||
| integrator="implicitfast", | ||
|
|
@@ -62,10 +62,7 @@ class RoughPhysicsCfg(PresetCfg): | |
| collision_cfg=NewtonCollisionPipelineCfg(max_triangle_pairs=2_500_000), | ||
| num_substeps=1, | ||
| debug_mode=False, | ||
| # 1 cm shape margin is the single most important Newton setting for rough | ||
| # terrain — without it, non-AnymalD robots fail to learn stable contact | ||
| # on triangle-mesh terrain. See isaaclab_newton 0.5.22 changelog. | ||
| default_shape_cfg=NewtonShapeCfg(margin=0.01), | ||
| default_shape_cfg=NewtonShapeCfg(margin=0.0, ke=160000.0, kd=1100.0), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When inherited rough-terrain tasks run with the Knowledge Base Used: isaaclab_tasks: Task Registration and Organization
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Warning · Design Architecture — Shared preset drops margin other robots rely on
|
||
| ) | ||
| default = isaacsim_physx | ||
|
|
||
|
|
@@ -321,6 +318,7 @@ class TerminationsCfg: | |
| func=mdp.illegal_contact, | ||
| params={"sensor_cfg": SceneEntityCfg("contact_forces", body_names="base"), "threshold": 1.0}, | ||
| ) | ||
| body_speed = DoneTerm(func=mdp.body_lin_vel_out_of_manual_limit, params={"max_speed": 20.0}) | ||
|
|
||
|
|
||
| @configclass | ||
|
|
@@ -362,6 +360,8 @@ def __post_init__(self): | |
| self.sim.dt = 0.005 | ||
| self.sim.render_interval = self.decimation | ||
| self.sim.physics_material = self.scene.terrain.physics_material | ||
| newton = self.sim.physics.newton_mjwarp | ||
| newton.collision_cfg.rigid_contact_max = newton.solver_cfg.nconmax * self.scene.num_envs | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Knowledge Base Used: isaaclab_tasks: Task Registration and Organization
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Warning · Implementation — Contact buffer sized from default num_envs
|
||
| # update sensor update periods | ||
| # we tick all the sensors based on the smallest update period (physics update period) | ||
| if self.scene.height_scanner is not None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Warning · Implementation — Missing changelog fragments for touched packages
Repository rules require one fragment per touched package under
source/<pkg>/changelog.d/. This PR touchesisaaclab(new exportedbody_lin_vel_out_of_manual_limit) andisaaclab_tasks(physics preset retune, newbody_speedtermination, AnymalD init pose) but adds none, so these user-visible changes will be omitted from the compiled changelog. Add anAddedfragment for the termination and aChangedfragment for the locomotion config updates.