|
hpp-fcl
1.6.0
HPP fork of FCL -- The Flexible Collision Library
|
Go to the documentation of this file.
39 #ifndef HPP_FCL_COLLISION_OBJECT_BASE_H
40 #define HPP_FCL_COLLISION_OBJECT_BASE_H
42 #include <hpp/fcl/deprecated.hh>
45 #include <boost/shared_ptr.hpp>
57 GEOM_BOX,
GEOM_SPHERE,
GEOM_CAPSULE,
GEOM_CONE,
GEOM_CYLINDER,
GEOM_CONVEX,
GEOM_PLANE,
GEOM_HALFSPACE,
GEOM_TRIANGLE,
GEOM_OCTREE,
NODE_COUNT};
67 threshold_occupied(1),
97 {
return cost_density >= threshold_occupied; }
101 {
return cost_density <= threshold_free; }
139 Matrix3f C = computeMomentofInertia();
140 Vec3f com = computeCOM();
143 return (
Matrix3f() << C(0, 0) - V * (com[1] * com[1] + com[2] * com[2]),
144 C(0, 1) + V * com[0] * com[1],
145 C(0, 2) + V * com[0] * com[2],
146 C(1, 0) + V * com[1] * com[0],
147 C(1, 1) - V * (com[0] * com[0] + com[2] * com[2]),
148 C(1, 2) + V * com[1] * com[2],
149 C(2, 0) + V * com[2] * com[0],
150 C(2, 1) + V * com[2] * com[1],
151 C(2, 2) - V * (com[0] * com[0] + com[1] * com[1])).finished();
161 cgeom(cgeom_), cgeom_const(cgeom_)
165 cgeom->computeLocalAABB();
171 cgeom(cgeom_), cgeom_const(cgeom_), t(tf)
173 cgeom->computeLocalAABB();
178 cgeom(cgeom_), cgeom_const(cgeom_), t(
Transform3f(R, T))
180 cgeom->computeLocalAABB();
191 return cgeom->getObjectType();
197 return cgeom->getNodeType();
209 if(t.getRotation().isIdentity())
211 aabb =
translate(cgeom->aabb_local, t.getTranslation());
215 Vec3f center (t.transform(cgeom->aabb_center));
216 Vec3f delta(Vec3f::Constant(cgeom->aabb_radius));
217 aabb.min_ = center - delta;
218 aabb.max_ = center + delta;
237 return t.getTranslation();
243 return t.getRotation();
269 t.setTransform(R, T);
283 return t.isIdentity();
306 boost::shared_ptr<CollisionGeometry>
cgeom;
virtual FCL_REAL computeVolume() const
compute the volume
Definition: collision_object.h:134
@ BV_RSS
Definition: collision_object.h:56
const boost::shared_ptr< const CollisionGeometry > & collisionGeometry() const
get geometry from the object instance
Definition: collision_object.h:293
void computeAABB()
compute the AABB in world space
Definition: collision_object.h:207
const Vec3f & getTranslation() const
get translation of the object
Definition: collision_object.h:235
void setRotation(const Matrix3f &R)
set object's rotation matrix
Definition: collision_object.h:253
void setTransform(const Transform3f &tf)
set object's transform
Definition: collision_object.h:275
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:67
@ GEOM_SPHERE
Definition: collision_object.h:57
@ BV_AABB
Definition: collision_object.h:56
virtual void computeLocalAABB()=0
compute the AABB for object in local coordinate
virtual OBJECT_TYPE getObjectType() const
get the type of the object
Definition: collision_object.h:75
@ GEOM_HALFSPACE
Definition: collision_object.h:57
FCL_REAL threshold_occupied
threshold for occupied ( >= is occupied)
Definition: collision_object.h:122
@ BV_KDOP18
Definition: collision_object.h:56
@ GEOM_OCTREE
Definition: collision_object.h:57
void setIdentityTransform()
set the object in local coordinate
Definition: collision_object.h:287
@ GEOM_CONVEX
Definition: collision_object.h:57
AABB aabb
AABB in global coordinate.
Definition: collision_object.h:312
virtual ~CollisionGeometry()
Definition: collision_object.h:72
AABB aabb_local
AABB in local coordinate, used for tight AABB when only translation transform.
Definition: collision_object.h:113
void * user_data
pointer to user defined data specific to this object
Definition: collision_object.h:116
CollisionGeometry()
Definition: collision_object.h:66
@ BV_kIOS
Definition: collision_object.h:56
@ OT_UNKNOWN
Definition: collision_object.h:53
bool isUncertain() const
whether the object has some uncertainty
NODE_TYPE getNodeType() const
get the node type
Definition: collision_object.h:195
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: AABB.h:56
bool isFree() const
whether the object is completely free
Definition: collision_object.h:100
void setTranslation(const Vec3f &T)
set object's translation
Definition: collision_object.h:259
@ GEOM_CAPSULE
Definition: collision_object.h:57
boost::shared_ptr< const CollisionGeometry > cgeom_const
Definition: collision_object.h:307
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18,...
Definition: collision_object.h:56
@ GEOM_PLANE
Definition: collision_object.h:57
void * user_data
pointer to user defined data specific to this object
Definition: collision_object.h:315
double FCL_REAL
Definition: data_types.h:66
FCL_REAL threshold_free
threshold for free (<= is free)
Definition: collision_object.h:125
virtual Matrix3f computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: collision_object.h:131
@ GEOM_CONE
Definition: collision_object.h:57
OBJECT_TYPE
object type: BVH (mesh, points), basic geometry, octree
Definition: collision_object.h:53
@ BV_KDOP24
Definition: collision_object.h:56
CollisionObject(const boost::shared_ptr< CollisionGeometry > &cgeom_, const Transform3f &tf)
Definition: collision_object.h:170
CollisionObject(const boost::shared_ptr< CollisionGeometry > &cgeom_)
Definition: collision_object.h:160
@ OT_OCTREE
Definition: collision_object.h:53
@ BV_OBB
Definition: collision_object.h:56
KDOP< N > translate(const KDOP< N > &bv, const Vec3f &t)
translate the KDOP BV
Main namespace.
Definition: AABB.h:44
@ OT_GEOM
Definition: collision_object.h:53
const Matrix3f & getRotation() const
get matrix rotation of the object
Definition: collision_object.h:241
virtual NODE_TYPE getNodeType() const
get the node type
Definition: collision_object.h:78
void setTransform(const Matrix3f &R, const Vec3f &T)
set object's transform
Definition: collision_object.h:267
@ BV_UNKNOWN
Definition: collision_object.h:56
boost::shared_ptr< CollisionGeometry > cgeom
Definition: collision_object.h:306
bool isIdentityTransform() const
whether the object is in local coordinate
Definition: collision_object.h:281
@ GEOM_CYLINDER
Definition: collision_object.h:57
void setUserData(void *data)
set user data in geometry
Definition: collision_object.h:90
const boost::shared_ptr< CollisionGeometry > & collisionGeometry()
get geometry from the object instance
Definition: collision_object.h:299
OBJECT_TYPE getObjectType() const
get the type of the object
Definition: collision_object.h:189
void * getUserData() const
get user data in geometry
Definition: collision_object.h:84
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
Definition: data_types.h:68
The geometry for the object for collision or distance computation.
Definition: collision_object.h:64
virtual Vec3f computeCOM() const
compute center of mass
Definition: collision_object.h:128
const Transform3f & getTransform() const
get object's transform
Definition: collision_object.h:247
virtual Matrix3f computeMomentofInertiaRelatedToCOM() const
compute the inertia matrix, related to the com
Definition: collision_object.h:137
@ GEOM_BOX
Definition: collision_object.h:57
Vec3f aabb_center
AABB center in local coordinate.
Definition: collision_object.h:107
@ GEOM_TRIANGLE
Definition: collision_object.h:57
@ NODE_COUNT
Definition: collision_object.h:57
void setUserData(void *data)
set user data in object
Definition: collision_object.h:229
~CollisionObject()
Definition: collision_object.h:184
void * getUserData() const
get user data in object
Definition: collision_object.h:223
@ BV_OBBRSS
Definition: collision_object.h:56
@ BV_KDOP16
Definition: collision_object.h:56
CollisionObject(const boost::shared_ptr< CollisionGeometry > &cgeom_, const Matrix3f &R, const Vec3f &T)
Definition: collision_object.h:177
bool isOccupied() const
whether the object is completely occupied
Definition: collision_object.h:96
@ OT_BVH
Definition: collision_object.h:53
const AABB & getAABB() const
get the AABB in world space
Definition: collision_object.h:201
Transform3f t
Definition: collision_object.h:309
the object for collision or distance computation, contains the geometry and the transform information
Definition: collision_object.h:158
FCL_REAL cost_density
collision cost for unit volume
Definition: collision_object.h:119
FCL_REAL aabb_radius
AABB radius.
Definition: collision_object.h:110
@ OT_COUNT
Definition: collision_object.h:53