pub struct Model { /* private fields */ }
Expand description

Calculates poses of joints and dynamic properties of the robot.

Implementations

Creates a new Model instance from the shared object of the Model for offline usage.

If you just want to use the model to control the Robot you should use Robot::load_model.

If you do not have the model you can use the download_model example to download the model

Arguments
  • model_filename - Path to the model.
  • libm_filename - Path to libm.so.6 . You probably do not need to specify the path as it it should be detected automatically. However if you get panics for unresolved symbols or libm could not be found you have to specify the path. On most Ubuntu systems it is in
/lib/x86_64-linux-gnu/libm.so.6

It maybe has a different name on your machine but it is not the “libm.so”. You can verify that it is the correct libm by checking:

 nm -D /lib/x86_64-linux-gnu/libm.so.6 | grep sincos
Errors
  • ModelException
libm FAQ

What is libm? - Libm is the Math library of the C Standard Library. It is what you get when you include <math.h> in C

Why do we need it? - Because the model is not self contained and relies on some functions from libm

How does the libfranka embed libm? They are not including <math.h> - Apparently it gets somehow included when using <array> ¯_(ツ)_/¯

Gets the 4x4 pose matrix for the given frame in base frame.

The pose is represented as a 4x4 matrix in column-major format.

Arguments
  • frame - The desired frame.
  • q - Joint position.
  • F_T_EE - End effector in flange frame.
  • EE_T_K - Stiffness frame K in the end effector frame.
Return

Vectorized 4x4 pose matrix, column-major.

Gets the 4x4 pose matrix for the given frame in base frame.

The pose is represented as a 4x4 matrix in column-major format.

Arguments
  • frame - The desired frame.
  • robot_state - State from which the pose should be calculated.
Return

Vectorized 4x4 pose matrix, column-major.

Gets the 6x7 Jacobian for the given frame, relative to that frame.

The Jacobian is represented as a 6x7 matrix in column-major format.

Arguments
  • frame - The desired frame.
  • q - Joint position.
  • F_T_EE - End effector in flange frame.
  • EE_T_K - Stiffness frame K in the end effector frame.
Return

Vectorized 6x7 Jacobian, column-major.

Gets the 6x7 Jacobian for the given frame, relative to that frame.

The Jacobian is represented as a 6x7 matrix in column-major format.

Arguments
  • frame - The desired frame.
  • robot_state - State from which the pose should be calculated.
Return

Vectorized 6x7 Jacobian, column-major.

Gets the 6x7 Jacobian for the given joint relative to the base frame.

The Jacobian is represented as a 6x7 matrix in column-major format.

Arguments
  • frame - The desired frame.
  • q - Joint position.
  • F_T_EE - End effector in flange frame.
  • EE_T_K - Stiffness frame K in the end effector frame.
Return

Vectorized 6x7 Jacobian, column-major.

Gets the 6x7 Jacobian for the given joint relative to the base frame.

The Jacobian is represented as a 6x7 matrix in column-major format.

Arguments
  • frame - The desired frame.
  • robot_state - State from which the pose should be calculated.
Return

Vectorized 6x7 Jacobian, column-major.

Calculates the 7x7 mass matrix. Unit: [kg \times m^2].

Arguments
  • q - Joint position.
  • I_total - Inertia of the attached total load including end effector, relative to center of mass, given as vectorized 3x3 column-major matrix. Unit: [kg * m^2].
  • m_total - Weight of the attached total load including end effector. Unit: [kg].
  • F_x_Ctotal - Translation from flange to center of mass of the attached total load. Unit: [m].
Return

Vectorized 7x7 mass matrix, column-major.

Calculates the 7x7 mass matrix. Unit: [kg \times m^2].

Arguments
  • robot_state - State from which the mass matrix should be calculated.
Return

Vectorized 7x7 mass matrix, column-major.

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

Arguments
  • q - Joint position.
  • dq - Joint velocity.
  • I_total - Inertia of the attached total load including end effector, relative to center of mass, given as vectorized 3x3 column-major matrix. Unit: [kg * m^2].
  • m_total - Weight of the attached total load including end effector. Unit: [kg].
  • F_x_Ctotal - Translation from flange to center of mass of the attached total load. Unit: [m].
Return

Coriolis force vector.

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

Arguments
  • robot_state - State from which the Coriolis force vector should be calculated.
Return

Coriolis force vector.

Calculates the gravity vector. Unit: [Nm].

Arguments
  • q - Joint position.
  • m_total - Weight of the attached total load including end effector. Unit: [kg].
  • F_x_Ctotal - Translation from flange to center of mass of the attached total load. Unit: [m].
  • gravity_earth - Earth’s gravity vector. Unit: [m / s^2] Default to [0.0, 0.0, -9.81].
Return

Gravity vector.

Calculates the gravity vector. Unit: [Nm].

Arguments
  • robot_state - State from which the gravity vector should be calculated.
  • gravity_earth - Earth’s gravity vector. Unit: [m / s^2]. By default gravity_earth will be calculated from RobotState::O_ddP_O.
Return

Gravity vector.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.