mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Feature request - Proximity queries

Open eaa3 opened this issue 2 years ago • 4 comments

I was wondering if we currently have something akin to the distance and collision queries supported by Bullet [1] (e.g. getContactPoints, getClosestPoints). Is there any documentation on something equivalent to that in MuJoCo or could that be a potential feature to be implemented in the future? Many thanks for the presentation at CoRL!

[1] - https://docs.google.com/document/u/0/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/mobilebasic#h.hrpbzrwzgy1p

eaa3 avatar Nov 09 '21 15:11 eaa3

Hi, thanks for input!

Regarding getContactPoints, simply iterate over the data->contact array to read out the contact points that have been found in the last call to the dynamics.

Regarding getClosestPoints, finding the distance and/or contact point between two arbitrary geoms -- independently of the dynamics -- there is no easy way to do this with the current API, but we can fairly easily add that. I've marked this as a feature request and will update here when we have something.

yuvaltassa avatar Nov 10 '21 14:11 yuvaltassa

simply iterate over the data->contact array to read out the contact points

Hello. In what function or part of the cc file would you do this?
I've tried to print out a lot of the data with d-> or m-> and I get Segmentation fault (core dumped)

MotorCityCobra avatar Nov 29 '21 22:11 MotorCityCobra

May I ask has there have been any updates on finding the distance between two arbitrary geoms? Thank you!

lzyang2000 avatar Oct 27 '23 02:10 lzyang2000

Thanks for the reminder!

yuvaltassa avatar Oct 27 '23 13:10 yuvaltassa