6 handle_detector::CylinderArrayMsg msg;
8 msg.header.frame_id = frame;
9 msg.cylinders.resize(list.size());
11 for (std::size_t i = 0; i < list.size(); i++)
21 geometry_msgs::Pose pose;
29 geometry_msgs::PoseStamped cylinder_pose_msg;
31 Eigen::Vector3d normal_eigen = shell.
getNormal();
32 Eigen::Vector3d perp_eigen = normal_eigen.cross(axis_eigen);
33 tf::Matrix3x3 rotation_matrix(perp_eigen(0), normal_eigen(0), axis_eigen(0), perp_eigen(1), normal_eigen(1),
34 axis_eigen(1), perp_eigen(2), normal_eigen(2), axis_eigen(2));
39 pose.orientation = cylinder_pose_msg.pose.orientation;
42 handle_detector::CylinderMsg cylinder_msg;
43 cylinder_msg.pose = pose;
46 geometry_msgs::Vector3 axis_msg;
48 geometry_msgs::Vector3 normal_msg;
50 cylinder_msg.axis = axis_msg;
51 cylinder_msg.normal = normal_msg;
58 handle_detector::HandleListMsg msg;
60 msg.header.frame_id = frame;
61 msg.handles.resize(handles.size());
63 for (std::size_t i = 0; i < handles.size(); i++)
double getExtent() const
Get the extent of the cylindrical shell.
CylindricalShell represents a cylindrical shell that consists of two colinear cylinders. A shell consists of an inner and an outer cylinder. The portion of the object to be grasped must fit inside the inner cylinder, and the radius of that cylinder must be no larger than the maximum hand aperture. The gap between the inner and outer cylinder must be free of obstacles and wide enough to be able to contain the robot fingers.
static void poseStampedTFToMsg(const Stamped< Pose > &bt, geometry_msgs::PoseStamped &msg)
handle_detector::CylinderArrayMsg createCylinderArray(const std::vector< CylindricalShell > &list, std::string frame)
Create a CylinderArray message from a list of cylindrical shells.
void getRotation(Quaternion &q) const
handle_detector::HandleListMsg createHandleList(const std::vector< std::vector< CylindricalShell > > &handles, std::string frame)
Create a HandleList message from a list of cylindrical shells.
Eigen::Vector3d getNormal() const
Get the normal axis of the cylindrical shell.
void vectorEigenToMsg(const Eigen::Vector3d &e, geometry_msgs::Vector3 &m)
handle_detector::CylinderMsg createCylinder(const CylindricalShell &shell, std::string frame)
Create a Cylinder message from a cylindrical shell.
Eigen::Vector3d getCurvatureAxis() const
Get the curvature axis of the cylindrical shell.
Eigen::Vector3d getCentroid() const
Get the centroid of the cylindrical shell.
double getRadius() const
Get the radius of the cylindrical shell.