Skip to content

[Bugfix] Fix physics instability caused by mismatch between initial position and standing pose #2

@Logic-TARS

Description

@Logic-TARS

I encountered a physics instability issue during the initialization of the Go1 robot. The robot tends to be "flung" into the air or causes the physics engine to crash immediately upon spawning.

Root Cause Analysis
After investigation, I found a conflict between the initial base position and the joint pose configuration:

Low Initial Position: The code loads the default initial position from the XML model file (approx. 0.28m), which corresponds to the robot lying on the ground.

Standing Pose: However, the code enforces a "standing" joint configuration from the config file (expecting a hip height of approx. 0.42m).

Consequence: When the simulation starts, the robot's limbs are forced into a standing pose while the base is still at ground level. This causes the legs to spawn inside the ground geometry. The physics engine resolves this interpenetration by applying massive reaction forces, causing the robot to fly off or the simulation to break.

Proposed Solution
I modified motrix_envs/locomotion/go1/walk_np.py to enforce the correct initial height defined in the configuration file before the simulation steps begin.

File: motrix_envs/locomotion/go1/walk_np.py

Modification:
self._init_dof_pos = self._model.compute_init_dof_pos() self._init_dof_pos[0:3] = cfg.init_state.pos self._init_buffer()

This ensures the robot spawns at the correct height (0.42m) matching its standing pose, resolving the physics conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions