Skip to content
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

Add asserts for mj_id2name calls in mujoco_utils #218

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

DavidPL1
Copy link
Contributor

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.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • 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)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
    (not necessary here)
  • New and existing unit tests pass locally with my changes

@Kallinteris-Andreas
Copy link
Collaborator

@Kallinteris-Andreas Kallinteris-Andreas changed the title Add asserts for mj_id2name calls in mujoco_utils Add asserts for mj_id2name calls in mujoco_utils Jun 1, 2024
@Kallinteris-Andreas Kallinteris-Andreas merged commit 0a213bb into Farama-Foundation:main Jun 1, 2024
5 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