Skip to main content

Module model_library

Module model_library 

Source
Expand description

Downloading and loading the FCI v5 (Franka Emika Robot, FER) model library.

model_library::load_from_robot exists in every configuration so that callers need no cfg of their own; the dlopen-based backend behind it is the opt-in model-library Cargo feature, which pulls in libloading. Without that feature the crate builds with the URDF-based native_backend only and load_from_robot reports a crate::FrankaError::Model. Downloading the FCI v5 model library from the robot (LoadModelLibrary).

Port of franka::LibraryDownloader (src/library_downloader.{h,cpp}, libfranka 0.9.2). On FCI v5 the robot has no URDF to hand out; instead it serves a compiled model for the architecture and operating system the client asks for, and libfranka dlopens it. The download is a single command on the ordinary TCP command socket:

  • request: u8 architecture, u8 system (2 bytes),
  • response: u8 status, followed by the shared object as the message tail (header.size - 13 bytes: the 12-byte command header plus the status byte are subtracted).

With the opt-in model-library feature, load_from_robot performs that exchange and hands the bytes to SoModelBackend::from_bytes; the offline entry points Model::from_model_library_bytes and Model::from_model_library_path skip the network. Without the feature, load_from_robot returns an error without requesting any bytes.

Functionsยง

load_from_robot
load_from_robot as compiled without the model-library feature.