def create_multi_body(mass, collision_shapes, is_floating, world): urdf = pd.TinyUrdfStructures() base_link = pd.TinyUrdfLink() base_link.link_name = "plane_link" inertial = pd.TinyUrdfInertial() inertial.mass = mass inertial.inertia_xxyyzz = pd.TinyVector3(mass, mass, mass) base_link.urdf_inertial = inertial base_link.urdf_collision_shapes = collision_shapes urdf.base_links = [base_link] mb = pd.TinyMultiBody(is_floating) urdf2mb = pd.UrdfToMultiBody2() res = urdf2mb.convert2(urdf, world, mb) return mb
def convert_urdf_structures(self): self.urdf_structs = dp.TinyUrdfStructures() self.urdf_links = [] self.urdf_joints = [] #assume link[0] is base if (len(self.urdfLinks) == 0): return -1 self.convert_urdf_link(self.urdfLinks[0], -2) self.urdf_structs.base_links = self.urdf_links self.urdf_links = [] for joint in self.urdfJoints: self.convert_urdf_joint(joint) self.urdf_structs.links = self.urdf_links self.urdf_structs.joints = self.urdf_joints
def create_multi_body(link_name, mass, collision_shapes, visual_shapes, is_floating, mc, world): urdf = pd.TinyUrdfStructures() base_link = pd.TinyUrdfLink() base_link.link_name = link_name inertial = pd.TinyUrdfInertial() inertial.mass = mass inertial.inertia_xxyyzz = pd.TinyVector3(mass,mass,mass) base_link.urdf_inertial = inertial base_link.urdf_collision_shapes = collision_shapes base_link.urdf_visual_shapes = visual_shapes urdf.base_links = [base_link] mb = pd.TinyMultiBody(is_floating) urdf2mb = pd.UrdfToMultiBody2() res = urdf2mb.convert2(urdf, world, mb) b2vis = meshcat_utils_dp.convert_visuals(urdf, None, vis) return mb, b2vis