#include <cube.h>
Public Types | |
typedef boost::shared_ptr< Cube > | Ptr |
Public Member Functions | |
Cube (const Eigen::Vector3f &pos, const Eigen::Quaternionf &rot) | |
Cube (const Eigen::Vector3f &pos, const Eigen::Quaternionf &rot, const std::vector< double > &dimensions) | |
Cube (const Eigen::Vector3f &pos, const Eigen::Quaternionf &rot, const Eigen::Vector3f &dimensions) | |
Cube (const Eigen::Vector3f &pos, const Line &line_a, const Line &line_b, const Line &line_c) | |
Cube (const jsk_recognition_msgs::BoundingBox &box) | |
std::vector< Segment::Ptr > | edges () |
std::vector< Polygon::Ptr > | faces () |
returns all the 6 faces as Polygon::Ptr. TODO: is it should be ConvexPolygon? | |
std::vector< double > | getDimensions () const |
ConvexPolygon::Ptr | intersectConvexPolygon (Plane &plane) |
virtual Eigen::Vector3f | nearestPoint (const Eigen::Vector3f &p, double &distance) |
compute minimum distance from point p to cube surface. | |
void | setDimensions (const std::vector< double > &new_dimensions) |
jsk_recognition_msgs::BoundingBox | toROSMsg () |
Vertices | transformVertices (const Eigen::Affine3f &pose_offset) |
returns vertices transformed by pose_offset. | |
Vertices | vertices () |
returns vertices as an array of Eigen::Vectro3f. The order of the vertices is: [1, 1, 1], [-1, 1, 1], [-1, -1, 1], [1, -1, 1], [1, 1, -1], [-1, 1, -1], [-1, -1, -1], [1, -1, -1]. | |
virtual | ~Cube () |
Protected Member Functions | |
virtual Polygon::Ptr | buildFace (const Eigen::Vector3f v0, const Eigen::Vector3f v1, const Eigen::Vector3f v2, const Eigen::Vector3f v3) |
A helper method to build polygon from 4 vertices. | |
virtual Eigen::Vector3f | buildVertex (double i, double j, double k) |
A helper method to build vertex from x-y-z relatiev coordinates. | |
Protected Attributes | |
std::vector< double > | dimensions_ |
Eigen::Vector3f | pos_ |
Eigen::Quaternionf | rot_ |
typedef boost::shared_ptr<Cube> jsk_recognition_utils::Cube::Ptr |
jsk_recognition_utils::Cube::Cube | ( | const Eigen::Vector3f & | pos, |
const Eigen::Quaternionf & | rot | ||
) |
jsk_recognition_utils::Cube::Cube | ( | const Eigen::Vector3f & | pos, |
const Eigen::Quaternionf & | rot, | ||
const std::vector< double > & | dimensions | ||
) |
jsk_recognition_utils::Cube::Cube | ( | const Eigen::Vector3f & | pos, |
const Eigen::Quaternionf & | rot, | ||
const Eigen::Vector3f & | dimensions | ||
) |
jsk_recognition_utils::Cube::Cube | ( | const Eigen::Vector3f & | pos, |
const Line & | line_a, | ||
const Line & | line_b, | ||
const Line & | line_c | ||
) |
jsk_recognition_utils::Cube::Cube | ( | const jsk_recognition_msgs::BoundingBox & | box | ) |
jsk_recognition_utils::Cube::~Cube | ( | ) | [virtual] |
Polygon::Ptr jsk_recognition_utils::Cube::buildFace | ( | const Eigen::Vector3f | v0, |
const Eigen::Vector3f | v1, | ||
const Eigen::Vector3f | v2, | ||
const Eigen::Vector3f | v3 | ||
) | [protected, virtual] |
Eigen::Vector3f jsk_recognition_utils::Cube::buildVertex | ( | double | i, |
double | j, | ||
double | k | ||
) | [protected, virtual] |
std::vector< Segment::Ptr > jsk_recognition_utils::Cube::edges | ( | ) |
std::vector< Polygon::Ptr > jsk_recognition_utils::Cube::faces | ( | ) |
returns all the 6 faces as Polygon::Ptr. TODO: is it should be ConvexPolygon?
std::vector<double> jsk_recognition_utils::Cube::getDimensions | ( | ) | const [inline] |
Eigen::Vector3f jsk_recognition_utils::Cube::nearestPoint | ( | const Eigen::Vector3f & | p, |
double & | distance | ||
) | [virtual] |
compute minimum distance from point p to cube surface.
Distance computation depends on Polygon::nearestPoint and this methods just searches a face which resutnrs the smallest distance.
void jsk_recognition_utils::Cube::setDimensions | ( | const std::vector< double > & | new_dimensions | ) | [inline] |
jsk_recognition_msgs::BoundingBox jsk_recognition_utils::Cube::toROSMsg | ( | ) |
Vertices jsk_recognition_utils::Cube::transformVertices | ( | const Eigen::Affine3f & | pose_offset | ) |
std::vector<double> jsk_recognition_utils::Cube::dimensions_ [protected] |
Eigen::Vector3f jsk_recognition_utils::Cube::pos_ [protected] |
Eigen::Quaternionf jsk_recognition_utils::Cube::rot_ [protected] |