-
Notifications
You must be signed in to change notification settings - Fork 109
add rangefinder sensor #214
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
Conversation
erikfrey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, and one question about whether this is JAX compatible
mujoco_warp/_src/ray.py
Outdated
| geomgroup = vec6(0, 0, 0, 0, 0, 0) | ||
|
|
||
| if bodyexclude is None: | ||
| bodyexclude = wp.zeros(nrays, dtype=int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this JAX-safe? I thought we can't allocate arrays during cuda graph capture in JAX - no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure that ray.ray will work as is with cuda graph capture and be compatible with JAX.
the rangefinder sensor utilizes ray._ray and the Model field sensor_rangefinder_bodyid for the input to bodyexclude and should work with cuda graph capture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#277 is updated to add fields ray_dist and ray_geomid to Data and ray.ray utilizes these fields instead of allocating arrays.
add rangefinder sensor
mujoco reference: https://github.com/google-deepmind/mujoco/blob/436b5a8e1f35b6acc5c64944b58a4834e8d38f0c/src/engine/engine_sensor.c#L262