5 #ifndef __pinocchio_multibody_fcl_hpp__ 6 #define __pinocchio_multibody_fcl_hpp__ 8 #include "pinocchio/spatial/se3.hpp" 9 #include "pinocchio/multibody/fwd.hpp" 10 #include "pinocchio/container/aligned-vector.hpp" 12 #ifdef PINOCCHIO_WITH_HPP_FCL 13 #include <hpp/fcl/collision_object.h> 14 #include <hpp/fcl/collision.h> 15 #include <hpp/fcl/distance.h> 16 #include <hpp/fcl/shape/geometric_shapes.h> 17 #include "pinocchio/spatial/fcl-pinocchio-conversions.hpp" 27 #include <boost/foreach.hpp> 28 #include <boost/shared_ptr.hpp> 35 typedef std::pair<GeomIndex, GeomIndex> Base;
39 void disp (std::ostream & os)
const;
40 friend std::ostream & operator << (std::ostream & os,
const CollisionPair & X);
44 #ifndef PINOCCHIO_WITH_HPP_FCL 49 struct FakeCollisionGeometry
51 FakeCollisionGeometry(){};
53 bool operator==(
const FakeCollisionGeometry &)
const 61 AABB(): min_(0), max_(1){};
67 typedef FakeCollisionGeometry CollisionGeometry;
73 namespace fcl = hpp::fcl;
75 #endif // PINOCCHIO_WITH_HPP_FCL 85 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
87 typedef boost::shared_ptr<fcl::CollisionGeometry> CollisionGeometryPtr;
107 PINOCCHIO_DEPRECATED CollisionGeometryPtr &
fcl;
142 const FrameIndex parent_frame,
143 const JointIndex parent_joint,
144 const CollisionGeometryPtr & collision_geometry,
145 const SE3 & placement,
146 const std::string & meshPath =
"",
147 const Eigen::Vector3d & meshScale = Eigen::Vector3d::Ones(),
148 const bool overrideMaterial =
false,
149 const Eigen::Vector4d & meshColor = Eigen::Vector4d::Zero(),
150 const std::string & meshTexturePath =
"")
152 , parentFrame(parent_frame)
153 , parentJoint(parent_joint)
154 , geometry(collision_geometry)
156 , placement(placement)
158 , meshScale(meshScale)
159 , overrideMaterial(overrideMaterial)
160 , meshColor(meshColor)
161 , meshTexturePath(meshTexturePath)
179 const JointIndex parent_joint,
180 const CollisionGeometryPtr & collision_geometry,
181 const SE3 & placement,
182 const std::string & meshPath =
"",
183 const Eigen::Vector3d & meshScale = Eigen::Vector3d::Ones(),
184 const bool overrideMaterial =
false,
185 const Eigen::Vector4d & meshColor = Eigen::Vector4d::Zero(),
186 const std::string & meshTexturePath =
"")
188 , parentFrame(
std::numeric_limits<FrameIndex>::max())
189 , parentJoint(parent_joint)
190 , geometry(collision_geometry)
192 , placement(placement)
194 , meshScale(meshScale)
195 , overrideMaterial(overrideMaterial)
196 , meshColor(meshColor)
197 , meshTexturePath(meshTexturePath)
221 friend std::ostream & operator<< (std::ostream & os,
const GeometryObject & geomObject);
230 #include "pinocchio/multibody/fcl.hxx" 232 #endif // ifndef __pinocchio_multibody_fcl_hpp__
CollisionGeometryPtr geometry
The FCL CollisionGeometry (might be a Mesh, a Geometry Primitive, etc.)
bool overrideMaterial
Decide whether to override the Material.
Eigen::Vector3d meshScale
Scaling vector applied to the GeometryObject::fcl object.
std::string meshTexturePath
Absolute path to the mesh texture file.
GeometryObject(const std::string &name, const FrameIndex parent_frame, const JointIndex parent_joint, const CollisionGeometryPtr &collision_geometry, const SE3 &placement, const std::string &meshPath="", const Eigen::Vector3d &meshScale=Eigen::Vector3d::Ones(), const bool overrideMaterial=false, const Eigen::Vector4d &meshColor=Eigen::Vector4d::Zero(), const std::string &meshTexturePath="")
Full constructor.
JointIndex parentJoint
Index of the parent joint.
std::string name
Name of the geometry object.
std::string meshPath
Absolute path to the mesh file (if the fcl pointee is also a Mesh)
Main pinocchio namespace.
SE3 placement
Position of geometry object in parent joint frame.
GeometryObject(const std::string &name, const JointIndex parent_joint, const CollisionGeometryPtr &collision_geometry, const SE3 &placement, const std::string &meshPath="", const Eigen::Vector3d &meshScale=Eigen::Vector3d::Ones(), const bool overrideMaterial=false, const Eigen::Vector4d &meshColor=Eigen::Vector4d::Zero(), const std::string &meshTexturePath="")
Reduced constructor.
Eigen::Vector4d meshColor
RGBA color value of the GeometryObject::fcl object.
FrameIndex parentFrame
Index of the parent frame.
PINOCCHIO_DEPRECATED CollisionGeometryPtr & fcl
The former pointer to the FCL CollisionGeometry.