add isaac sim 2023 support and dockerfiles
This commit is contained in:
@@ -43,9 +43,9 @@ try:
|
||||
# CuRobo
|
||||
from curobo.cuda_robot_model.usd_kinematics_parser import UsdKinematicsParser
|
||||
except ImportError:
|
||||
log_warn(
|
||||
log_info(
|
||||
"USDParser failed to import, install curobo with pip install .[usd] "
|
||||
+ "or pip install usd-core"
|
||||
+ "or pip install usd-core, NOTE: Do not install this if using with ISAAC SIM."
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -252,12 +252,19 @@ class CudaRobotModel(CudaRobotModelConfig):
|
||||
)
|
||||
return state
|
||||
|
||||
def get_robot_link_meshes(self):
|
||||
m_list = [self.get_link_mesh(l) for l in self.kinematics_config.mesh_link_names]
|
||||
|
||||
return m_list
|
||||
|
||||
def get_robot_as_mesh(self, q: torch.Tensor):
|
||||
# get all link meshes:
|
||||
m_list = [self.get_link_mesh(l) for l in self.mesh_link_names]
|
||||
pose = self.get_link_poses(q, self.mesh_link_names)
|
||||
for li, l in enumerate(self.mesh_link_names):
|
||||
m_list[li].pose = pose.get_index(0, li).tolist()
|
||||
m_list = self.get_robot_link_meshes()
|
||||
pose = self.get_link_poses(q, self.kinematics_config.mesh_link_names)
|
||||
for li, l in enumerate(self.kinematics_config.mesh_link_names):
|
||||
m_list[li].pose = (
|
||||
Pose.from_list(m_list[li].pose).multiply(pose.get_index(0, li)).tolist()
|
||||
)
|
||||
|
||||
return m_list
|
||||
|
||||
@@ -344,7 +351,6 @@ class CudaRobotModel(CudaRobotModelConfig):
|
||||
|
||||
def get_link_mesh(self, link_name: str) -> Mesh:
|
||||
mesh = self.kinematics_parser.get_link_mesh(link_name)
|
||||
mesh.pose = [0, 0, 0, 1, 0, 0, 0]
|
||||
return mesh
|
||||
|
||||
def get_link_transform(self, link_name: str) -> Pose:
|
||||
|
||||
@@ -21,6 +21,7 @@ from curobo.cuda_robot_model.kinematics_parser import KinematicsParser, LinkPara
|
||||
from curobo.cuda_robot_model.types import JointType
|
||||
from curobo.geom.types import Mesh as CuroboMesh
|
||||
from curobo.types.base import TensorDeviceType
|
||||
from curobo.types.math import Pose
|
||||
from curobo.util.logger import log_error, log_warn
|
||||
from curobo.util_file import join_path
|
||||
|
||||
@@ -164,4 +165,16 @@ class UrdfKinematicsParser(KinematicsParser):
|
||||
|
||||
def get_link_mesh(self, link_name):
|
||||
m = self._robot.link_map[link_name].visuals[0].geometry.mesh
|
||||
return CuroboMesh(name=link_name, pose=None, scale=m.scale, file_path=m.filename)
|
||||
mesh_pose = self._robot.link_map[link_name].visuals[0].origin
|
||||
# read visual material:
|
||||
if mesh_pose is None:
|
||||
mesh_pose = [0, 0, 0, 1, 0, 0, 0]
|
||||
else:
|
||||
# convert to list:
|
||||
mesh_pose = Pose.from_matrix(mesh_pose).to_list()
|
||||
return CuroboMesh(
|
||||
name=link_name,
|
||||
pose=mesh_pose,
|
||||
scale=m.scale,
|
||||
file_path=m.filename,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user