Added asserts for calls to mj_id2name calls. In case the resource is not available in the model definition the call returns -1. After these calls this case is not handled as an error and values for the wrong joint, site, or body are returned.
This change increases the reusability of mujoco_utils and is especially helpful when creating or customizing mujoco environments.
Type of change
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
Checklist:
[x] I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
[ ] I have commented my code, particularly in hard-to-understand areas
(not necessary here)
[ ] I have made corresponding changes to the documentation
(not necessary here)
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
(not necessary here)
[x] New and existing unit tests pass locally with my changes
Description
Added asserts for calls to mj_id2name calls. In case the resource is not available in the model definition the call returns
-1
. After these calls this case is not handled as an error and values for the wrong joint, site, or body are returned.This change increases the reusability of mujoco_utils and is especially helpful when creating or customizing mujoco environments.
Type of change
Please delete options that are not relevant.
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)