libfranka 0.18.0
FCI C++ API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
franka::RobotModel Class Reference

Implements of RobotModelBase using Pinocchio. More...

#include <robot_model.h>

Inheritance diagram for franka::RobotModel:
Inheritance graph
[legend]
Collaboration diagram for franka::RobotModel:
Collaboration graph
[legend]

Public Member Functions

 RobotModel (const std::string &urdf)
 
void coriolis (const std::array< double, 7 > &q, const std::array< double, 7 > &dq, const std::array< double, 9 > &i_total, double m_total, const std::array< double, 3 > &f_x_ctotal, std::array< double, 7 > &c_ne) override
 Calculates the Coriolis force vector (state-space equation): \( c= C \times dq\), in \([Nm]\).
 
void coriolis (const std::array< double, 7 > &q, const std::array< double, 7 > &dq, const std::array< double, 9 > &i_total, double m_total, const std::array< double, 3 > &f_x_ctotal, const std::array< double, 3 > &g_earth, std::array< double, 7 > &c_ne) override
 Calculates the Coriolis force vector with configurable gravity (recommended implementation).
 
void gravity (const std::array< double, 7 > &q, const std::array< double, 3 > &g_earth, double m_total, const std::array< double, 3 > &f_x_ctotal, std::array< double, 7 > &g_ne) override
 Calculates the gravity vector.
 
void mass (const std::array< double, 7 > &q, const std::array< double, 9 > &i_total, double m_total, const std::array< double, 3 > &f_x_ctotal, std::array< double, 49 > &m_ne) override
 Calculates the 7x7 inertia matrix.
 
std::array< double, 16 > pose (const std::array< double, 7 > &q, int joint_index) override
 Calculates the homogeneous transformation matrix for the specified joint or link.
 
std::array< double, 16 > poseEe (const std::array< double, 7 > &q, const std::array< double, 16 > &f_t_ee) override
 Calculates the homogeneous transformation matrix for the end effector, applying the end effector transformation.
 
std::array< double, 16 > poseFlange (const std::array< double, 7 > &q) override
 Calculates the homogeneous transformation matrix for the flange.
 
std::array< double, 16 > poseStiffness (const std::array< double, 7 > &q, const std::array< double, 16 > &f_t_ee, const std::array< double, 16 > &ee_t_k) override
 Calculates the homogeneous transformation matrix for the stiffness frame.
 
std::array< double, 42 > bodyJacobian (const std::array< double, 7 > &q, int joint_index) override
 Calculates the 6x7 body Jacobian for the given joint, relative to that joint's frame.
 
std::array< double, 42 > bodyJacobianFlange (const std::array< double, 7 > &q) override
 Calculates the 6x7 body Jacobian for the flange frame, relative to that frame.
 
std::array< double, 42 > bodyJacobianEe (const std::array< double, 7 > &q, const std::array< double, 16 > &f_t_ee) override
 Calculates the 6x7 body Jacobian for the end effector frame, relative to that frame.
 
std::array< double, 42 > bodyJacobianStiffness (const std::array< double, 7 > &q, const std::array< double, 16 > &f_t_ee, const std::array< double, 16 > &ee_t_k) override
 Calculates the 6x7 body Jacobian for the stiffness frame, relative to that frame.
 
std::array< double, 42 > zeroJacobian (const std::array< double, 7 > &q, int joint_index) override
 Calculates the 6x7 zero Jacobian for the given joint, relative to the base frame.
 
std::array< double, 42 > zeroJacobianFlange (const std::array< double, 7 > &q) override
 Calculates the 6x7 zero Jacobian for the flange frame, relative to the base frame.
 
std::array< double, 42 > zeroJacobianEe (const std::array< double, 7 > &q, const std::array< double, 16 > &f_t_ee) override
 Calculates the 6x7 zero Jacobian for the end effector frame, relative to the base frame.
 
std::array< double, 42 > zeroJacobianStiffness (const std::array< double, 7 > &q, const std::array< double, 16 > &f_t_ee, const std::array< double, 16 > &ee_t_k) override
 Calculates the 6x7 zero Jacobian for the stiffness frame, relative to the base frame.
 

Detailed Description

Implements of RobotModelBase using Pinocchio.

Member Function Documentation

◆ bodyJacobian()

std::array< double, 42 > franka::RobotModel::bodyJacobian ( const std::array< double, 7 > &  q,
int  joint_index 
)
overridevirtual

Calculates the 6x7 body Jacobian for the given joint, relative to that joint's frame.

