Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
jsk_recognition_utils::Cube Class Reference

#include <cube.h>

Public Types

typedef boost::shared_ptr< CubePtr
 

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::Ptredges ()
 
std::vector< Polygon::Ptrfaces ()
 returns all the 6 faces as Polygon::Ptr. TODO: is it should be ConvexPolygon? More...
 
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. More...
 
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. More...
 
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]. More...
 
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. More...
 
virtual Eigen::Vector3f buildVertex (double i, double j, double k)
 A helper method to build vertex from x-y-z relatiev coordinates. More...
 

Protected Attributes

std::vector< double > dimensions_
 
Eigen::Vector3f pos_
 
Eigen::Quaternionf rot_
 

Detailed Description

Definition at line 45 of file cube.h.

Member Typedef Documentation

Definition at line 48 of file cube.h.

Constructor & Destructor Documentation

jsk_recognition_utils::Cube::Cube ( const Eigen::Vector3f &  pos,
const Eigen::Quaternionf &  rot 
)

Definition at line 42 of file cube.cpp.

jsk_recognition_utils::Cube::Cube ( const Eigen::Vector3f &  pos,
const Eigen::Quaternionf &  rot,
const std::vector< double > &  dimensions 
)

Definition at line 48 of file cube.cpp.

jsk_recognition_utils::Cube::Cube ( const Eigen::Vector3f &  pos,
const Eigen::Quaternionf &  rot,
const Eigen::Vector3f &  dimensions 
)

Definition at line 54 of file cube.cpp.

jsk_recognition_utils::Cube::Cube ( const Eigen::Vector3f &  pos,
const Line line_a,
const Line line_b,
const Line line_c 
)

Definition at line 64 of file cube.cpp.

jsk_recognition_utils::Cube::Cube ( const jsk_recognition_msgs::BoundingBox &  box)

Definition at line 106 of file cube.cpp.

jsk_recognition_utils::Cube::~Cube ( )
virtual

Definition at line 118 of file cube.cpp.

Member Function Documentation

Polygon::Ptr jsk_recognition_utils::Cube::buildFace ( const Eigen::Vector3f  v0,
const Eigen::Vector3f  v1,
const Eigen::Vector3f  v2,
const Eigen::Vector3f  v3 
)
protectedvirtual

A helper method to build polygon from 4 vertices.

Definition at line 243 of file cube.cpp.

Eigen::Vector3f jsk_recognition_utils::Cube::buildVertex ( double  i,
double  j,
double  k 
)
protectedvirtual

A helper method to build vertex from x-y-z relatiev coordinates.

Definition at line 284 of file cube.cpp.

std::vector< Segment::Ptr > jsk_recognition_utils::Cube::edges ( )

Definition at line 123 of file cube.cpp.

std::vector< Polygon::Ptr > jsk_recognition_utils::Cube::faces ( )

returns all the 6 faces as Polygon::Ptr. TODO: is it should be ConvexPolygon?

Definition at line 256 of file cube.cpp.

std::vector<double> jsk_recognition_utils::Cube::getDimensions ( ) const
inline

Definition at line 60 of file cube.h.

ConvexPolygon::Ptr jsk_recognition_utils::Cube::intersectConvexPolygon ( Plane plane)

Definition at line 174 of file cube.cpp.

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.

Definition at line 292 of file cube.cpp.

void jsk_recognition_utils::Cube::setDimensions ( const std::vector< double > &  new_dimensions)
inline

Definition at line 61 of file cube.h.

jsk_recognition_msgs::BoundingBox jsk_recognition_utils::Cube::toROSMsg ( )

Definition at line 203 of file cube.cpp.

Vertices jsk_recognition_utils::Cube::transformVertices ( const Eigen::Affine3f &  pose_offset)

returns vertices transformed by pose_offset.

Definition at line 233 of file cube.cpp.

Vertices jsk_recognition_utils::Cube::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].

Definition at line 219 of file cube.cpp.

Member Data Documentation

std::vector<double> jsk_recognition_utils::Cube::dimensions_
protected

Definition at line 103 of file cube.h.

Eigen::Vector3f jsk_recognition_utils::Cube::pos_
protected

Definition at line 101 of file cube.h.

Eigen::Quaternionf jsk_recognition_utils::Cube::rot_
protected

Definition at line 102 of file cube.h.


The documentation for this class was generated from the following files:


jsk_recognition_utils
Author(s):
autogenerated on Mon May 3 2021 03:03:03