39 const urdf::LinkConstSharedPtr& urdf_link,
bool active)
43 active_links.push_back(urdf_link->name);
44 for (
const auto& child_link : urdf_link->child_links)
51 for (std::size_t i = 0; i < urdf_link->child_links.size(); ++i)
53 const urdf::LinkConstSharedPtr child_link = urdf_link->child_links[i];
54 if ((child_link->parent_joint) && (child_link->parent_joint->type != urdf::Joint::FIXED))
67 case urdf::Geometry::SPHERE:
68 result =
new shapes::Sphere(
static_cast<const urdf::Sphere*
>(geom)->radius);
70 case urdf::Geometry::BOX:
72 urdf::Vector3 dim =
static_cast<const urdf::Box*
>(geom)->dim;
76 case urdf::Geometry::CYLINDER:
77 result =
new shapes::Cylinder(
static_cast<const urdf::Cylinder*
>(geom)->radius,
78 static_cast<const urdf::Cylinder*
>(geom)->length);
80 case urdf::Geometry::MESH:
82 const urdf::Mesh* mesh =
static_cast<const urdf::Mesh*
>(geom);
83 if (!mesh->filename.empty())
92 ROS_ERROR(
"Unknown geometry type: %d",
static_cast<int>(geom->type));
101 Eigen::Quaterniond q(pose.rotation.w, pose.rotation.x, pose.rotation.y, pose.rotation.z);
102 Eigen::Isometry3d result;
103 result.translation() =
Eigen::Vector3d(pose.position.x, pose.position.y, pose.position.z);
104 result.linear() = q.toRotationMatrix();