I want to set distance senor to robot. I used raycast_closest(origin, rayDir, distance) and get distance to the rigid body, but I can’t get distance to the deformable body.
Frequently Used Python Snippets — isaacsim 2022.2.1 documentation (nvidia.com)
On the other hand, I found another API which called ray_cast().
Core [omni.isaac.core] — isaac_sim 2022.2.1-beta.29 documentation (nvidia.com)
My code is here.
s_pos = np.array([-1, 0, 0.1])
s_ori = np.array([1.0, 0.0, 0.0])
s_off = np.array([0, 0, 0])
s_max = 100
anpn = ray_cast(s_pos, s_ori, s_off, s_max)
print(anpn)
But, I have the following error.
[Error] [asyncio] Task exception was never retrieved
future: <Task finished coro=<BaseSampleExtension._on_load_world.<locals>._on_load_world_async() done, defined at c:\users\rr011\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\base_sample\base_sample_extension.py:150> exception=ArgumentError('Python argument types in\n Quatf.__init__(Quatf, float, float, float)\ndid not match C++ signature:\n __init__(struct _object * __ptr64, class pxrInternal_v0_20__pxrReserved__::GfQuatd)\n __init__(struct _object * __ptr64, float real, float i, float j, float k)\n __init__(struct _object * __ptr64, float real, class pxrInternal_v0_20__pxrReserved__::GfVec3f imaginary)\n __init__(struct _object * __ptr64, float real)\n __init__(struct _object * __ptr64, class pxrInternal_v0_20__pxrReserved__::GfQuatf)\n __init__(class boost::python::api::object)')>
Traceback (most recent call last):
File "c:\users\rr011\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\base_sample\base_sample_extension.py", line 151, in _on_load_world_async
await self._sample.load_world_async()
File "c:\users\rr011\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\base_sample\base_sample.py", line 43, in load_world_async
self.setup_scene()
File "c:\users\rr011\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\hello_world\hello_world.py", line 110, in setup_scene
anpn = ray_cast(s_pos, s_ori, s_off, s_max)
File "c:\users\rr011\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.core\omni\isaac\core\utils\collisions.py", line 41, in ray_cast
input_tr.SetRotateOnly(Gf.Quatf(*orientation.tolist()))
Boost.Python.ArgumentError: Python argument types in
Quatf.__init__(Quatf, float, float, float)
did not match C++ signature:
__init__(struct _object * __ptr64, class pxrInternal_v0_20__pxrReserved__::GfQuatd)
__init__(struct _object * __ptr64, float real, float i, float j, float k)
__init__(struct _object * __ptr64, float real, class pxrInternal_v0_20__pxrReserved__::GfVec3f imaginary)
__init__(struct _object * __ptr64, float real)
__init__(struct _object * __ptr64, class pxrInternal_v0_20__pxrReserved__::GfQuatf)
__init__(class boost::python::api::object)
What should I do to get distance to the deformable body?
Please tell me the solution.