Struct franka::model::Model[][src]

pub struct Model { /* fields omitted */ }

Calculates poses of joints and dynamic properties of the robot.

Implementations

impl Model[src]

pub fn new<S: AsRef<Path>>(
    model_filename: S,
    libm_filename: Option<&Path>
) -> FrankaResult<Self>
[src]

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> ¯_(ツ)_/¯

pub fn pose(
    &self,
    frame: &Frame,
    q: &[f64; 7],
    F_T_EE: &[f64; 16],
    EE_T_K: &[f64; 16]
) -> [f64; 16]
[src]

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.

pub fn pose_from_state(
    &self,
    frame: &Frame,
    robot_state: &RobotState
) -> [f64; 16]
[src]

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.

pub fn body_jacobian(
    &self,
    frame: &Frame,
    q: &[f64; 7],
    F_T_EE: &[f64; 16],
    EE_T_K: &[f64; 16]
) -> [f64; 42]
[src]

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.

pub fn body_jacobian_from_state(
    &self,
    frame: &Frame,
    robot_state: &RobotState
) -> [f64; 42]
[src]

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.

pub fn zero_jacobian(
    &self,
    frame: &Frame,
    q: &[f64; 7],
    F_T_EE: &[f64; 16],
    EE_T_K: &[f64; 16]
) -> [f64; 42]
[src]

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.

pub fn zero_jacobian_from_state(
    &self,
    frame: &Frame,
    robot_state: &RobotState
) -> [f64; 42]
[src]

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.

pub fn mass(
    &self,
    q: &[f64; 7],
    I_total: &[f64; 9],
    m_total: f64,
    F_x_Ctotal: &[f64; 3]
) -> [f64; 49]
[src]

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.

pub fn mass_from_state(&self, robot_state: &RobotState) -> [f64; 49][src]

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.

pub fn coriolis(
    &self,
    q: &[f64; 7],
    dq: &[f64; 7],
    I_total: &[f64; 9],
    m_total: f64,
    F_x_Ctotal: &[f64; 3]
) -> [f64; 7]
[src]

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.

pub fn coriolis_from_state(&self, robot_state: &RobotState) -> [f64; 7][src]

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.

pub fn gravity<'a, Grav: Into<Option<&'a [f64; 3]>>>(
    &self,
    q: &[f64; 7],
    m_total: f64,
    F_x_Ctotal: &[f64; 3],
    gravity_earth: Grav
) -> [f64; 7]
[src]

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.

pub fn gravity_from_state<'a, Grav: Into<Option<&'a [f64; 3]>>>(
    &self,
    robot_state: &RobotState,
    gravity_earth: Grav
) -> [f64; 7]
[src]

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] Default to [0.0, 0.0, -9.81].

Return

Gravity vector.

Auto Trait Implementations

impl RefUnwindSafe for Model

impl Send for Model

impl Sync for Model

impl Unpin for Model

impl UnwindSafe for Model

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,