MushroomRL / mushroom-rl

Python library for Reinforcement Learning.
MIT License
803 stars 145 forks source link

Added assertion to check for duplicate keys in observation spec in Mujoco #110

Closed robfiras closed 1 year ago

robfiras commented 1 year ago

Duplicates keys should not be allowed in observation_spec. Added assertion to check for that.

Also fixed bug with action_spec, as before the Mujoco interface appended unspecified actuators with an action index -1. Added assertion to check if an actuator is unspecified.

cube1324 commented 1 year ago

Why do you replace self._model.actuator(name).id with mujoco.mj_name2id(self._model, mujoco.mjtObj.mjOBJ_ACTUATOR, name)? They both should behave the same since the newest mujoco version.

robfiras commented 1 year ago

Why do you replace self._model.actuator(name).id with mujoco.mj_name2id(self._model, mujoco.mjtObj.mjOBJ_ACTUATOR, name)? They both should behave the same since the newest mujoco version.

Sorry that was my fault, haven't pulled your latest commit. self._model.actuator(name).id actually raises an exception so I reverted that commit.