Commit 71a06d4d authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Add CollisionObject::geometry and prepare deprecation of GeometryModel.colisionObjects

parent 66a7c64e
......@@ -62,6 +62,9 @@ namespace hpp {
/// Access to pinocchio object
const GeometryObject & pinocchio () const;
GeometryObject & pinocchio ();
/// Access to fcl object
CollisionGeometryPtr_t geometry () const;
/// Access to fcl object
FclConstCollisionObjectPtr_t fcl (const GeomData& data) const;
......@@ -90,7 +93,7 @@ namespace hpp {
/// manually moved, this will return the non-update transform.
/// \note If object is not attached to a joint, use move() to update
/// transform between hpp and fcl.
const fcl::Transform3f& getFclTransform () const;
fcl::Transform3f getFclTransform () const;
const Transform3f& getTransform () const;
const Transform3f& getTransform (DeviceData& d) const;
......
......@@ -96,6 +96,8 @@ namespace hpp {
typedef boost::shared_ptr<Body> BodyPtr_t;
typedef boost::shared_ptr<const Body> BodyConstPtr_t;
//typedef std::vector<BodyPtr_t> BodyVector_t;
typedef fcl::CollisionGeometry CollisionGeometry;
typedef boost::shared_ptr<CollisionGeometry> CollisionGeometryPtr_t;
typedef fcl::CollisionObject FclCollisionObject;
typedef fcl::CollisionObject * FclCollisionObjectPtr_t;
typedef const fcl::CollisionObject * FclConstCollisionObjectPtr_t;
......
......@@ -21,6 +21,7 @@
#include <pinocchio/multibody/model.hpp>
#include <pinocchio/multibody/geometry.hpp>
#include <pinocchio/spatial/fcl-pinocchio-conversions.hpp>
#include <hpp/pinocchio/device.hh>
#include <hpp/pinocchio/joint.hh>
......@@ -63,6 +64,9 @@ namespace hpp {
::pinocchio::GeometryObject & CollisionObject::pinocchio ()
{ return geomModel_->geometryObjects[geomInModelIndex]; }
CollisionGeometryPtr_t CollisionObject::geometry () const
{ return pinocchio().geometry; }
FclCollisionObjectPtr_t CollisionObject::fcl (GeomData& geomData) const
{
return & geomData.collisionObjects[geomInModelIndex];
......@@ -102,8 +106,8 @@ namespace hpp {
const Transform3f& CollisionObject::
positionInJointFrame () const { return pinocchio().placement; }
const fcl::Transform3f& CollisionObject::getFclTransform () const
{ return geomData().collisionObjects[geomInModelIndex].getTransform(); }
fcl::Transform3f CollisionObject::getFclTransform () const
{ return ::pinocchio::toFclTransform3f(geomData().oMg[geomInModelIndex]); }
const Transform3f& CollisionObject::getTransform () const
{ return geomData().oMg[geomInModelIndex]; }
const Transform3f& CollisionObject::getTransform (DeviceData& d) const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment