maxspahn / gym_envs_urdf

URDF environments for gym
https://maxspahn.github.io/gym_envs_urdf/
GNU General Public License v3.0
43 stars 14 forks source link

Bug: If no collision obstacle is hit with a ray in mujoco #259

Closed maxspahn closed 4 months ago

maxspahn commented 4 months ago

In mujoco, a raycast returns -1 if no body is hit by the ray, see https://mujoco.readthedocs.io/en/stable/XMLreference.html#sensor-rangefinder.

Therefore, this implementation is causing an issue in open spaces. It should instead return self._ray_length in case sensordata = -1.

https://github.com/maxspahn/gym_envs_urdf/blob/d1691dbd933a672b8212aac00305893e9fe6534f/urdfenvs/sensors/physics_engine_interface.py#L168-L169