Skip to main content

Module model

Module model 

Source
Expand description

Kinematics and dynamics of the arm, mirroring libfranka’s franka::Model.

Model is a port of franka::Model (include/franka/model.h, src/model.cpp); it is a thin dispatch layer over a RobotModelBackend, the equivalent of libfranka’s franka::RobotModelBase. The default backend is native_backend::NativeBackend, a serial-chain implementation that reproduces libfranka’s Pinocchio-based franka::RobotModel bit-for-bit within 1e-9 (kinematics) and 1e-6 (dynamics).

§Matrix layouts

  • 4x4 poses are vectorised column-major ([f64; 16]).
  • Jacobians are 6x7 column-major ([f64; 42]); within a column the rows are the linear parts vx, vy, vz first and the angular parts wx, wy, wz second. This is Pinocchio’s Motion layout, which is what libfranka copies out of Eigen verbatim.
  • The mass matrix is 7x7 column-major ([f64; 49]); it is symmetric.

§Example

use franka::model::{Frame, Model};
use franka::robot_state::RobotState;

let urdf = std::fs::read_to_string("fr3.urdf").unwrap();
let model = Model::from_urdf(&urdf).unwrap();
let state = RobotState::default();
let o_t_ee = model.pose(Frame::EndEffector, &state);
let gravity = model.gravity(&state);

Re-exports§

pub use model_library::load_from_robot;
pub use native_backend::NativeBackend;

Modules§

model_library
Downloading and loading the FCI v5 (Franka Emika Robot, FER) model library.
native_backend
Native serial-chain rigid-body backend.

Structs§

Model
Poses of the joints and dynamic properties of the robot.

Enums§

Frame
The seven joints, the flange, the end effector and the stiffness frame.

Constants§

DEFAULT_GRAVITY_EARTH
Earth’s gravity used by Model::coriolis, matching libfranka’s RobotModel::coriolis fallback of {0, 0, -9.81}.
FER_URDF
The Franka Emika Robot (FER)’s arm, as a URDF the native_backend can evaluate.
FR3_URDF
The FR3 URDF from franka_description that the tests and franka-rerun replays use.

Traits§

RobotModelBackend
Rigid-body model backend.