|
Biorbd Release_1.13.0
|
#include <Contacts.h>
Public Member Functions | |
| Contacts () | |
| Construct contacts. | |
| Contacts | DeepCopy () const |
| Deep copy of contacts. | |
| void | DeepCopy (const Contacts &other) |
| Deep copy of contacts. | |
| size_t | AddConstraint (size_t bodyId, const utils::Vector3d &bodyPoint, const utils::Vector3d &worldNormal, const utils::String &name, const utils::String &parentName) |
| Add a constraint to the constraint set. | |
| size_t | AddConstraint (size_t bodyId, const utils::Vector3d &bodyPoint, const utils::String &axis, const utils::String &name, const utils::String &parentName) |
| Add a constraint to the constraint set. | |
| size_t | AddLoopConstraint (size_t body_id_predecessor, size_t body_id_successor, const utils::RotoTrans &X_predecessor, const utils::RotoTrans &X_successor, const utils::SpatialVector &axis, const utils::String &name, bool enableStabilization=false, double stabilizationParam=0.1) |
| Add a loop constraint to the constraint set. | |
| std::vector< utils::SpatialVector > | calcLoopConstraintForces (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedTorque &Tau) |
| compute the forces generated from loop constraints | |
| std::vector< utils::SpatialVector > | calcLoopConstraintForces (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedTorque &Tau, rigidbody::ExternalForceSet &externalForces) |
| compute the forces generated from loop constraints | |
| virtual | ~Contacts () |
| Destroy the class properly. | |
| Contacts & | getConstraints () |
| Get constraints. | |
| bool | hasContacts () const |
| Check if there are contacts. | |
| bool | hasLoopConstraints () const |
| Check if there are loop constraints. | |
| size_t | nbContacts () const |
| Return the number of contacts. | |
| size_t | nbLoopConstraints () const |
| Return the number of loop constraints. | |
| std::vector< utils::String > | contactNames () |
| Return the name of the all contacts. | |
| utils::String | contactName (size_t i) |
| Return the name of the contact of a specified axis. | |
| size_t | contactRbdlId (const utils::String &name) |
| Return the index of the contact corresponding to the given name. | |
| std::vector< utils::Vector3d > | constraintsInGlobal (const GeneralizedCoordinates &Q, bool updateKin) |
| Return the constraints position in the global reference. | |
| utils::Vector | getForce () const |
| Return the force acting on the constraint. | |
| int | contactSegmentBiorbdId (int idx) const |
| Return the segment idx of the contact in biorbd formalism. | |
| std::vector< size_t > | segmentRigidContactIdx (int segment_idx) const |
| Return the index of rigid contacts for a specified segment index. | |
| int | nbRigidContacts () const |
| Returns the number of rigid contacts (ignoring the loop constraints). | |
| const std::vector< NodeSegment > & | rigidContacts () const |
| Returns all the rigid contacts as declared in the model. | |
| const NodeSegment & | rigidContact (size_t idx) const |
| Returns the rigid contact idx as declared in the model. | |
| utils::Vector3d | rigidContact (const GeneralizedCoordinates &Q, size_t idx, bool updateKin) |
| Return the rigidContact position in the global reference. | |
| std::vector< utils::Vector3d > | rigidContacts (const GeneralizedCoordinates &Q, bool updateKin) |
| Return all the rigidContacts position in the global reference. | |
| utils::Vector3d | rigidContactVelocity (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, size_t idx, bool updateKin=true) |
| Return the velocity of the chosen contact. | |
| std::vector< utils::Vector3d > | rigidContactsVelocity (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, bool updateKin=true) |
| Return the velocities of all the contacts. | |
| utils::Vector3d | rigidContactAcceleration (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedAcceleration &dQdot, size_t idx, bool updateKin=true) |
| Return the acceleration of the chosen contact. | |
| std::vector< utils::Vector3d > | rigidContactsAcceleration (const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedAcceleration &dQdot, bool updateKin=true) |
| Return the acceleration of all the contacts. | |
| utils::Matrix | rigidContactJacobian (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, size_t idx) |
| Compute the Jacobian of a single rigid contact. | |
| utils::Matrix | rigidContactJacobian (const rigidbody::GeneralizedCoordinates &Q, size_t idx, bool updateKin=true) |
| Compute the Jacobian of a single rigid contact. | |
| std::vector< utils::Matrix > | rigidContactsJacobian (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q) |
| Compute the Jacobians of all rigid contacts. | |
| std::vector< utils::Matrix > | rigidContactsJacobian (const rigidbody::GeneralizedCoordinates &Q, bool updateKin=true) |
| Compute the Jacobians of all rigid contacts. | |
Protected Member Functions | |
| utils::String | swapAxes (const utils::String &axesToSwap) const |
| Swap the status of the axes provided, that is adding x, y or z if it is not there and remove them otherwise. This effectively transform an allowed axes set to a axes to remove set, or vice versa. | |
Static Protected Member Functions | |
| static utils::Matrix | projectContactJacobian (const utils::Matrix &J, const rigidbody::NodeSegment &contact) |
| Project a 3D point Jacobian onto active contact axes. | |
Protected Attributes | |
| std::shared_ptr< size_t > | m_nbreConstraint |
| Number of constraints. | |
| std::shared_ptr< bool > | m_isBinded |
| If the model is ready. | |
| std::shared_ptr< std::vector< rigidbody::NodeSegment > > | m_rigidContacts |
| std::shared_ptr< size_t > | m_nbLoopConstraint |
| Number of constraints. | |
Class Contacts.
Definition at line 36 of file Contacts.h.
| rigidbody::Contacts::Contacts | ( | ) |
Construct contacts.
Definition at line 25 of file Contacts.cpp.
|
virtual |
Destroy the class properly.
Definition at line 225 of file Contacts.cpp.
| size_t rigidbody::Contacts::AddConstraint | ( | size_t | bodyId, |
| const utils::Vector3d & | bodyPoint, | ||
| const utils::String & | axis, | ||
| const utils::String & | name, | ||
| const utils::String & | parentName ) |
Add a constraint to the constraint set.
| bodyId | The body which is affected directly by the constraint |
| bodyPoint | The point that is constrained relative to the contact body |
| axis | The axis along which the constraint acts |
| name | A human readable name |
| parentName | A human readable name of the parent (should correspond to the body_id) |
Definition at line 93 of file Contacts.cpp.
| size_t rigidbody::Contacts::AddConstraint | ( | size_t | bodyId, |
| const utils::Vector3d & | bodyPoint, | ||
| const utils::Vector3d & | worldNormal, | ||
| const utils::String & | name, | ||
| const utils::String & | parentName ) |
Add a constraint to the constraint set.
| bodyId | The body which is affected directly by the constraint |
| bodyPoint | The point that is constrained relative to the contact body |
| worldNormal | The normal along the constraint acts (in base coordinates) |
| name | A human readable name |
| parentName | A human readable name of the parent (should correspond to the body_id) |
Definition at line 46 of file Contacts.cpp.
| size_t rigidbody::Contacts::AddLoopConstraint | ( | size_t | body_id_predecessor, |
| size_t | body_id_successor, | ||
| const utils::RotoTrans & | X_predecessor, | ||
| const utils::RotoTrans & | X_successor, | ||
| const utils::SpatialVector & | axis, | ||
| const utils::String & | name, | ||
| bool | enableStabilization = false, | ||
| double | stabilizationParam = 0.1 ) |
Add a loop constraint to the constraint set.
| body_id_predecessor | The identifier of the predecessor body |
| body_id_successor | The identifier of the successor body |
| X_predecessor | A spatial transform localizing the constrained frames on the predecessor body, expressed with respect to the predecessor body frame |
| X_successor | A spatial transform localizing the constrained frames on the successor body, expressed with respect to the successor body frame |
| axis | A spatial vector indicating the axis along which the constraint acts |
| name | A human readable name |
| enableStabilization | Whether stabilization should be enabled or not |
| stabilizationParam | The value used for stabilization |
Definition at line 139 of file Contacts.cpp.
| std::vector< utils::SpatialVector > rigidbody::Contacts::calcLoopConstraintForces | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| const rigidbody::GeneralizedTorque & | Tau ) |
compute the forces generated from loop constraints
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| Tau | The generalized torques |
Definition at line 163 of file Contacts.cpp.
| std::vector< utils::SpatialVector > rigidbody::Contacts::calcLoopConstraintForces | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| const rigidbody::GeneralizedTorque & | Tau, | ||
| rigidbody::ExternalForceSet & | externalForces ) |
compute the forces generated from loop constraints
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| Tau | The generalized torques |
| externalForces | the external forces |
Definition at line 171 of file Contacts.cpp.
| std::vector< utils::Vector3d > rigidbody::Contacts::constraintsInGlobal | ( | const GeneralizedCoordinates & | Q, |
| bool | updateKin ) |
Return the constraints position in the global reference.
| Q | The generalized coordinates of the joints |
| updateKin | Whether the kinematics of the model should be updated from Q |
Definition at line 284 of file Contacts.cpp.
| utils::String rigidbody::Contacts::contactName | ( | size_t | i | ) |
Return the name of the contact of a specified axis.
| i | The axis |
Definition at line 267 of file Contacts.cpp.
| std::vector< utils::String > rigidbody::Contacts::contactNames | ( | ) |
Return the name of the all contacts.
Definition at line 259 of file Contacts.cpp.
| size_t BIORBD_NAMESPACE::rigidbody::Contacts::contactRbdlId | ( | const utils::String & | name | ) |
Return the index of the contact corresponding to the given name.
| name | The name of the contact |
| std::runtime_error | if the contact does not exist |
Definition at line 273 of file Contacts.cpp.
| int rigidbody::Contacts::contactSegmentBiorbdId | ( | int | idx | ) | const |
Return the segment idx of the contact in biorbd formalism.
| idx | The index of the contact |
Definition at line 497 of file Contacts.cpp.
| rigidbody::Contacts rigidbody::Contacts::DeepCopy | ( | ) | const |
| void rigidbody::Contacts::DeepCopy | ( | const Contacts & | other | ) |
Deep copy of contacts.
| other | The contacts to copy |
Definition at line 38 of file Contacts.cpp.
| rigidbody::Contacts & rigidbody::Contacts::getConstraints | ( | ) |
| utils::Vector rigidbody::Contacts::getForce | ( | ) | const |
Return the force acting on the constraint.
Definition at line 478 of file Contacts.cpp.
| bool rigidbody::Contacts::hasContacts | ( | ) | const |
Check if there are contacts.
Definition at line 237 of file Contacts.cpp.
| bool rigidbody::Contacts::hasLoopConstraints | ( | ) | const |
Check if there are loop constraints.
Definition at line 245 of file Contacts.cpp.
| size_t rigidbody::Contacts::nbContacts | ( | ) | const |
Return the number of contacts.
Definition at line 253 of file Contacts.cpp.
| size_t rigidbody::Contacts::nbLoopConstraints | ( | ) | const |
Return the number of loop constraints.
Definition at line 255 of file Contacts.cpp.
| int rigidbody::Contacts::nbRigidContacts | ( | ) | const |
Returns the number of rigid contacts (ignoring the loop constraints).
Definition at line 493 of file Contacts.cpp.
|
staticprotected |
Project a 3D point Jacobian onto active contact axes.
| J | The full 3xN Jacobian of the contact point |
| contact | The rigid contact definition (provides active axes) |
Definition at line 400 of file Contacts.cpp.
| utils::Vector3d rigidbody::Contacts::rigidContact | ( | const GeneralizedCoordinates & | Q, |
| size_t | idx, | ||
| bool | updateKin ) |
Return the rigidContact position in the global reference.
| Q | The generalized coordinates of the joints |
| idx | The index of the contact |
| updateKin | Whether the kinematics of the model should be updated from Q |
Definition at line 305 of file Contacts.cpp.
| const rigidbody::NodeSegment & rigidbody::Contacts::rigidContact | ( | size_t | idx | ) | const |
Returns the rigid contact idx as declared in the model.
| idx | The index of the contact |
Definition at line 487 of file Contacts.cpp.
| utils::Vector3d rigidbody::Contacts::rigidContactAcceleration | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| const rigidbody::GeneralizedAcceleration & | dQdot, | ||
| size_t | idx, | ||
| bool | updateKin = true ) |
Return the acceleration of the chosen contact.
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| dQdot | The generalized accelerations |
| idx | The index of the contact |
| updateKin | If the model should be updated |
Definition at line 366 of file Contacts.cpp.
| utils::Matrix rigidbody::Contacts::rigidContactJacobian | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| size_t | idx, | ||
| bool | updateKin = true ) |
Compute the Jacobian of a single rigid contact.
| Q | The generalized coordinates |
| idx | Index of the rigid contact |
| updateKin | If true, update kinematics before computation |
Definition at line 434 of file Contacts.cpp.
| utils::Matrix rigidbody::Contacts::rigidContactJacobian | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| size_t | idx ) |
Compute the Jacobian of a single rigid contact.
| updatedModel | The kinematic model with updated state |
| Q | The generalized coordinates |
| idx | Index of the rigid contact |
Definition at line 422 of file Contacts.cpp.
| const std::vector< rigidbody::NodeSegment > & rigidbody::Contacts::rigidContacts | ( | ) | const |
Returns all the rigid contacts as declared in the model.
Definition at line 482 of file Contacts.cpp.
| std::vector< utils::Vector3d > rigidbody::Contacts::rigidContacts | ( | const GeneralizedCoordinates & | Q, |
| bool | updateKin ) |
Return all the rigidContacts position in the global reference.
| Q | The generalized coordinates of the joints |
| updateKin | Whether the kinematics of the model should be updated from Q |
Definition at line 317 of file Contacts.cpp.
| std::vector< utils::Vector3d > rigidbody::Contacts::rigidContactsAcceleration | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| const rigidbody::GeneralizedAcceleration & | dQdot, | ||
| bool | updateKin = true ) |
Return the acceleration of all the contacts.
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| dQdot | The generalized accelerations |
| updateKin | If the model should be updated |
Definition at line 381 of file Contacts.cpp.
| std::vector< utils::Matrix > rigidbody::Contacts::rigidContactsJacobian | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| bool | updateKin = true ) |
Compute the Jacobians of all rigid contacts.
| Q | The generalized coordinates |
| updateKin | If true, update kinematics before computation |
Definition at line 450 of file Contacts.cpp.
| std::vector< utils::Matrix > rigidbody::Contacts::rigidContactsJacobian | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q ) |
Compute the Jacobians of all rigid contacts.
| updatedModel | The kinematic model with updated state |
| Q | The generalized coordinates |
Definition at line 465 of file Contacts.cpp.
| std::vector< utils::Vector3d > rigidbody::Contacts::rigidContactsVelocity | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| bool | updateKin = true ) |
Return the velocities of all the contacts.
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| updateKin | If the model should be updated |
Definition at line 349 of file Contacts.cpp.
| utils::Vector3d rigidbody::Contacts::rigidContactVelocity | ( | const rigidbody::GeneralizedCoordinates & | Q, |
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| size_t | idx, | ||
| bool | updateKin = true ) |
Return the velocity of the chosen contact.
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| idx | The index of the contact |
| updateKin | If the model should be updated |
Definition at line 336 of file Contacts.cpp.
| std::vector< size_t > rigidbody::Contacts::segmentRigidContactIdx | ( | int | segment_idx | ) | const |
Return the index of rigid contacts for a specified segment index.
| segment_idx | The index of the segment |
Definition at line 510 of file Contacts.cpp.
|
protected |
Swap the status of the axes provided, that is adding x, y or z if it is not there and remove them otherwise. This effectively transform an allowed axes set to a axes to remove set, or vice versa.
| axesToSwap | a vector of up to three values (being "x", "y" or "z") |
Definition at line 525 of file Contacts.cpp.
|
protected |
If the model is ready.
Definition at line 391 of file Contacts.h.
|
protected |
Number of constraints.
Definition at line 395 of file Contacts.h.
|
protected |
Number of constraints.
Definition at line 390 of file Contacts.h.
|
protected |
The rigid contacts declared in the model (copy of RBDL information)
Definition at line 393 of file Contacts.h.