Struct GeometryModel
Defined in File geometry.hpp
Struct Documentation
-
struct GeometryModel
Public Types
Values:
-
enumerator Options
-
enumerator Options
-
typedef ::pinocchio::GeometryObject GeometryObject
-
typedef std::vector<CollisionPair> CollisionPairVector
-
typedef Eigen::Matrix<bool, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXb
-
typedef pinocchio::GeomIndex GeomIndex
Public Functions
- typedef PINOCCHIO_ALIGNED_STD_VECTOR (GeometryObject) GeometryObjectVector
-
inline GeometryModel()
-
inline ~GeometryModel()
-
template<typename S2, int O2, template<typename, int> class _JointCollectionTpl>
GeomIndex addGeometryObject(const GeometryObject &object, const ModelTpl<S2, O2, _JointCollectionTpl> &model) Add a geometry object to a GeometryModel and set its parent joint.
Note
object is a nonconst copy to ease the insertion code.
- Parameters:
object – [in] Object
model – [in] Corresponding model, used to assert the attributes of object.
- Returns:
The index of the new added GeometryObject in geometryObjects
-
GeomIndex addGeometryObject(const GeometryObject &object)
Add a geometry object to a GeometryModel.
- Parameters:
object – [in] Object
- Returns:
The index of the new added GeometryObject in geometryObjects.
-
void removeGeometryObject(const std::string &name)
Remove a GeometryObject.
@node Remove also the collision pairs that contain the object.
- Parameters:
name – [in] Name of the GeometryObject
-
GeomIndex getGeometryId(const std::string &name) const
Return the index of a GeometryObject given by its name.
- Parameters:
name – [in] Name of the GeometryObject
- Returns:
Index of the corresponding GeometryObject
-
bool existGeometryName(const std::string &name) const
Check if a GeometryObject given by its name exists.
- Parameters:
name – [in] Name of the GeometryObject
- Returns:
True if the GeometryObject exists in the geometryObjects.
-
void addCollisionPair(const CollisionPair &pair)
Add a collision pair into the vector of collision_pairs. The method check before if the given CollisionPair is already included.
- Parameters:
pair – [in] The CollisionPair to add.
-
void addAllCollisionPairs()
Add all possible collision pairs.
Note
Collision pairs between geometries having the same parent joint are not added.
-
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 activation of a given collision pair (map[i,j] == true means that the pair (i,j) is active).
- Parameters:
collision_map – [in] Associative array.
upper – [in] Wheter the collision_map is an upper or lower triangular filled array.
-
void removeCollisionPair(const CollisionPair &pair)
Remove if exists the CollisionPair from the vector collision_pairs.
- Parameters:
pair – [in] The CollisionPair to remove.
-
void removeAllCollisionPairs()
Remove all collision pairs from collisionPairs. Same as collisionPairs.clear().
-
bool existCollisionPair(const CollisionPair &pair) const
Check if a collision pair exists in collisionPairs. See also findCollisitionPair(const CollisionPair & pair).
- Parameters:
pair – [in] The CollisionPair.
- Returns:
True if the CollisionPair exists, false otherwise.
-
PairIndex findCollisionPair(const CollisionPair &pair) const
Return the index of a given collision pair in collisionPairs.
- Parameters:
pair – [in] The CollisionPair.
- Returns:
The index of the CollisionPair in collisionPairs.
-
inline bool operator==(const GeometryModel &other) const
Returns true if *this and other are equal.
-
inline bool operator!=(const GeometryModel &other) const
Returns true if *this and other are not equal.
Public Members
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef double Scalar
-
Index ngeoms
The number of GeometryObjects.
-
GeometryObjectVector geometryObjects
Vector of GeometryObjects used for collision computations.
-
CollisionPairVector collisionPairs
Vector of collision pairs.
Friends
-
friend std::ostream &operator<<(std::ostream &os, const GeometryModel &model_geom)