Commit 990f7bbc authored by Mayank Mittal's avatar Mayank Mittal

Fixes error thrown by Warp because of future import

parent 47e4800d
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.9.34" version = "0.9.35"
# Description # Description
title = "ORBIT framework for Robot Learning" title = "ORBIT framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.9.35 (2023-11-02)
~~~~~~~~~~~~~~~~~~~
Fixed
^^^^^
* Fixed the error: ``'str' object has no attribute '__module__'`` introduced by adding the future import inside the
:mod:`omni.isaac.orbit.utils.warp.kernels` module. Warp language does not support the ``__future__`` imports.
0.9.34 (2023-11-02) 0.9.34 (2023-11-02)
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
"""Custom kernels for warp.""" """Custom kernels for warp."""
from __future__ import annotations
import warp as wp import warp as wp
...@@ -36,10 +34,21 @@ def raycast_mesh_kernel( ...@@ -36,10 +34,21 @@ def raycast_mesh_kernel(
operation. The maximum ray-cast distance is set to `1e6` units. operation. The maximum ray-cast distance is set to `1e6` units.
Args: Args:
mesh: The input mesh identifier. mesh: The input mesh. The ray-casting is performed against this mesh on the device specified by the
ray_starts: The input ray start positions. Shape (N, 3). `mesh`'s `device` attribute.
ray_directions: The input ray directions. Shape (N, 3). ray_starts: The input ray start positions. Shape is (N, 3).
ray_hits: The output ray hit positions. Shape (N, 3). ray_directions: The input ray directions. Shape is (N, 3).
ray_hits: The output ray hit positions. Shape is (N, 3).
ray_distance: The output ray hit distances. Shape is (N,), if `return_distance` is True. Otherwise,
this array is not used.
ray_normal: The output ray hit normals. Shape is (N, 3), if `return_normal` is True. Otherwise,
this array is not used.
ray_face_id: The output ray hit face ids. Shape is (N,), if `return_face_id` is True. Otherwise,
this array is not used.
max_dist: The maximum ray-cast distance. Defaults to 1e6.
return_distance: Whether to return the ray hit distances. Defaults to False.
return_normal: Whether to return the ray hit normals. Defaults to False`.
return_face_id: Whether to return the ray hit face ids. Defaults to False.
""" """
# get the thread id # get the thread id
tid = wp.tid() tid = wp.tid()
...@@ -52,7 +61,9 @@ def raycast_mesh_kernel( ...@@ -52,7 +61,9 @@ def raycast_mesh_kernel(
f = int(0) # hit face index f = int(0) # hit face index
# ray cast against the mesh and store the hit position # ray cast against the mesh and store the hit position
if wp.mesh_query_ray(mesh, ray_starts[tid], ray_directions[tid], max_dist, t, u, v, sign, n, f): hit_success = wp.mesh_query_ray(mesh, ray_starts[tid], ray_directions[tid], max_dist, t, u, v, sign, n, f)
# if the ray hit, store the hit data
if hit_success:
ray_hits[tid] = ray_starts[tid] + t * ray_directions[tid] ray_hits[tid] = ray_starts[tid] + t * ray_directions[tid]
if return_distance == 1: if return_distance == 1:
ray_distance[tid] = t ray_distance[tid] = t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment