Fix Isaac Lab force clear shapes #74
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Find some bug when I try to train in my pc,and I fix it by codex-5.2,env info is:
cuda 12.8
isaacsim 5.1.0
RTX 5080
Ubuntu 24.03
python 3.11
torch 2.7.0
Root cause: some Isaac Lab builds no longer expose Articulation.has_external_wrench, so _clear_forces hit AttributeError. After a quick workaround, the force-
clearing path passed a wrongly shaped tensor (e.g., [1, 3]), causing set_forces_and_torques_at_position to fail because it expects 2D/3D force arrays.
Changes in mimickit/engines/isaac_lab_engine.py:
with correct shapes based on object type: articulated uses [num_envs, num_bodies, 3], rigid uses [num_envs, 3], then resets the flag.
This prevents API-compat crashes and ensures force clearing uses valid tensor dimensions.