5 #ifndef __pinocchio_multibody_geometry_hpp__
6 #define __pinocchio_multibody_geometry_hpp__
8 #include "pinocchio/multibody/geometry-object.hpp"
9 #include "pinocchio/container/aligned-vector.hpp"
11 #include "pinocchio/serialization/serializable.hpp"
24 typedef std::pair<GeomIndex, GeomIndex> Base;
39 void disp(std::ostream & os)
const;
40 friend std::ostream & operator<<(std::ostream & os,
const CollisionPair & X);
47 typedef context::Scalar Scalar;
54 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
56 typedef context::Scalar Scalar;
59 Options = context::Options
65 typedef PINOCCHIO_ALIGNED_STD_VECTOR(
GeometryObject) GeometryObjectVector;
66 typedef std::vector<CollisionPair> CollisionPairVector;
67 typedef Eigen::Matrix<bool, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXb;
68 typedef Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXi;
70 typedef pinocchio::GeomIndex GeomIndex;
92 template<
typename S2,
int O2,
template<
typename,
int>
class _JointCollectionTpl>
208 return !(*
this == other);
211 friend std::ostream & operator<<(std::ostream & os,
const GeometryModel & model_geom);
230 typedef context::Scalar Scalar;
237 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
239 typedef context::Scalar Scalar;
242 Options = context::Options
246 typedef std::vector<GeomIndex> GeomIndexList;
247 typedef Eigen::Matrix<bool, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXb;
248 typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXs;
250 #ifdef PINOCCHIO_WITH_HPP_FCL
269 #ifdef PINOCCHIO_WITH_HPP_FCL
396 const GeometryModel & geom_model,
const MatrixXb & collision_map,
const bool upper =
true);
407 const GeometryModel & geom_model,
const GeomIndex geom_id,
bool enable_collision);
428 #ifdef PINOCCHIO_WITH_HPP_FCL
441 const MatrixXs & security_margin_map,
442 const bool upper =
true,
443 const bool sync_distance_upper_bound =
false);
447 friend std::ostream & operator<<(std::ostream & os,
const GeometryData & geomData);
455 #ifdef PINOCCHIO_WITH_HPP_FCL
470 return !(*
this == other);
480 #include "pinocchio/multibody/geometry.hxx"
Main pinocchio namespace.
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
Visit a LieGroupVariant to get the name of it.
CollisionPair()
Empty constructor.
CollisionPair(const GeomIndex co1, const GeomIndex co2)
Default constructor of a collision pair from two collision object indexes.
void deactivateCollisionPair(const PairIndex pair_id)
std::vector< fcl::CollisionRequest > collisionRequests
Defines what information should be computed by collision test. There is one request per pair of geome...
void setActiveCollisionPairs(const GeometryModel &geom_model, const MatrixXb &collision_map, const bool upper=true)
Set the collision pair association from a given input array. Each entry of the input matrix defines t...
void activateAllCollisionPairs()
Activate all collision pairs.
GeometryData()
Empty constructor.
PairIndex collisionPairIndex
Index of the collision pair.
GeometryData & operator=(const GeometryData &other)
Copy operator.
std::vector< Scalar > radius
Radius of the bodies, i.e. distance of the further point of the geometry model attached to the body f...
void activateCollisionPair(const PairIndex pair_id)
void deactivateAllCollisionPairs()
Deactivate all collision pairs.
void setSecurityMargins(const GeometryModel &geom_model, const MatrixXs &security_margin_map, const bool upper=true, const bool sync_distance_upper_bound=false)
Set the security margin of all the collision request in a row, according to the values stored in the ...
std::vector< fcl::DistanceResult > distanceResults
Vector gathering the result of the distance computation for all the collision pairs.
std::map< JointIndex, GeomIndexList > outerObjects
A list of associated collision GeometryObjects to a given joint Id.
std::vector< bool > activeCollisionPairs
Vector of collision pairs.
GeometryData(const GeometryData &other)
Copy constructor.
std::vector< fcl::CollisionResult > collisionResults
Vector gathering the result of the collision computation for all the collision pairs.
bool operator!=(const GeometryData &other) const
Returns true if *this and other are not equal.
PINOCCHIO_ALIGNED_STD_VECTOR(ComputeDistance) distance_functors
 
PINOCCHIO_ALIGNED_STD_VECTOR(SE3) oMg
Vector gathering the SE3 placements of the geometry objects relative to the world....
std::vector< fcl::DistanceRequest > distanceRequests
Defines what information should be computed by distance computation. There is one request per pair of...
bool operator==(const GeometryData &other) const
Returns true if *this and other are equal.
GeometryData(const GeometryModel &geom_model)
Default constructor from a GeometryModel.
~GeometryData()
Destructor.
void setGeometryCollisionStatus(const GeometryModel &geom_model, const GeomIndex geom_id, bool enable_collision)
Enable or disable collision for the given geometry given by its geometry id with all the other geomet...
PINOCCHIO_ALIGNED_STD_VECTOR(ComputeCollision) collision_functors
 
void fillInnerOuterObjectMaps(const GeometryModel &geomModel)
std::map< JointIndex, GeomIndexList > innerObjects
Map over vector GeomModel::geometryObjects, indexed by joints.
void setCollisionPairs(const MatrixXb &collision_map, const bool upper=true)
Set the collision pairs from a given input array. Each entry of the input matrix defines the activati...
GeomIndex addGeometryObject(const GeometryObject &object, const ModelTpl< S2, O2, _JointCollectionTpl > &model)
Add a geometry object to a GeometryModel and set its parent joint.
PairIndex findCollisionPair(const CollisionPair &pair) const
Return the index of a given collision pair in collisionPairs.
bool existCollisionPair(const CollisionPair &pair) const
Check if a collision pair exists in collisionPairs. See also findCollisitionPair(const CollisionPair ...
void removeAllCollisionPairs()
Remove all collision pairs from collisionPairs. Same as collisionPairs.clear().
void addCollisionPair(const CollisionPair &pair)
Add a collision pair into the vector of collision_pairs. The method check before if the given Collisi...
bool operator==(const GeometryModel &other) const
Returns true if *this and other are equal.
GeometryObjectVector geometryObjects
Vector of GeometryObjects used for collision computations.
GeomIndex getGeometryId(const std::string &name) const
Return the index of a GeometryObject given by its name.
bool existGeometryName(const std::string &name) const
Check if a GeometryObject given by its name exists.
MatrixXi collisionPairMapping
Matrix relating the collision pair ID to a pair of two GeometryObject indexes.
void addAllCollisionPairs()
Add all possible collision pairs.
void removeGeometryObject(const std::string &name)
Remove a GeometryObject.
Index ngeoms
The number of GeometryObjects.
GeometryModel clone() const
Create a deep copy of *this.
CollisionPairVector collisionPairs
Vector of collision pairs.
GeomIndex addGeometryObject(const GeometryObject &object)
Add a geometry object to a GeometryModel.
void removeCollisionPair(const CollisionPair &pair)
Remove if exists the CollisionPair from the vector collision_pairs.
bool operator!=(const GeometryModel &other) const
Returns true if *this and other are not equal.
Common traits structure to fully define base classes for CRTP.