Robot Dynamics Library
|
Functions | |
void | RobotDynamics::HydroUtils::calcCenterOfBuoyancy (Model &model, const Math::VectorNd &q, Math::FramePoint &com, bool update_kinematics=true) |
Computes the Center of Buoyancy (COB) position. More... | |
void | RobotDynamics::HydroUtils::calcCenterOfMassAndCenterOfBuoyancy (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::Vector3d &com, Math::Vector3d &cob, Math::Vector3d &com_velocity, bool update_kinematics) |
Math::SpatialForce | RobotDynamics::HydroUtils::calcBuoyancyWrenchOnCenterOfMass (Model &model, const Math::VectorNd &q, bool update_kinematics=true) |
Computes the wrench due to buoyancy experienced at the robots center of mass. More... | |
Math::SpatialForce | RobotDynamics::HydroUtils::calcDragWrenchOnCenterOfMass (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, bool update_kinematics=true) |
Computes the wrench due to drag experienced at the robots center of mass. More... | |
double | RobotDynamics::HydroUtils::calcSubtreeVolume (Model &model, const unsigned int bodyId) |
Calculates the total volume of the model. More... | |
double | RobotDynamics::HydroUtils::calcSubtreeWeightInFluid (Model &model, const unsigned int bodyId) |
Calculate the weight of a kinematic subtree in fluid with density RobotDynamics::Model::fluid_density. More... | |
string | RobotDynamics::Utils::getDofName (const Math::SpatialVector &joint_dof) |
get string abbreviation for dof name from spatial vector. More... | |
string | RobotDynamics::Utils::getBodyName (const RobotDynamics::Model &model, unsigned int body_id) |
get body name, returns empty string if bodyid is virtual and has multiple child bodies More... | |
std::string | RobotDynamics::Utils::getModelHierarchy (const Model &model) |
Creates a human readable overview of the model. More... | |
std::string | RobotDynamics::Utils::getModelDOFOverview (const Model &model) |
Creates a human readable overview of the Degrees of Freedom. More... | |
std::string | RobotDynamics::Utils::getNamedBodyOriginsOverview (Model &model) |
Creates a human readable overview of the locations of all bodies that have names. More... | |
void | RobotDynamics::Utils::calcCenterOfMass (Model &model, const Math::VectorNd &q, Math::Vector3d &com, bool update_kinematics=true) |
Computes the Center of Mass (COM) position. More... | |
void | RobotDynamics::Utils::calcCenterOfMass (Model &model, const Math::VectorNd &q, Math::FramePoint &com, bool update_kinematics=true) |
Computes the Center of Mass (COM) position. More... | |
void | RobotDynamics::Utils::calcCenterOfMass (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::Vector3d &com, Math::Vector3d *com_velocity=NULL, Math::Vector3d *angular_momentum=NULL, bool update_kinematics=true) |
Computes the Center of Mass (COM) and optionally its linear velocity. More... | |
void | RobotDynamics::Utils::calcCenterOfMass (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::Vector3d &com, Math::Vector3d &com_velocity, bool update_kinematics=true) |
Computes the Center of Mass (COM) and its linear velocity. More... | |
void | RobotDynamics::Utils::calcCenterOfMassVelocity (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::Vector3d &com_vel, bool update_kinematics=true) |
Computes the Center of Mass (COM) velocity in world frame. More... | |
void | RobotDynamics::Utils::calcCenterOfMassVelocity (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::FrameVector &com_vel, bool update_kinematics=true) |
Computes the Center of Mass (COM) velocity in world frame. More... | |
void | RobotDynamics::Utils::calcCenterOfMassVelocity (Model &model, Math::Vector3d &com_vel) |
Computes the Center of Mass (COM) velocity in world frame. More... | |
void | RobotDynamics::Utils::calcCenterOfMassVelocity (Model &model, Math::FrameVector &com_vel) |
Computes the Center of Mass (COM) velocity in world frame. More... | |
double | RobotDynamics::Utils::calcPotentialEnergy (Model &model, const Math::VectorNd &q, bool update_kinematics=true) |
Computes the potential energy of the full model. More... | |
double | RobotDynamics::Utils::calcKineticEnergy (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, bool update_kinematics=true) |
Computes the kinetic energy of the full model. More... | |
Math::SpatialForce | RobotDynamics::Utils::calcGravityWrenchOnCenterOfMass (Model &model, const Math::VectorNd &q, bool update_kinematics=true) |
Computes the gravitational wrench experienced on the robots center of mass. More... | |
void | RobotDynamics::Utils::calcCenterOfMassJacobian (Model &model, const Math::VectorNd &q, Math::MatrixNd &jCom, bool update_kinematics=true) |
Computes the matrix ![]() ![]() | |
Math::Vector3d | RobotDynamics::Utils::calcSubtreeCenterOfMassScaledByMass (Model &model, const unsigned int bodyId, const Math::VectorNd &q, bool updateKinematics=true) |
Calculates the center of mass of a subtree starting with the body with ID bodyId and scales it by the total mass of the subtree. More... | |
double | RobotDynamics::Utils::calcSubtreeMass (Model &model, const unsigned int bodyId) |
Calculates the total mass of the subtree beginning with body bodyId and traversing outwards from there. More... | |
void | RobotDynamics::Utils::calcCentroidalMomentumMatrix (Model &model, const Math::VectorNd &q, Math::MatrixNd &A, bool update_kinematics=true) |
Calculates the centroidal momentum matrix, ![]() ![]() | |
void | RobotDynamics::Utils::calcCentroidalMomentumMatrix (Model &model, const Math::VectorNd &q, Math::MatrixNd &A, Math::Vector3d com, bool update_kinematics=true) |
Calculates the centroidal momentum matrix, ![]() ![]() | |
void | RobotDynamics::Utils::calcCentroidalMomentumMatrixDot (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::MatrixNd &Adot, Math::Vector3d com, Math::Vector3d com_velocity, bool update_kinematics=true) |
Calculates the time derivative of the centroidal momentum matrix, i.e. the matrix computed by RobotDynamics::Utils::calcCentroidalMomentumMatrix and stores it in the Adot argument. More... | |
void | RobotDynamics::Utils::calcCentroidalMomentumMatrixDot (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::MatrixNd &Adot, bool update_kinematics=true) |
Calculates the time derivative of the centroidal momentum matrix, i.e. the matrix computed by RobotDynamics::Utils::calcCentroidalMomentumMatrix and stores it in the Adot argument. More... | |
void | RobotDynamics::Utils::calcCentroidalMomentumMatrixAndMatrixDot (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::MatrixNd &A, Math::MatrixNd &Adot, Math::Vector3d com, Math::Vector3d com_velocity, bool update_kinematics=true) |
Calculates the centroidal momentum matrix and its time derivative, but in a more efficient way than calling the functions to compute them separately. If you need both matrices it will be more efficient to use this function. More... | |
void | RobotDynamics::Utils::calcCentroidalMomentumMatrixAndMatrixDot (Model &model, const Math::VectorNd &q, const Math::VectorNd &qdot, Math::MatrixNd &A, Math::MatrixNd &Adot, bool update_kinematics=true) |
Calculates the centroidal momentum matrix and its time derivative, but in a more efficient way than calling the functions to compute them separately. If you need both matrices it will be more efficient to use this function. More... | |
Utility functions are those not necessarily required for kinematics/dynamics, but provide utility by giving model information, calculating useful quantities such as the position/velocity of the center of mass, etc.
Math::SpatialForce RobotDynamics::HydroUtils::calcBuoyancyWrenchOnCenterOfMass | ( | Model & | model, |
const Math::VectorNd & | q, | ||
bool | update_kinematics = true |
||
) |
Computes the wrench due to buoyancy experienced at the robots center of mass.
model | |
q | |
update_kinematics | (optional) Defaults to true |
void RobotDynamics::HydroUtils::calcCenterOfBuoyancy | ( | Model & | model, |
const Math::VectorNd & | q, | ||
Math::FramePoint & | com, | ||
bool | update_kinematics = true |
||
) |
Computes the Center of Buoyancy (COB) position.
model | The model for which we want to compute the COM |
q | The current joint positions |
cob | (output) location of the Center of Buoyancy of the model in world frame |
update_kinematics | (optional input) whether the kinematics should be updated (defaults to true) |
void RobotDynamics::Utils::calcCenterOfMass | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::Vector3d & | com, | ||
Math::Vector3d & | com_velocity, | ||
bool | update_kinematics = true |
||
) |
Computes the Center of Mass (COM) and its linear velocity.
model | The model for which we want to compute the COM |
q | The current joint positions |
qdot | The current joint velocities |
com | (output) location of the Center of Mass of the model in world frame |
com_velocity | linear velocity of the COM in world frame |
update_kinematics | (optional input) whether the kinematics should be updated (defaults to true) |
void RobotDynamics::Utils::calcCenterOfMass | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::Vector3d & | com, | ||
Math::Vector3d * | com_velocity = NULL , |
||
Math::Vector3d * | angular_momentum = NULL , |
||
bool | update_kinematics = true |
||
) |
Computes the Center of Mass (COM) and optionally its linear velocity.
When only interested in computing the location of the COM you can use nullptr as value for com_velocity.
model | The model for which we want to compute the COM |
q | The current joint positions |
qdot | The current joint velocities |
com | (output) location of the Center of Mass of the model in world frame |
com_velocity | (optional output) linear velocity of the COM in world frame |
angular_momentum | (optional output) angular momentum of the model at the COM in world frame |
update_kinematics | (optional input) whether the kinematics should be updated (defaults to true) |
void RobotDynamics::Utils::calcCenterOfMass | ( | Model & | model, |
const Math::VectorNd & | q, | ||
Math::FramePoint & | com, | ||
bool | update_kinematics = true |
||
) |
Computes the Center of Mass (COM) position.
model | The model for which we want to compute the COM |
q | The current joint positions |
com | (output) location of the Center of Mass of the model in world frame |
update_kinematics | (optional input) whether the kinematics should be updated (defaults to true) |
void RobotDynamics::Utils::calcCenterOfMass | ( | Model & | model, |
const Math::VectorNd & | q, | ||
Math::Vector3d & | com, | ||
bool | update_kinematics = true |
||
) |
Computes the Center of Mass (COM) position.
model | The model for which we want to compute the COM |
q | The current joint positions |
com | (output) location of the Center of Mass of the model in world frame |
update_kinematics | (optional input) whether the kinematics should be updated (defaults to true) |
void RobotDynamics::HydroUtils::calcCenterOfMassAndCenterOfBuoyancy | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::Vector3d & | com, | ||
Math::Vector3d & | cob, | ||
Math::Vector3d & | com_velocity, | ||
bool | update_kinematics | ||
) |
void RobotDynamics::Utils::calcCenterOfMassJacobian | ( | Model & | model, |
const Math::VectorNd & | q, | ||
Math::MatrixNd & | jCom, | ||
bool | update_kinematics = true |
||
) |
Computes the matrix such that
.
model | The model for which the COM jacobian will be computed for |
q | The current joint positions |
jCom | A 3 x model.qdot_size matrix where the jacobian will be stored. |
update_kinematics | If true, kinematic variables will be computed. Default = true. |
void RobotDynamics::Utils::calcCenterOfMassVelocity | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::FrameVector & | com_vel, | ||
bool | update_kinematics = true |
||
) |
Computes the Center of Mass (COM) velocity in world frame.
model | The model for which we want to compute the COM velocity |
q | The current joint positions |
qdot | The current joint velocities |
com_vel | (modified) Frame vector where the result vector and frame will be stored |
update_kinematics | (optional input) whether the kinematics should be updated (defaults to true) |
void RobotDynamics::Utils::calcCenterOfMassVelocity | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::Vector3d & | com_vel, | ||
bool | update_kinematics = true |
||
) |
Computes the Center of Mass (COM) velocity in world frame.
model | The model for which we want to compute the COM velocity |
q | The current joint positions |
qdot | The current joint velocities |
com_vel | (modified) translational velocity of the Center of Mass of the model in world frame |
update_kinematics | (optional input) whether the kinematics should be updated (defaults to true) |
void RobotDynamics::Utils::calcCenterOfMassVelocity | ( | Model & | model, |
Math::FrameVector & | com_vel | ||
) |
Computes the Center of Mass (COM) velocity in world frame.
model | The model for which we want to compute the COM velocity |
com_vel | (modified) Frame vector where the result vector and frame will be stored |
void RobotDynamics::Utils::calcCenterOfMassVelocity | ( | Model & | model, |
Math::Vector3d & | com_vel | ||
) |
Computes the Center of Mass (COM) velocity in world frame.
model | The model for which we want to compute the COM velocity |
com_vel | (modified) Vector3d where the result vector and frame will be stored |
void RobotDynamics::Utils::calcCentroidalMomentumMatrix | ( | Model & | model, |
const Math::VectorNd & | q, | ||
Math::MatrixNd & | A, | ||
bool | update_kinematics = true |
||
) |
Calculates the centroidal momentum matrix, for a model. The centroidal momentum matrix is a
matrix such that the 6dof centroidal momentum vector is computed by,.
model | RDL model |
q | Vector of joint positions |
A | 6 by N matrix where the result will be stored |
update_kinematics | If true, calculates kinematic parameters |
void RobotDynamics::Utils::calcCentroidalMomentumMatrix | ( | Model & | model, |
const Math::VectorNd & | q, | ||
Math::MatrixNd & | A, | ||
Math::Vector3d | com, | ||
bool | update_kinematics = true |
||
) |
Calculates the centroidal momentum matrix, for a model. The centroidal momentum matrix is a
matrix such that the 6dof centroidal momentum vector is computed by,.
model | RDL model |
q | Vector of joint positions |
A | 6 by N matrix where the result will be stored |
com | Position of the center of mass in world coordinates |
update_kinematics | If true, calculates kinematic parameters |
void RobotDynamics::Utils::calcCentroidalMomentumMatrixAndMatrixDot | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::MatrixNd & | A, | ||
Math::MatrixNd & | Adot, | ||
bool | update_kinematics = true |
||
) |
Calculates the centroidal momentum matrix and its time derivative, but in a more efficient way than calling the functions to compute them separately. If you need both matrices it will be more efficient to use this function.
model | rdl model |
q | vector of position |
qdot | vector of velocities |
A | storage for centroidal momentum matrix |
Adot | storage for centroidal momentum matrix dot |
update_kinematics | if true, kinematic variables will be computed. Defaults to true |
void RobotDynamics::Utils::calcCentroidalMomentumMatrixAndMatrixDot | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::MatrixNd & | A, | ||
Math::MatrixNd & | Adot, | ||
Math::Vector3d | com, | ||
Math::Vector3d | com_velocity, | ||
bool | update_kinematics = true |
||
) |
Calculates the centroidal momentum matrix and its time derivative, but in a more efficient way than calling the functions to compute them separately. If you need both matrices it will be more efficient to use this function.
model | rdl model |
q | vector of position |
qdot | vector of velocities |
A | storage for centroidal momentum matrix |
Adot | storage for centroidal momentum matrix dot |
com | position of the center of mass in world coordinates |
com_velocity | velocity of the center of mass in world coordinates |
update_kinematics | if true, kinematic variables will be computed. Defaults to true |
void RobotDynamics::Utils::calcCentroidalMomentumMatrixDot | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::MatrixNd & | Adot, | ||
bool | update_kinematics = true |
||
) |
Calculates the time derivative of the centroidal momentum matrix, i.e. the matrix computed by RobotDynamics::Utils::calcCentroidalMomentumMatrix and stores it in the Adot argument.
model | |
q | |
qdot | |
Adot | |
update_kinematics |
void RobotDynamics::Utils::calcCentroidalMomentumMatrixDot | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
Math::MatrixNd & | Adot, | ||
Math::Vector3d | com, | ||
Math::Vector3d | com_velocity, | ||
bool | update_kinematics = true |
||
) |
Calculates the time derivative of the centroidal momentum matrix, i.e. the matrix computed by RobotDynamics::Utils::calcCentroidalMomentumMatrix and stores it in the Adot argument.
model | rdl model |
q | vector of position |
qdot | vector of velocities |
Adot | storage for centroidal momentum matrix dot |
com | position of the center of mass in world coordinates |
com_velocity | velocity of the center of mass in world coordinates |
update_kinematics |
Math::SpatialForce RobotDynamics::HydroUtils::calcDragWrenchOnCenterOfMass | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
bool | update_kinematics = true |
||
) |
Computes the wrench due to drag experienced at the robots center of mass.
model | |
q | |
qdot | |
update_kinematics | (optional) Defaults to true |
Math::SpatialForce RobotDynamics::Utils::calcGravityWrenchOnCenterOfMass | ( | Model & | model, |
const Math::VectorNd & | q, | ||
bool | update_kinematics = true |
||
) |
Computes the gravitational wrench experienced on the robots center of mass.
model | |
q | |
update_kinematics | (optional) Defaults to true |
double RobotDynamics::Utils::calcKineticEnergy | ( | Model & | model, |
const Math::VectorNd & | q, | ||
const Math::VectorNd & | qdot, | ||
bool | update_kinematics = true |
||
) |
Computes the kinetic energy of the full model.
model | |
q | |
qdot | |
update_kinematics | (optional) Defaults to true |
double RobotDynamics::Utils::calcPotentialEnergy | ( | Model & | model, |
const Math::VectorNd & | q, | ||
bool | update_kinematics = true |
||
) |
Computes the potential energy of the full model.
model | |
q | |
update_kinematics | (optional) Defaults to true |
Math::Vector3d RobotDynamics::Utils::calcSubtreeCenterOfMassScaledByMass | ( | Model & | model, |
const unsigned int | bodyId, | ||
const Math::VectorNd & | q, | ||
bool | updateKinematics = true |
||
) |
Calculates the center of mass of a subtree starting with the body with ID bodyId and scales it by the total mass of the subtree.
model | The model used for the calculation |
bodyId | The ID of the first body in the desired subtree |
q | The current joint positions |
updateKinematics | If true, kinematic variables will be computed. Default = true |
double RobotDynamics::Utils::calcSubtreeMass | ( | Model & | model, |
const unsigned int | bodyId | ||
) |
Calculates the total mass of the subtree beginning with body bodyId and traversing outwards from there.
model | The model used for the calculation |
bodyId | The ID of the first body in the desired subtree |
double RobotDynamics::HydroUtils::calcSubtreeVolume | ( | Model & | model, |
const unsigned int | bodyId | ||
) |
Calculates the total volume of the model.
model | The model used for the calculation |
bodyId | The ID of the first body in the desired subtree |
double RobotDynamics::HydroUtils::calcSubtreeWeightInFluid | ( | Model & | model, |
const unsigned int | bodyId | ||
) |
Calculate the weight of a kinematic subtree in fluid with density RobotDynamics::Model::fluid_density.
model | RDL Model |
bodyId | The ID of the first body in the desired subtree |
std::string RobotDynamics::Utils::getBodyName | ( | const RobotDynamics::Model & | model, |
unsigned int | body_id | ||
) |
get body name, returns empty string if bodyid is virtual and has multiple child bodies
std::string RobotDynamics::Utils::getDofName | ( | const SpatialVector & | joint_dof | ) |
get string abbreviation for dof name from spatial vector.
std::string RobotDynamics::Utils::getModelDOFOverview | ( | const Model & | model | ) |
Creates a human readable overview of the Degrees of Freedom.
std::string RobotDynamics::Utils::getModelHierarchy | ( | const Model & | model | ) |
Creates a human readable overview of the model.
std::string RobotDynamics::Utils::getNamedBodyOriginsOverview | ( | Model & | model | ) |
Creates a human readable overview of the locations of all bodies that have names.