|
pinocchio
2.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
|
|
5 #ifndef __pinocchio_multibody_geometry_hpp__
6 #define __pinocchio_multibody_geometry_hpp__
8 #include "pinocchio/multibody/fcl.hpp"
9 #include "pinocchio/multibody/fwd.hpp"
10 #include "pinocchio/container/aligned-vector.hpp"
12 #include "pinocchio/serialization/serializable.hpp"
24 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
26 typedef double Scalar;
32 typedef PINOCCHIO_ALIGNED_STD_VECTOR(
GeometryObject) GeometryObjectVector;
33 typedef std::vector<CollisionPair> CollisionPairVector;
34 typedef Eigen::Matrix<bool,Eigen::Dynamic,Eigen::Dynamic,Options> MatrixXb;
36 typedef pinocchio::GeomIndex GeomIndex;
55 template<
typename S2,
int O2,
template<
typename,
int>
class _JointCollectionTpl>
120 const bool upper =
true);
170 return !(*
this == other);
173 friend std::ostream& operator<<(std::ostream & os,
190 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
192 typedef double Scalar;
193 enum { Options = 0 };
196 typedef std::vector<GeomIndex> GeomIndexList;
197 typedef Eigen::Matrix<bool,Eigen::Dynamic,Eigen::Dynamic,Options> MatrixXb;
198 typedef Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic,Options> MatrixXs;
200 #ifdef PINOCCHIO_WITH_HPP_FCL
219 #ifdef PINOCCHIO_WITH_HPP_FCL
261 #endif // PINOCCHIO_WITH_HPP_FCL
344 const MatrixXb & collision_map,
345 const bool upper =
true);
355 const GeomIndex geom_id,
356 bool enable_collision);
376 #ifdef PINOCCHIO_WITH_HPP_FCL
385 const MatrixXs & security_margin_map,
386 const bool upper =
true);
387 #endif // ifdef PINOCCHIO_WITH_HPP_FCL
389 friend std::ostream & operator<<(std::ostream & os,
const GeometryData & geomData);
399 #ifdef PINOCCHIO_WITH_HPP_FCL
417 return !(*
this == other);
427 #include "pinocchio/multibody/geometry.hxx"
429 #endif // ifndef __pinocchio_multibody_geometry_hpp__
void fillInnerOuterObjectMaps(const GeometryModel &geomModel)
bool existCollisionPair(const CollisionPair &pair) const
Check if a collision pair exists in collisionPairs. See also findCollisitionPair(const CollisionPair ...
GeometryData & operator=(const GeometryData &other)
Copy operator.
void activateAllCollisionPairs()
Activate all collision pairs.
std::vector< fcl::DistanceRequest > distanceRequests
Defines what information should be computed by distance computation. There is one request per pair of...
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.
void deactivateCollisionPair(const PairIndex pair_id)
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
Visit a LieGroupVariant to get the name of it.
GeometryObjectVector geometryObjects
Vector of GeometryObjects used for collision computations.
std::vector< bool > activeCollisionPairs
Vector of collision pairs.
bool operator==(const GeometryModel &other) const
Returns true if *this and other are equal.
GeometryData()
Empty constructor.
void removeAllCollisionPairs()
Remove all collision pairs from collisionPairs. Same as collisionPairs.clear().
PairIndex findCollisionPair(const CollisionPair &pair) const
Return the index of a given collision pair in collisionPairs.
void setSecurityMargins(const GeometryModel &geom_model, const MatrixXs &security_margin_map, const bool upper=true)
Set the security margin of all the collision request in a row, according to the values stored in the ...
PairIndex collisionPairIndex
Index of the collision pair.
void addAllCollisionPairs()
Add all possible collision pairs.
void removeGeometryObject(const std::string &name)
Remove a GeometryObject.
Index ngeoms
The number of GeometryObjects.
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...
CollisionPairVector collisionPairs
Vector of collision pairs.
std::vector< fcl::DistanceResult > distanceResults
Vector gathering the result of the distance computation for all the collision pairs.
PINOCCHIO_ALIGNED_STD_VECTOR(SE3) oMg
Vector gathering the SE3 placements of the geometry objects relative to the world....
GeomIndex addGeometryObject(const GeometryObject &object, const ModelTpl< S2, O2, _JointCollectionTpl > &model)
Add a geometry object to a GeometryModel and set its parent joint.
std::vector< fcl::CollisionRequest > collisionRequests
Defines what information should be computed by collision test. There is one request per pair of geome...
void removeCollisionPair(const CollisionPair &pair)
Remove if exists the CollisionPair from the vector collision_pairs.
std::vector< Scalar > radius
Radius of the bodies, i.e. distance of the further point of the geometry model attached to the body f...
bool operator==(const GeometryData &other) const
Returns true if *this and other are equal.
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...
~GeometryData()
Destructor.
std::map< JointIndex, GeomIndexList > outerObjects
A list of associated collision GeometryObjects to a given joint Id.
void deactivateAllCollisionPairs()
Deactivate all collision pairs.
std::map< JointIndex, GeomIndexList > innerObjects
Map over vector GeomModel::geometryObjects, indexed by joints.
void addCollisionPair(const CollisionPair &pair)
Add a collision pair into the vector of collision_pairs. The method check before if the given Collisi...
std::vector< fcl::CollisionResult > collisionResults
Vector gathering the result of the collision computation for all the collision pairs.
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 activateCollisionPair(const PairIndex pair_id)
Main pinocchio namespace.
bool operator!=(const GeometryModel &other) const
Returns true if *this and other are not equal.
bool operator!=(const GeometryData &other) const
Returns true if *this and other are not equal.