Parameters
[in]qJoint position.
[in]joint_indexThe index of the joint/link for which to calculate the Jacobian.
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.

◆ bodyJacobianEe()

std::array< double, 42 > franka::RobotModel::bodyJacobianEe ( const std::array< double, 7 > &  q,
const std::array< double, 16 > &  f_t_ee 
)
overridevirtual

Calculates the 6x7 body Jacobian for the end effector frame, relative to that frame.

Parameters
[in]qJoint position.
[in]f_t_eeThe transformation from flange to end effector (4x4 matrix, column-major).
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.

◆ bodyJacobianFlange()

std::array< double, 42 > franka::RobotModel::bodyJacobianFlange ( const std::array< double, 7 > &  q)
overridevirtual

Calculates the 6x7 body Jacobian for the flange frame, relative to that frame.

Parameters
[in]qJoint position.
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.

◆ bodyJacobianStiffness()

std::array< double, 42 > franka::RobotModel::bodyJacobianStiffness ( const std::array< double, 7 > &  q,
const std::array< double, 16 > &  f_t_ee,
const std::array< double, 16 > &  ee_t_k 
)
overridevirtual

Calculates the 6x7 body Jacobian for the stiffness frame, relative to that frame.

Parameters
[in]qJoint position.
[in]f_t_eeThe transformation from flange to end effector (4x4 matrix, column-major).
[in]ee_t_kThe transformation from end effector to stiffness frame (4x4 matrix, column-major).
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.

◆ coriolis() [1/2]

void franka::RobotModel::coriolis ( const std::array< double, 7 > &  q,
const std::array< double, 7 > &  dq,
const std::array< double, 9 > &  i_total,
double  m_total,
const std::array< double, 3 > &  f_x_ctotal,
const std::array< double, 3 > &  g_earth,
std::array< double, 7 > &  c_ne 
)
overridevirtual

Calculates the Coriolis force vector with configurable gravity (recommended implementation).

Unit: \([Nm]\).

Parameters
[in]qJoint position.
[in]dqJoint velocity.
[in]i_totalInertia of the attached total load including end effector, relative to center of mass, given as vectorized 3x3 column-major matrix. Unit: \([kg \times m^2]\).
[in]m_totalWeight of the attached total load including end effector. Unit: \([kg]\).
[in]f_x_ctotalTranslation from flange to center of mass of the attached total load. Unit: \([m]\).
[in]g_earthEarth's gravity vector. Unit: \(\frac{m}{s^2}\).
[out]c_neCoriolis force vector. Unit: \([Nm]\).

Implements RobotModelBase.

◆ coriolis() [2/2]

void franka::RobotModel::coriolis ( const std::array< double, 7 > &  q,
const std::array< double, 7 > &  dq,
const std::array< double, 9 > &  i_total,
double  m_total,
const std::array< double, 3 > &  f_x_ctotal,
std::array< double, 7 > &  c_ne 
)
overridevirtual

Calculates the Coriolis force vector (state-space equation): \( c= C \times dq\), in \([Nm]\).

Parameters
[in]qJoint position.
[in]dqJoint velocity.
[in]i_totalInertia of the attached total load including end effector, relative to center of mass, given as vectorized 3x3 column-major matrix. Unit: \([kg \times m^2]\).
[in]m_totalWeight of the attached total load including end effector. Unit: \([kg]\).
[in]f_x_ctotalTranslation from flange to center of mass of the attached total load. Unit: \([m]\).
[out]c_neCoriolis force vector. Unit: \([Nm]\).

Implements RobotModelBase.

◆ gravity()

void franka::RobotModel::gravity ( const std::array< double, 7 > &  q,
const std::array< double, 3 > &  g_earth,
double  m_total,
const std::array< double, 3 > &  f_x_ctotal,
std::array< double, 7 > &  g_ne 
)
overridevirtual

Calculates the gravity vector.

Unit: \([Nm]\).

Parameters
[in]qJoint position.
[in]gravity_earthEarth's gravity vector. Unit: \(\frac{m}{s^2}\).
[in]m_totalWeight of the attached total load including end effector. Unit: \([kg]\).
[in]f_x_CtotalTranslation from flange to center of mass of the attached total load.
[out]g_neGravity vector. Unit: \([Nm]\).

Implements RobotModelBase.

◆ mass()

void franka::RobotModel::mass ( const std::array< double, 7 > &  q,
const std::array< double, 9 > &  i_total,
double  m_total,
const std::array< double, 3 > &  f_x_ctotal,
std::array< double, 49 > &  m_ne 
)
overridevirtual

Calculates the 7x7 inertia matrix.

Unit: \([kg \times m^2]\).

Parameters
[in]qJoint position.
[in]i_totalInertia of the attached total load including end effector, relative to center of mass, given as vectorized 3x3 column-major matrix. Unit: \([kg \times m^2]\).
[in]m_totalWeight of the attached total load including end effector. Unit: \([kg]\).
[in]f_x_ctotalTranslation from flange to center of mass of the attached total load. Unit: \([m]\).
[out]m_neVectorized 7x7 inertia matrix, column-major.

Implements RobotModelBase.

◆ pose()

std::array< double, 16 > franka::RobotModel::pose ( const std::array< double, 7 > &  q,
int  joint_index 
)
overridevirtual

Calculates the homogeneous transformation matrix for the specified joint or link.

Parameters
[in]qJoint position.
[in]joint_indexThe index of the joint/link for which to calculate the pose.
Returns
Homogeneous transformation matrix (4x4) in column-major order.

Implements RobotModelBase.

◆ poseEe()

std::array< double, 16 > franka::RobotModel::poseEe ( const std::array< double, 7 > &  q,
const std::array< double, 16 > &  f_t_ee 
)
overridevirtual

Calculates the homogeneous transformation matrix for the end effector, applying the end effector transformation.

Parameters
[in]qJoint position.
[in]f_t_eeThe transformation from flange to end effector (4x4 matrix, column-major).
Returns
Homogeneous transformation matrix (4x4) in column-major order.

Implements RobotModelBase.

◆ poseFlange()

std::array< double, 16 > franka::RobotModel::poseFlange ( const std::array< double, 7 > &  q)
overridevirtual

Calculates the homogeneous transformation matrix for the flange.

Parameters
[in]qJoint position.
Returns
Homogeneous transformation matrix (4x4) in column-major order.

Implements RobotModelBase.

◆ poseStiffness()

std::array< double, 16 > franka::RobotModel::poseStiffness ( const std::array< double, 7 > &  q,
const std::array< double, 16 > &  f_t_ee,
const std::array< double, 16 > &  ee_t_k 
)
overridevirtual

Calculates the homogeneous transformation matrix for the stiffness frame.

Parameters
[in]qJoint position.
[in]f_t_eeThe transformation from flange to end effector (4x4 matrix, column-major).
[in]ee_t_kThe transformation from end effector to stiffness frame (4x4 matrix, column-major).
Returns
Homogeneous transformation matrix (4x4) in column-major order.

Implements RobotModelBase.

◆ zeroJacobian()

std::array< double, 42 > franka::RobotModel::zeroJacobian ( const std::array< double, 7 > &  q,
int  joint_index 
)
overridevirtual

Calculates the 6x7 zero Jacobian for the given joint, relative to the base frame.

Parameters
[in]qJoint position.
[in]joint_indexThe index of the joint/link for which to calculate the Jacobian.
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.

◆ zeroJacobianEe()

std::array< double, 42 > franka::RobotModel::zeroJacobianEe ( const std::array< double, 7 > &  q,
const std::array< double, 16 > &  f_t_ee 
)
overridevirtual

Calculates the 6x7 zero Jacobian for the end effector frame, relative to the base frame.

Parameters
[in]qJoint position.
[in]f_t_eeThe transformation from flange to end effector (4x4 matrix, column-major).
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.

◆ zeroJacobianFlange()

std::array< double, 42 > franka::RobotModel::zeroJacobianFlange ( const std::array< double, 7 > &  q)
overridevirtual

Calculates the 6x7 zero Jacobian for the flange frame, relative to the base frame.

Parameters
[in]qJoint position.
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.

◆ zeroJacobianStiffness()

std::array< double, 42 > franka::RobotModel::zeroJacobianStiffness ( const std::array< double, 7 > &  q,
const std::array< double, 16 > &  f_t_ee,
const std::array< double, 16 > &  ee_t_k 
)
overridevirtual

Calculates the 6x7 zero Jacobian for the stiffness frame, relative to the base frame.

Parameters
[in]qJoint position.
[in]f_t_eeThe transformation from flange to end effector (4x4 matrix, column-major).
[in]ee_t_kThe transformation from end effector to stiffness frame (4x4 matrix, column-major).
Returns
Vectorized 6x7 Jacobian, column-major.

Implements RobotModelBase.


The documentation for this class was generated from the following file: