|
Biorbd Release_1.13.0
|
An External force set that can apply forces to the model while computing the dynamics. More...
#include <ExternalForceSet.h>
Classes | |
| class | LocalForcesInternal |
| This is an internal structure holding the information for the local forces. RotoTransNodes could have suffised, but we need to have a structure that was holding the spatial vector as well. More... | |
Public Member Functions | |
| ExternalForceSet (Model &model, bool useTranslationalForces=true, bool useSoftContacts=true) | |
| Construct ExternalForceSet. | |
| ~ExternalForceSet () | |
| Delete the set and free the ressources. | |
| void | add (const utils::String &segmentName, const utils::SpatialVector &vector) |
| Apply a new value to the specified spatial vector of the Set. WARNING: This vector is expected to be acting on segmentName, applied at origin and expressed in the global reference frame. method offered by ExternalForceSet below. | |
| void | add (const utils::String &segmentName, const utils::SpatialVector &vector, const utils::Vector3d &pointOfApplication) |
| Apply a new value to the specified spatial vector of the Set. WARNING: This vector is expected to be acting on segmentName, applied at pointOfApplication and expressed in the global reference frame. | |
| void | addInSegmentReferenceFrame (const utils::String &segmentName, const utils::SpatialVector &vector, const utils::Vector3d &pointOfApplication) |
| Apply a new value to the specified spatial vector of the Set. WARNING: This vector is expected to be acting on segmentName, applied at pointOfApplication and expressed in the segment reference frame. | |
| void | addTranslationalForce (const utils::Vector3d &forceInGlobal, const utils::String &segmentName, const utils::Vector3d &pointOfApplicationInLocal) |
| Add a pure force at a specific point on the kinematic chain. | |
| void | addTranslationalForce (const utils::Vector3d &force, const rigidbody::NodeSegment &pointOfApplication) |
| Add a pure force at a specific point on the kinematic chain. | |
| void | setZero () |
| Initialize and zero out all the spatial vectors of the Set. Note this should always be called before reusing an ExternalForceSet unless one is absolutely sure that all the spatial vectors of the Set is in an expected state (that is, all the vectors were either set or zeroed). | |
| std::vector< RigidBodyDynamics::Math::SpatialVector > | computeRbdlSpatialVectors (rigidbody::Joints &updatedModel) |
| The forces in a rbdl compatible format. This won't work if useTranslationalForces or useSoftContacts is set to true. | |
| std::vector< RigidBodyDynamics::Math::SpatialVector > | computeRbdlSpatialVectors (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q) |
| The forces in a rbdl compatible format. This won't work if useSoftContacts is set to true. | |
| std::vector< RigidBodyDynamics::Math::SpatialVector > | computeRbdlSpatialVectors (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot) |
| The forces in a rbdl compatible format. | |
| std::vector< utils::SpatialVector > | computeSpatialVectors (rigidbody::Joints &updatedModel) |
| The forces in a rbdl compatible format. This won't work if useTranslationalForces or useSoftContacts is set to true. | |
| std::vector< utils::SpatialVector > | computeSpatialVectors (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q) |
| The forces in a rbdl compatible format. This won't work if useSoftContacts is set to true. | |
| std::vector< utils::SpatialVector > | computeSpatialVectors (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot) |
| The forces in a rbdl compatible format. | |
| bool | hasExternalForceInLocalReferenceFrame () const |
| Return if there is at least one external force expressed in the local reference frame. This is important since having this forces to send Q when computing the force in global reference frame. | |
Protected Member Functions | |
| void | combineLocalReferenceFrameForces (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, std::vector< utils::SpatialVector > &out) |
| Add the forces expressed in the local reference to the internal Set. | |
| void | combineTranslationalForces (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, std::vector< utils::SpatialVector > &out) const |
| Add the translational forces to the internal Set. | |
| void | combineSoftContactForces (rigidbody::Joints &updatedModel, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, std::vector< utils::SpatialVector > &out) const |
| Add the soft contact forces to the internal Set. | |
| utils::SpatialVector | transportForceAtOrigin (const utils::Vector3d &force, const rigidbody::NodeSegment &pointOfApplication) const |
| Get the rigid contacts in a list of spatial vector of dimension 6xNdof. | |
| utils::SpatialVector | transportAtOrigin (const utils::SpatialVector &v, const rigidbody::NodeSegment &pointOfApplication) const |
| Get the rigid contacts in a list of spatial vector of dimension 6xNdof. | |
Protected Attributes | |
| Model & | m_model |
| A reference to the kinematic model. | |
| bool | m_useTranslationalForces |
| If translational forces should be included. | |
| bool | m_useSoftContacts |
| If soft contacts should be included. | |
| std::vector< utils::SpatialVector > | m_externalForces |
| The vector that holds all the external forces. | |
| LocalForcesInternal | m_externalForcesInLocal |
| std::vector< std::pair< utils::Vector3d, rigidbody::NodeSegment > > | m_translationalForces |
An External force set that can apply forces to the model while computing the dynamics.
Definition at line 31 of file ExternalForceSet.h.
| rigidbody::ExternalForceSet::ExternalForceSet | ( | Model & | model, |
| bool | useTranslationalForces = true, | ||
| bool | useSoftContacts = true ) |
Construct ExternalForceSet.
| model | The model onto which the external forces will be applied on. This is used in conjunction with segmentName (when using set) to determine at which index the set vector is positioned in the internal Set. |
| useTranslationalForces | If this force set has external forces |
| useSoftContacts | If this force set has soft contacts |
Definition at line 22 of file ExternalForceSet.cpp.
| rigidbody::ExternalForceSet::~ExternalForceSet | ( | ) |
Delete the set and free the ressources.
Definition at line 37 of file ExternalForceSet.cpp.
| void rigidbody::ExternalForceSet::add | ( | const utils::String & | segmentName, |
| const utils::SpatialVector & | vector ) |
Apply a new value to the specified spatial vector of the Set. WARNING: This vector is expected to be acting on segmentName, applied at origin and expressed in the global reference frame. method offered by ExternalForceSet below.
| segmentName | The name of the segment to apply the spatial vector on. |
| vector | The SpatialVector to add to the set. |
Definition at line 39 of file ExternalForceSet.cpp.
| void rigidbody::ExternalForceSet::add | ( | const utils::String & | segmentName, |
| const utils::SpatialVector & | vector, | ||
| const utils::Vector3d & | pointOfApplication ) |
Apply a new value to the specified spatial vector of the Set. WARNING: This vector is expected to be acting on segmentName, applied at pointOfApplication and expressed in the global reference frame.
| segmentName | The name of the segment to apply the spatial vector on. |
| vector | The SpatialVector to add to the set. |
| pointOfApplication | Where the v vector is currenlty applied. |
Definition at line 49 of file ExternalForceSet.cpp.
| void rigidbody::ExternalForceSet::addInSegmentReferenceFrame | ( | const utils::String & | segmentName, |
| const utils::SpatialVector & | vector, | ||
| const utils::Vector3d & | pointOfApplication ) |
Apply a new value to the specified spatial vector of the Set. WARNING: This vector is expected to be acting on segmentName, applied at pointOfApplication and expressed in the segment reference frame.
| segmentName | The name of the segment to apply the spatial vector on. |
| vector | The SpatialVector to add to the set. |
| pointOfApplication | Where the v vector is currenlty applied in the segment reference frame. |
Definition at line 60 of file ExternalForceSet.cpp.
| void rigidbody::ExternalForceSet::addTranslationalForce | ( | const utils::Vector3d & | force, |
| const rigidbody::NodeSegment & | pointOfApplication ) |
Add a pure force at a specific point on the kinematic chain.
| force | The pure forces to apply on the body |
| pointOfApplication | The position of the force in reference frame of the node. Note that the [parentName] of must have been set |
Definition at line 82 of file ExternalForceSet.cpp.
| void rigidbody::ExternalForceSet::addTranslationalForce | ( | const utils::Vector3d & | forceInGlobal, |
| const utils::String & | segmentName, | ||
| const utils::Vector3d & | pointOfApplicationInLocal ) |
Add a pure force at a specific point on the kinematic chain.
| forceInGlobal | The pure forces to apply on the body |
| segmentName | The name of the segment the force is applied on |
| pointOfApplicationInLocal | The position in the reference frame of [segmentName] |
Definition at line 72 of file ExternalForceSet.cpp.
|
protected |
Add the forces expressed in the local reference to the internal Set.
| updatedModel | The joint model that with its kinematics updated |
| Q | The Generalized coordinates. |
| out | The vector of SpatialVector to fill |
Note: as this is an internal method, even though Q is passed, it is assumed update kinematics was already done.
Definition at line 214 of file ExternalForceSet.cpp.
|
protected |
Add the soft contact forces to the internal Set.
| updatedModel | The joint model that with its kinematics updated |
| Q | The Generalized coordinates. |
| Qdot | The Generalized velocity. |
| out | The vector of SpatialVector to fill |
Note: as this is an internal method, even though Q is passed, it is assumed update kinematics was already done.
Definition at line 302 of file ExternalForceSet.cpp.
|
protected |
Add the translational forces to the internal Set.
| updatedModel | The joint model that with its kinematics updated |
| Q | The Generalized coordinates. |
| out | The vector of SpatialVector to fill |
Note: as this is an internal method, even though Q is passed, it is assumed update kinematics was already done.
Definition at line 268 of file ExternalForceSet.cpp.
| std::vector< RigidBodyDynamics::Math::SpatialVector > rigidbody::ExternalForceSet::computeRbdlSpatialVectors | ( | rigidbody::Joints & | updatedModel | ) |
The forces in a rbdl compatible format. This won't work if useTranslationalForces or useSoftContacts is set to true.
| updatedModel | The joint model that with its kinematics updated |
Definition at line 93 of file ExternalForceSet.cpp.
| std::vector< RigidBodyDynamics::Math::SpatialVector > rigidbody::ExternalForceSet::computeRbdlSpatialVectors | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q ) |
The forces in a rbdl compatible format. This won't work if useSoftContacts is set to true.
| updatedModel | The joint model that with its kinematics updated |
| Q | The generalized coordinates |
Definition at line 114 of file ExternalForceSet.cpp.
| std::vector< RigidBodyDynamics::Math::SpatialVector > rigidbody::ExternalForceSet::computeRbdlSpatialVectors | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot ) |
The forces in a rbdl compatible format.
| updatedModel | The joint model that with its kinematics updated |
| Q | The generalized coordinates |
| Qdot | The generalized velocity |
Definition at line 125 of file ExternalForceSet.cpp.
| std::vector< utils::SpatialVector > rigidbody::ExternalForceSet::computeSpatialVectors | ( | rigidbody::Joints & | updatedModel | ) |
The forces in a rbdl compatible format. This won't work if useTranslationalForces or useSoftContacts is set to true.
| updatedModel | The joint model that with its kinematics updated |
Definition at line 139 of file ExternalForceSet.cpp.
| std::vector< utils::SpatialVector > rigidbody::ExternalForceSet::computeSpatialVectors | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q ) |
The forces in a rbdl compatible format. This won't work if useSoftContacts is set to true.
| updatedModel | The joint model that with its kinematics updated |
| Q | The generalized coordinates |
Definition at line 160 of file ExternalForceSet.cpp.
| std::vector< utils::SpatialVector > rigidbody::ExternalForceSet::computeSpatialVectors | ( | rigidbody::Joints & | updatedModel, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot ) |
The forces in a rbdl compatible format.
| updatedModel | The joint model that with its kinematics updated |
| Q | The generalized coordinates |
| Qdot | The generalized velocity |
Definition at line 171 of file ExternalForceSet.cpp.
| bool rigidbody::ExternalForceSet::hasExternalForceInLocalReferenceFrame | ( | ) | const |
Return if there is at least one external force expressed in the local reference frame. This is important since having this forces to send Q when computing the force in global reference frame.
Definition at line 188 of file ExternalForceSet.cpp.
| void rigidbody::ExternalForceSet::setZero | ( | ) |
Initialize and zero out all the spatial vectors of the Set. Note this should always be called before reusing an ExternalForceSet unless one is absolutely sure that all the spatial vectors of the Set is in an expected state (that is, all the vectors were either set or zeroed).
Definition at line 193 of file ExternalForceSet.cpp.
|
protected |
Get the rigid contacts in a list of spatial vector of dimension 6xNdof.
| v | The spatial vector to transport |
| pointOfApplication | The position where the force is applied in base coordinate |
Definition at line 344 of file ExternalForceSet.cpp.
|
protected |
Get the rigid contacts in a list of spatial vector of dimension 6xNdof.
| force | The force amplitude applied at the point |
| pointOfApplication | The position where the force is applied in base coordinate |
Definition at line 322 of file ExternalForceSet.cpp.
|
protected |
The vector that holds all the external forces.
Definition at line 323 of file ExternalForceSet.h.
|
protected |
The vector that holds all the external forces that are expressed in local reference frame (must call Q).
Definition at line 326 of file ExternalForceSet.h.
|
protected |
A reference to the kinematic model.
Definition at line 317 of file ExternalForceSet.h.
|
protected |
The translational forces. The first is the amplitude and the second is the application point (that include the name of the parentSegment it is applied on)
Definition at line 331 of file ExternalForceSet.h.
|
protected |
If soft contacts should be included.
Definition at line 320 of file ExternalForceSet.h.
|
protected |
If translational forces should be included.
Definition at line 319 of file ExternalForceSet.h.