5 #ifndef __pinocchio_multibody_fcl_hpp__
6 #define __pinocchio_multibody_fcl_hpp__
16 #include <boost/variant.hpp>
18 #ifdef PINOCCHIO_WITH_HPP_FCL
22 #if !(( defined(_MSC_VER) && _MSC_VER < 1900 ) || ( defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) ))
27 inline int _snprintf(
char* buffer, std::size_t buf_size,
const char* format, ...)
32 va_start(args, format);
33 res = vsnprintf(buffer, buf_size, format, args);
45 #include <hpp/fcl/shape/geometric_shapes.h>
58 #include <boost/foreach.hpp>
62 using std::shared_ptr;
63 using std::make_shared;
66 :
public std::pair<GeomIndex, GeomIndex>
69 typedef std::pair<GeomIndex, GeomIndex>
Base;
84 void disp (std::ostream & os)
const;
89 #ifndef PINOCCHIO_WITH_HPP_FCL
120 #endif // PINOCCHIO_WITH_HPP_FCL
162 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
184 PINOCCHIO_DEPRECATED CollisionGeometryPtr &
fcl;
232 const CollisionGeometryPtr & collision_geometry,
234 const std::string & meshPath =
"",
235 const Eigen::Vector3d &
meshScale = Eigen::Vector3d::Ones(),
237 const Eigen::Vector4d &
meshColor = Eigen::Vector4d(0,0,0,1),
238 const std::string & meshTexturePath =
"",
241 , parentFrame(parent_frame)
242 , parentJoint(parent_joint)
251 , meshTexturePath(meshTexturePath)
252 , disableCollision(false)
275 const CollisionGeometryPtr & collision_geometry,
277 const std::string & meshPath =
"",
278 const Eigen::Vector3d &
meshScale = Eigen::Vector3d::Ones(),
280 const Eigen::Vector4d &
meshColor = Eigen::Vector4d::Ones(),
281 const std::string & meshTexturePath =
"",
285 , parentJoint(parent_joint)
294 , meshTexturePath(meshTexturePath)
295 , disableCollision(false)
312 parentFrame = other.parentFrame;
313 parentJoint = other.parentJoint;
316 meshPath = other.meshPath;
321 meshTexturePath = other.meshTexturePath;
322 disableCollision = other.disableCollision;
329 #ifdef PINOCCHIO_WITH_HPP_FCL
331 struct ComputeCollision
334 typedef ::hpp::fcl::ComputeCollision
Base;
335 typedef shared_ptr<const fcl::CollisionGeometry> ConstCollisionGeometryPtr;
337 ComputeCollision(
const GeometryObject & o1,
const GeometryObject & o2)
343 virtual ~ComputeCollision() {};
346 ConstCollisionGeometryPtr o1;
347 ConstCollisionGeometryPtr o2;
349 virtual std::size_t
run(
const fcl::Transform3f& tf1,
const fcl::Transform3f& tf2,
350 const fcl::CollisionRequest& request, fcl::CollisionResult& result)
const
353 const_cast<Pointer&
>(Base::o1) = o1.get();
354 const_cast<Pointer&
>(Base::o2) = o2.get();
355 return Base::run(tf1, tf2, request, result);
359 struct ComputeDistance
362 typedef ::hpp::fcl::ComputeDistance
Base;
363 typedef shared_ptr<fcl::CollisionGeometry> ConstCollisionGeometryPtr;
365 ComputeDistance(
const GeometryObject & o1,
const GeometryObject & o2)
371 virtual ~ComputeDistance() {};
374 ConstCollisionGeometryPtr o1;
375 ConstCollisionGeometryPtr o2;
378 const fcl::DistanceRequest& request, fcl::DistanceResult& result)
const
381 const_cast<Pointer&
>(Base::o1) = o1.get();
382 const_cast<Pointer&
>(Base::o2) = o2.get();
383 return Base::run(tf1, tf2, request, result);
394 #include "pinocchio/multibody/fcl.hxx"
396 #endif // ifndef __pinocchio_multibody_fcl_hpp__