![]() |
RML
1.0
Robotics Mathematical Library
|
Arm Model class for serial kinematic chains (manipulators). More...
#include <ArmModel.h>
Public Member Functions | |
| ArmModel (const std::string id) noexcept(false) | |
| Default constructor. | |
| virtual | ~ArmModel () |
| Default destructor. | |
| void | AddJointLink (JointType type, const Eigen::Vector3d &axis, const Eigen::TransformationMatrix &baseTransf, double jointLimMin, double jointLimMax) |
| Adds a link to the kinematic chain of the model. | |
| void | AddFixedLink (const Eigen::TransformationMatrix &baseTransf) |
| Adds a fixed link to the kinematic chain of the model. | |
| virtual void | JointsPosition (const Eigen::VectorXd q) noexcept(false) |
| Set the joint position. | |
| virtual auto | JointsPosition () const -> const Eigen::VectorXd & |
| Get the moving joint position. | |
| virtual void | JointsVelocity (const Eigen::VectorXd qdot) noexcept(false) |
| Set the moving joints velocity. | |
| virtual auto | JointsVelocity () const -> const Eigen::VectorXd & |
| Get the moving joints velocity. | |
| void | JointsAcceleration (const Eigen::VectorXd qddot) noexcept(false) |
| Set the moving joints acceleration. | |
| auto | JointsAcceleration () const -> const Eigen::VectorXd & |
| Get moving joints acceleration. | |
| void | AttachRigidBodyFrame (std::string frameID, std::string attachedFrameID, Eigen::TransformationMatrix attachedFrameID_T_frameID) noexcept(false) |
| Method adding a rigid body frame to a joint. | |
| Eigen::TransformationMatrix | TransformationMatrix (const std::string &frameID) noexcept(false) |
| Method returning the transformation matrix related to the input frameID wrt to the arm base. | |
| Eigen::TransformationMatrix | TransformationMatrix (const std::string &frameID_j, const std::string &frameID_k) |
| Method returing a transformation matrix from frameID_j to frameID_k, i.e. jTk. | |
| virtual Eigen::MatrixXd | Jacobian (const std::string &frameID) noexcept(false) |
| Method returning the jacobian related to the input frameID wrt to the arm base. | |
| Eigen::MatrixXd | ManipulabilityJacobian (const std::string &frameID) |
| Method returning the manipulability jacobian related to the input frameID wrt to the arm base. | |
| virtual auto | NumJoints () const -> unsigned int |
| Method returning the arm number of moving joints. | |
| auto | dJdq () const -> const std::vector< Eigen::MatrixXd > & |
| Method returning dJdq evaluated numerically. | |
| RobotLink & | Link (int jointIndex) noexcept(false) |
| Method returning the arm link. | |
| auto | IsModelInitialized () const -> bool |
| Method returning true if the model is initialized false otherwise. | |
| auto | ControlVector () const -> const Eigen::VectorXd & |
| Method returning the arm control vector. | |
| void | ControlVector (const Eigen::VectorXd controlRef) noexcept(false) |
| Method setting the arm control vector. | |
| double | Manipulability (const std::string &frameID) |
| Method returning the arm manipulability. | |
| Eigen::MatrixXd | DexterityJacobian (const std::string &frameID) |
| Method returning the dexterity jacobian related to the input frameID wrt to the arm base. | |
| double | Dexterity (const std::string &frameID) |
| Method returning the arm dexterity. | |
| auto | ID () const -> const std::string & |
| Method returning the arm id. | |
| auto | ID () -> std::string & |
| Method setting the arm id. | |
| std::vector< std::string > | GetRigidBodyFrameIDs () const noexcept |
| Method returning the list of rigid body frame IDs. | |
| std::vector< std::string > | GetJointFrameIDs () const noexcept |
| Method returning the list of joint frame IDs. | |
| std::vector< std::string > | GetJacobianFrameIDs () const noexcept |
| Method returning the list of Jacobian frame IDs. | |
| std::string | GetEndEffectorFrameID () const noexcept |
| Method returning the end-effector frame ID. | |
Protected Member Functions | |
| void | EvaluateTotalForwardGeometry () |
| Method evaluating the total forward geometry for the arm. | |
| virtual void | EvaluatedJdqNumeric () |
| Evaluates numerically the Jacobian derivative w.r.t. joint variations. | |
| virtual Eigen::MatrixXd | EvaluateManipulability (const std::string &frameID) |
| Evaluates the manipulability measure and its Jacobian This method returns the manipulability measure and its Jacobian. | |
| virtual Eigen::MatrixXd | EvaluateDexterity (const std::string &frameID) |
| Evaluates the dexterity measure and its Jacobian This method returns the dexterity measure and its Jacobian. | |
| Eigen::TransformationMatrix | EvaluateRigidBodyTransf (const std::string &frameID) |
| Method returning the attached body frame wrt to the arm base. | |
| Eigen::MatrixXd | EvaluateRigidBodyJacobian (const std::string &frameID) |
| Method returning the attached body frame jacobian wrt to the arm base. | |
| Eigen::MatrixXd | EvaluateBase2JointJacobian (unsigned int jointIndex) |
| Evaluates the jacobian matrix (w.r.t. robot base) of the specified joint. | |
| void | ForwardDirectGeometry (unsigned int jointNumber) |
| Method performing the forward direct geometry untill the input joint number. | |
| void | BackwardDirectGeometry (unsigned int jointNumber, unsigned int endEffectorIndex) |
| Backward Direct Geometry from the input joint number to the input end effector index. | |
Protected Attributes | |
| bool | modelInitialized_ |
| boolean stating whether the model is initialized | |
| bool | isMapInitialized_ |
| boolean stating whether the transformation and jacobian maps are initialized | |
| unsigned int | totalNumJoints_ |
| unsigned int | movingNumJoints_ |
| moving joints number | |
| std::vector< unsigned int > | movingJoints_ |
| vector containing the indexes of the moving joints | |
| std::vector< RobotLink > | links_ |
| vector of the arm links | |
| std::unordered_map< std::string, IndexedTMat > | rigidBodyFrames_ |
| std::unordered_map< std::string, Eigen::MatrixXd > | jacobians_ |
| std::unordered_map< std::string, Eigen::TransformationMatrix > | transformation_ |
| std::unordered_map< std::string, Eigen::MatrixXd > | manipulabilityJacobians_ |
| map of the manipulability jacobians | |
| std::unordered_map< std::string, double > | manipulability_ |
| map of the manipulability values | |
| Eigen::VectorXd | q_total_ |
| Eigen::VectorXd | q_moving_ |
| Eigen::VectorXd | q_dot_moving_ |
| Eigen::VectorXd | q_ddot_moving_ |
| Eigen::VectorXd | controlRef_ |
| std::vector< Eigen::TransformationMatrix > | baseTei_ |
| std::vector< Eigen::TransformationMatrix > | biTei_ |
| Eigen::TransformationMatrix | baseTbi_ |
| Eigen::TransformationMatrix | Tz_ |
| transformation matrix for rotation or prismatic joint | |
| Eigen::Vector3d | base_ki_ |
| std::vector< Eigen::Vector6d > | h_ |
| std::vector< Eigen::MatrixXd > | dJdq_ |
| dJdq evaluated numerically | |
| Eigen::MatrixXd | djdqJpinv_ |
| djdq * jacobian pseudoinverse | |
| Eigen::RotationMatrix | I3_ |
| identity matrix | |
| bool | modelReadFromFile_ |
| boolean stating whether the model is read from file | |
| std::string | id_ |
| arm id | |
| std::unordered_map< std::string, Eigen::MatrixXd > | dexterityJacobians_ |
| map of the manipulability jacobians | |
| std::unordered_map< std::string, double > | dexterity_ |
| map of the manipulability values | |
| Eigen::MatrixXd | Jdjdq_ |
| jacobian * djdq | |
| Eigen::MatrixXd | Jpinvdjpinvdq_ |
| jacobian pseudoinverse * djpinvdq | |
Arm Model class for serial kinematic chains (manipulators).
This class implements a model for serial kinematic chains, the whole structure is identified by an ID given by the user in the constructor. It contains a vector of RobotLink which can be added up using the AddFixedLink() function for fixed links and the AddJointLink() one for moving links, the two methods attach each new link to the previous one. Optionally we can also add rigid bodies to each link with the function SetRigidBodyFrame() which takes as input the frameName to identify the frame to which attach the body and a IDstring to identify it.
Once the model has been constructed, the class provides all the necessary functions to evaluate the transformation and jacobian matrices for every link and rigid body added. Each frame is identified by a label. The following policy is used:
In order to get the transformation matrix the GetTransformation() method is provided. The method takes as input a string which is the id of the frame asked.
All the transformation matrices are expressed wrt the arm base. In order to get the jacobian the GetJacobian() method is provided. The method takes as input a string which is the id of the frame asked. All the jacobian matrix are expressed wrt the arm base.
This class has been designed with two use cases in mind:
| rml::ArmModel::ArmModel | ( | const std::string | id | ) |
Default constructor.
| [in] | id | Arm id. |
|
virtual |
Default destructor.
| void rml::ArmModel::AddFixedLink | ( | const Eigen::TransformationMatrix & | baseTransf | ) |
Adds a fixed link to the kinematic chain of the model.
| baseTransf | Transformation matrix from previous to current |
| void rml::ArmModel::AddJointLink | ( | JointType | type, |
| const Eigen::Vector3d & | axis, | ||
| const Eigen::TransformationMatrix & | baseTransf, | ||
| double | jointLimMin, | ||
| double | jointLimMax | ||
| ) |
Adds a link to the kinematic chain of the model.
| type | The JointType, whether: JointType::Revolute, JointType::Prismatic |
| axis | The axis along which the joint rotates or translates |
| baseTransf | Transformation matrix from previous link to current link |
| jointLimMin | Minimum excursion for the joint |
| jointLimMax | Maximum excursion for the joint |
| void rml::ArmModel::AttachRigidBodyFrame | ( | std::string | frameID, |
| std::string | attachedFrameID, | ||
| Eigen::TransformationMatrix | attachedFrameID_T_frameID | ||
| ) |
Method adding a rigid body frame to a joint.
| frameID | Id of the frame to add |
| attachedFrameID | ID of the frame to attach |
| TMat | Transformation matrix of the frame. |
|
protected |
Backward Direct Geometry from the input joint number to the input end effector index.
| jointNumber | which joint is intended as last of the chain |
| endEffectorIndex |
|
inline |
Method returning the arm control vector.
| void rml::ArmModel::ControlVector | ( | const Eigen::VectorXd | controlRef | ) |
Method setting the arm control vector.
| controlRef | control vector |
| double rml::ArmModel::Dexterity | ( | const std::string & | frameID | ) |
Method returning the arm dexterity.
| Eigen::MatrixXd rml::ArmModel::DexterityJacobian | ( | const std::string & | frameID | ) |
Method returning the dexterity jacobian related to the input frameID wrt to the arm base.
| frameId | frame id |
|
inline |
Method returning dJdq evaluated numerically.
|
protected |
Evaluates the jacobian matrix (w.r.t. robot base) of the specified joint.
| [in] | jointIndex | Joint index |
|
protectedvirtual |
Evaluates the dexterity measure and its Jacobian This method returns the dexterity measure and its Jacobian.
|
protectedvirtual |
Evaluates numerically the Jacobian derivative w.r.t. joint variations.
|
protectedvirtual |
Evaluates the manipulability measure and its Jacobian This method returns the manipulability measure and its Jacobian.
|
protected |
Method returning the attached body frame jacobian wrt to the arm base.
| ID | frame ID. |
|
protected |
Method returning the attached body frame wrt to the arm base.
| ID | frame ID. |
|
protected |
Method evaluating the total forward geometry for the arm.
|
protected |
Method performing the forward direct geometry untill the input joint number.
| jointNumber | which joint is intended as last of the chain |
|
noexcept |
Method returning the end-effector frame ID.
|
noexcept |
Method returning the list of Jacobian frame IDs.
|
noexcept |
Method returning the list of joint frame IDs.
|
noexcept |
Method returning the list of rigid body frame IDs.
|
inline |
Method setting the arm id.
| id | arm id. |
|
inline |
Method returning the arm id.
|
inline |
Method returning true if the model is initialized false otherwise.
|
virtual |
Method returning the jacobian related to the input frameID wrt to the arm base.
| frameId | frame id |
|
inline |
Get moving joints acceleration.
| void rml::ArmModel::JointsAcceleration | ( | const Eigen::VectorXd | qddot | ) |
Set the moving joints acceleration.
| qddot | the joints acceleration vector (must be a numMovingJoints x 1 vector) |
|
inlinevirtual |
Get the moving joint position.
|
virtual |
Set the joint position.
The method updates the internal joint position state [only the moving joints]. This method updates also the internal transformation matrices and jacobians.
| [in] | q | the joint position vector (must be a numMovingJoints x 1 vector) |
|
inlinevirtual |
Get the moving joints velocity.
|
virtual |
Set the moving joints velocity.
| qdot | the joint velocity vector (must be a numMovingJoints x 1 vector) |
| RobotLink & rml::ArmModel::Link | ( | int | jointIndex | ) |
Method returning the arm link.
| jointIndex | link index |
| double rml::ArmModel::Manipulability | ( | const std::string & | frameID | ) |
Method returning the arm manipulability.
| Eigen::MatrixXd rml::ArmModel::ManipulabilityJacobian | ( | const std::string & | frameID | ) |
Method returning the manipulability jacobian related to the input frameID wrt to the arm base.
| frameId | frame id |
|
inlinevirtual |
Method returning the arm number of moving joints.
| Eigen::TransformationMatrix rml::ArmModel::TransformationMatrix | ( | const std::string & | frameID | ) |
Method returning the transformation matrix related to the input frameID wrt to the arm base.
| frameId | frame id |
| Eigen::TransformationMatrix rml::ArmModel::TransformationMatrix | ( | const std::string & | frameID_j, |
| const std::string & | frameID_k | ||
| ) |
Method returing a transformation matrix from frameID_j to frameID_k, i.e. jTk.
| [in] | frameID_j | first frame; |
| [in] | framID_k | second frame; |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
map of the manipulability values
|
protected |
map of the manipulability jacobians
|
protected |
dJdq evaluated numerically
|
protected |
djdq * jacobian pseudoinverse
|
protected |
|
protected |
identity matrix
|
protected |
arm id
|
protected |
boolean stating whether the transformation and jacobian maps are initialized
|
protected |
|
protected |
jacobian * djdq
|
protected |
jacobian pseudoinverse * djpinvdq
|
protected |
vector of the arm links
|
protected |
map of the manipulability values
|
protected |
map of the manipulability jacobians
|
protected |
boolean stating whether the model is initialized
|
protected |
boolean stating whether the model is read from file
|
protected |
vector containing the indexes of the moving joints
|
protected |
moving joints number
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
transformation matrix for rotation or prismatic joint