pub struct Robot { /* private fields */ }Expand description
Maintains a network connection to the robot, provides the current robot state, gives access to the robot model and allows to control the robot.
Port of franka::Robot.
Implementations§
Source§impl Robot
impl Robot
Sourcepub fn start_cartesian_target_control(
self: &Arc<Self>,
options: TargetControlOptions,
) -> FrankaResult<CartesianTargetControl>
pub fn start_cartesian_target_control( self: &Arc<Self>, options: TargetControlOptions, ) -> FrankaResult<CartesianTargetControl>
Starts a Cartesian target control loop on its own thread and returns once its first
cycle has anchored on the current pose (the model’s pose of the measured configuration
with Backend::Impedance, the commanded one with Backend::RobotController); see
the module documentation.
§Errors
FrankaError::InvalidArgument if the options are invalid,
FrankaError::Realtime if the loop thread cannot be raised to SCHED_FIFO under
RealtimeConfig::Enforce, whatever Robot::load_model fails with under
Backend::Impedance, and whatever Robot::control_torques or
Robot::control_cartesian_pose fails with before its first cycle,
FrankaError::InvalidOperation if another control or read operation is running
among them.
Sourcepub fn start_joint_target_control(
self: &Arc<Self>,
options: JointTargetControlOptions,
) -> FrankaResult<JointTargetControl>
pub fn start_joint_target_control( self: &Arc<Self>, options: JointTargetControlOptions, ) -> FrankaResult<JointTargetControl>
Starts a joint target control loop on its own thread and returns once its first cycle has anchored on the current joint positions; see the module documentation.
§Errors
As Robot::start_cartesian_target_control, with
Robot::control_joint_positions as the Backend::RobotController loop.
Source§impl Robot
impl Robot
Sourcepub fn start_torque_control(&self) -> FrankaResult<ActiveTorqueControl<'_>>
pub fn start_torque_control(&self) -> FrankaResult<ActiveTorqueControl<'_>>
Starts an external torque control process driven by
ActiveTorqueControl::read_once / ActiveTorqueControl::write_once.
§Errors
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Control if a motion is already running on the robot.
Sourcepub fn start_joint_position_control(
&self,
controller_mode: MoveControllerMode,
) -> FrankaResult<ActiveMotionGenerator<'_, JointPositions>>
pub fn start_joint_position_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, JointPositions>>
Starts an externally driven joint position motion.
Sourcepub fn start_joint_velocity_control(
&self,
controller_mode: MoveControllerMode,
) -> FrankaResult<ActiveMotionGenerator<'_, JointVelocities>>
pub fn start_joint_velocity_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, JointVelocities>>
Starts an externally driven joint velocity motion.
Sourcepub fn start_cartesian_pose_control(
&self,
controller_mode: MoveControllerMode,
) -> FrankaResult<ActiveMotionGenerator<'_, CartesianPose>>
pub fn start_cartesian_pose_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, CartesianPose>>
Starts an externally driven Cartesian pose motion.
Sourcepub fn start_cartesian_velocity_control(
&self,
controller_mode: MoveControllerMode,
) -> FrankaResult<ActiveMotionGenerator<'_, CartesianVelocities>>
pub fn start_cartesian_velocity_control( &self, controller_mode: MoveControllerMode, ) -> FrankaResult<ActiveMotionGenerator<'_, CartesianVelocities>>
Starts an externally driven Cartesian velocity motion.
Source§impl Robot
impl Robot
Sourcepub fn control_torques<C>(
&self,
control_callback: C,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>
pub fn control_torques<C>( &self, control_callback: C, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>
Starts a control loop for sending joint-level torque commands.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to torque control or motion generation
occurred,
FrankaError::InvalidArgument if joint-level torque commands are NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
§FCI v5
An FER has no torque-only motion generator mode, so this runs libfranka 0.9.2’s scheme
(src/robot.cpp:41-57): a joint-velocity motion generator commanding all-zero
velocities alongside the external controller, ended with motion_generation_finished.
The two callbacks are also evaluated in 0.9.2’s order (motion first, controller
short-circuited) rather than 0.21.2’s.
Sourcepub fn control_torques_and_joint_positions<C, M>(
&self,
control_callback: C,
motion_callback: M,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>where
C: FnMut(&RobotState, Duration) -> Torques,
M: FnMut(&RobotState, Duration) -> JointPositions,
pub fn control_torques_and_joint_positions<C, M>(
&self,
control_callback: C,
motion_callback: M,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>where
C: FnMut(&RobotState, Duration) -> Torques,
M: FnMut(&RobotState, Duration) -> JointPositions,
Starts a control loop for a joint position motion generator with an external controller.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to torque control or motion generation
occurred,
FrankaError::InvalidArgument if joint-level torque or joint position commands are
NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
§FCI v5
On an FER the first setpoint of the motion is rate limited against the robot’s own
q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion
(src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first
setpoint is its own reference and therefore passes the limiter unchanged, which is
libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from
(close to) the current pose either way.
Sourcepub fn control_torques_and_joint_velocities<C, M>(
&self,
control_callback: C,
motion_callback: M,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>where
C: FnMut(&RobotState, Duration) -> Torques,
M: FnMut(&RobotState, Duration) -> JointVelocities,
pub fn control_torques_and_joint_velocities<C, M>(
&self,
control_callback: C,
motion_callback: M,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>where
C: FnMut(&RobotState, Duration) -> Torques,
M: FnMut(&RobotState, Duration) -> JointVelocities,
Starts a control loop for a joint velocity motion generator with an external controller.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to torque control or motion generation
occurred,
FrankaError::InvalidArgument if joint-level torque or joint velocity commands are
NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
Sourcepub fn control_torques_and_cartesian_pose<C, M>(
&self,
control_callback: C,
motion_callback: M,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>
pub fn control_torques_and_cartesian_pose<C, M>( &self, control_callback: C, motion_callback: M, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>
Starts a control loop for a Cartesian pose motion generator with an external controller.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to torque control or motion generation
occurred,
FrankaError::InvalidArgument if joint-level torque or Cartesian pose command elements
are NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
§FCI v5
On an FER the first setpoint of the motion is rate limited against the robot’s own
q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion
(src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first
setpoint is its own reference and therefore passes the limiter unchanged, which is
libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from
(close to) the current pose either way.
Sourcepub fn control_torques_and_cartesian_velocities<C, M>(
&self,
control_callback: C,
motion_callback: M,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>where
C: FnMut(&RobotState, Duration) -> Torques,
M: FnMut(&RobotState, Duration) -> CartesianVelocities,
pub fn control_torques_and_cartesian_velocities<C, M>(
&self,
control_callback: C,
motion_callback: M,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>where
C: FnMut(&RobotState, Duration) -> Torques,
M: FnMut(&RobotState, Duration) -> CartesianVelocities,
Starts a control loop for a Cartesian velocity motion generator with an external controller.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to torque control or motion generation
occurred,
FrankaError::InvalidArgument if joint-level torque or Cartesian velocity command
elements are NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
Sourcepub fn control_joint_positions<M>(
&self,
motion_callback: M,
controller_mode: ControllerMode,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>
pub fn control_joint_positions<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>
Starts a control loop for a joint position motion generator with one of the robot’s internal controllers.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to motion generation occurred,
FrankaError::InvalidArgument if joint position commands are NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
§FCI v5
On an FER the first setpoint of the motion is rate limited against the robot’s own
q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion
(src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first
setpoint is its own reference and therefore passes the limiter unchanged, which is
libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from
(close to) the current pose either way.
Sourcepub fn control_joint_velocities<M>(
&self,
motion_callback: M,
controller_mode: ControllerMode,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>
pub fn control_joint_velocities<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>
Starts a control loop for a joint velocity motion generator with one of the robot’s internal controllers.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to motion generation occurred,
FrankaError::InvalidArgument if joint velocity commands are NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
Sourcepub fn control_cartesian_pose<M>(
&self,
motion_callback: M,
controller_mode: ControllerMode,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>
pub fn control_cartesian_pose<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>
Starts a control loop for a Cartesian pose motion generator with one of the robot’s internal controllers.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to motion generation occurred,
FrankaError::InvalidArgument if Cartesian pose command elements are NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
§FCI v5
On an FER the first setpoint of the motion is rate limited against the robot’s own
q_d / O_T_EE_c like every other one, because libfranka 0.9.2’s convertMotion
(src/control_loop.cpp:188-205) has no initialized_filter_. On an FR3 the first
setpoint is its own reference and therefore passes the limiter unchanged, which is
libfranka 0.21.2’s behaviour (src/control_loop.cpp:194-200). Start an FER motion from
(close to) the current pose either way.
Sourcepub fn control_cartesian_velocities<M>(
&self,
motion_callback: M,
controller_mode: ControllerMode,
limit_rate: bool,
cutoff_frequency: f64,
) -> FrankaResult<()>
pub fn control_cartesian_velocities<M>( &self, motion_callback: M, controller_mode: ControllerMode, limit_rate: bool, cutoff_frequency: f64, ) -> FrankaResult<()>
Starts a control loop for a Cartesian velocity motion generator with one of the robot’s internal controllers.
limit_rate enables the client-side rate limiter and cutoff_frequency the first-order
low-pass filter applied to the commanded signal (pass
crate::lowpass_filter::MAX_CUTOFF_FREQUENCY to disable the filter).
libfranka 0.21 default: false (0.9: true); pass true to enable the client-side
limiter – it could distort your motion. libfranka’s cutoff_frequency default is
crate::lowpass_filter::DEFAULT_CUTOFF_FREQUENCY. Rust has no default arguments, so
both are always passed explicitly here.
§Errors
FrankaError::Control if an error related to motion generation occurred,
FrankaError::InvalidArgument if Cartesian velocity command elements are NaN or infinity,
FrankaError::InvalidOperation if another control or read operation is running,
FrankaError::Network if the connection is lost, e.g. after a timeout. Unlike
libfranka’s control this never fails with FrankaError::Realtime: realtime priority
is raised in Robot::new, matching libfranka’s Robot::Impl constructor.
Source§impl Robot
impl Robot
Sourcepub fn new(
franka_address: &str,
realtime_config: RealtimeConfig,
) -> FrankaResult<Robot>
pub fn new( franka_address: &str, realtime_config: RealtimeConfig, ) -> FrankaResult<Robot>
Establishes a connection with the robot.
franka_address is the IP/hostname of the robot, optionally with a ":port" suffix;
without one the FCI command port 1337 is used.
§Errors
FrankaError::Network if the connection could not be established,
FrankaError::IncompatibleVersion if the robot speaks another FCI version,
FrankaError::Realtime with RealtimeConfig::Enforce if realtime priority or a
realtime kernel is unavailable.
Sourcepub fn new_with_log_size(
franka_address: &str,
realtime_config: RealtimeConfig,
log_size: usize,
) -> FrankaResult<Robot>
pub fn new_with_log_size( franka_address: &str, realtime_config: RealtimeConfig, log_size: usize, ) -> FrankaResult<Robot>
Robot::new with an explicit size for the control log that is attached to a
crate::error::ControlException; 0 disables logging.
Sourcepub fn with_options(
franka_address: &str,
options: RobotOptions,
) -> FrankaResult<Robot>
pub fn with_options( franka_address: &str, options: RobotOptions, ) -> FrankaResult<Robot>
Robot::new with an explicit RobotOptions, which is how a Franka Emika Robot (FER)
(FCI v5) is connected.
§Example
use franka::{FciVersion, RealtimeConfig, Robot, RobotOptions, VersionPolicy};
let options = RobotOptions::new(RealtimeConfig::Ignore)
.with_version(VersionPolicy::Exact(FciVersion::V5));
let robot = Robot::with_options("192.168.0.1", options)?;
assert_eq!(robot.fci_version(), FciVersion::V5);Sourcepub fn server_version(&self) -> u16
pub fn server_version(&self) -> u16
Returns the software version reported by the connected server.
Sourcepub fn fci_version(&self) -> FciVersion
pub fn fci_version(&self) -> FciVersion
The FCI protocol version this connection negotiated.
Sourcepub fn read_once(&self) -> FrankaResult<RobotState>
pub fn read_once(&self) -> FrankaResult<RobotState>
Waits for a robot state arriving over the UDP stream and returns it.
Unlike Robot::read this does not take the control lock, so it can be called while
nothing else is running.
Sourcepub fn read<F: FnMut(&RobotState) -> bool>(
&self,
read_callback: F,
) -> FrankaResult<()>
pub fn read<F: FnMut(&RobotState) -> bool>( &self, read_callback: F, ) -> FrankaResult<()>
Starts a loop for reading the current robot state.
The callback is invoked for every received state; returning false ends the loop.
§Errors
FrankaError::InvalidOperation if another control or read operation is running.
Sourcepub fn robot_model(&self) -> FrankaResult<String>
pub fn robot_model(&self) -> FrankaResult<String>
Returns the robot’s URDF model as a string (GetRobotModel).
§Errors
FrankaError::InvalidOperation on FCI v5, which has no GetRobotModel; an FER
serves its model as a shared object, so use Robot::load_model there.
Sourcepub fn load_model(&self) -> FrankaResult<Model>
pub fn load_model(&self) -> FrankaResult<Model>
Loads the kinematic and dynamic model of the connected robot.
Neither version downloads executable code:
- FCI v10 (FR3) asks the robot for its URDF (
GetRobotModel) and evaluates it with the native backend. - FCI v5 (FER) has no
GetRobotModel, and this returnsModel::native_fer— the same native backend over the built-incrate::model::FER_URDF, whose inertial parameters were identified from an FER’s ownlibfcimodels_x64.so. Nothing is fetched, so this cannot fail, needs nomodel-libraryfeature and works on any host.
Use Robot::load_model_from_robot to download and dlopen the FER’s
own shared object instead, which is what libfranka 0.9.2 does and what
franka-rs did before. The two agree on kinematics to 9e-16 and on gravity
to 5e-14; with a payload attached their mass matrices differ by up to
3e-3 kg m^2, because the shared object’s M_NE is not a rigid-body model
of the payload. See docs/book/src/reference/model.md.
§Errors
FrankaError::Model if the model cannot be obtained or parsed;
FrankaError::Network / FrankaError::Protocol for the usual
command-socket failures. On FCI v5 none of these can happen.
Sourcepub fn load_model_from_robot(&self) -> FrankaResult<Model>
pub fn load_model_from_robot(&self) -> FrankaResult<Model>
Loads the model the robot itself serves.
On FCI v10 this is Robot::load_model exactly: an FR3 serves a URDF.
On FCI v5 it is libfranka 0.9.2’s behaviour — LoadModelLibrary
downloads libfcimodels.so and the client dlopens it.
§Security
On FCI v5 (FER) this downloads a shared object served by the robot,
writes it to a temporary file and dlopens it — that is, it executes
native code chosen by the FCI peer, in this process, with this process’s
privileges. Nothing validates the blob: the command socket is plaintext
TCP with no authentication, and there is no signature to check.
This is deliberate, and it is exactly what libfranka 0.9.2 does
(franka::Model::Model(Network&) -> LibraryDownloader ->
LibraryLoader): the FCI peer is already fully trusted, because it is
the thing that commands the arm. Anyone who can impersonate the robot on
this socket can already move it. So the method stays safe, like
libfranka’s, and the trust boundary is the network you put the robot on:
give the FCI its own isolated link, as Franka’s own setup guide requires.
To opt out, use Robot::load_model, which needs no download at all, or
build without the default model-library feature — then this method
returns FrankaError::Model on an FER instead of loading anything,
and libloading is not linked at all. FCI v10 is unaffected either way:
an FR3 serves a URDF, which is parsed, not executed.
Model::from_model_library_bytes and Model::from_model_library_path
(both model-library only) expose the same load as unsafe fns, for
callers who supply the bytes themselves.
§Errors
FrankaError::Model if the model cannot be obtained, parsed, saved or
loaded; FrankaError::Network / FrankaError::Protocol for the
usual command-socket failures.
Sourcepub fn set_filters(
&self,
joint_position_filter_frequency: f64,
joint_velocity_filter_frequency: f64,
cartesian_position_filter_frequency: f64,
cartesian_velocity_filter_frequency: f64,
controller_filter_frequency: f64,
) -> FrankaResult<()>
pub fn set_filters( &self, joint_position_filter_frequency: f64, joint_velocity_filter_frequency: f64, cartesian_position_filter_frequency: f64, cartesian_velocity_filter_frequency: f64, controller_filter_frequency: f64, ) -> FrankaResult<()>
Sets the cut-off frequencies of the robot-side filters, in hertz (Robot::setFilters).
§Errors
FrankaError::InvalidOperation on FCI v10, which dropped the command;
FrankaError::Command if the robot rejected it.
Sourcepub fn virtual_wall(&self, id: i32) -> FrankaResult<VirtualWallCuboid>
pub fn virtual_wall(&self, id: i32) -> FrankaResult<VirtualWallCuboid>
Returns the parameters of the virtual wall with the given id
(Robot::getVirtualWall).
§Errors
FrankaError::InvalidOperation on FCI v10, which dropped the command;
FrankaError::Command if the robot rejected it.
Sourcepub fn stop(&self) -> FrankaResult<()>
pub fn stop(&self) -> FrankaResult<()>
Stops all currently running motions.
Can be called from a second thread while a control loop is running; the control loop
then fails with a FrankaError::Control carrying
"libfranka: Move command preempted!".
§Errors
FrankaError::Command if the robot rejected the StopMove.
Sourcepub fn automatic_error_recovery(&self) -> FrankaResult<()>
pub fn automatic_error_recovery(&self) -> FrankaResult<()>
Runs automatic error recovery on the robot, clearing the errors of a reflex or a collision so that a new motion can be started.
§Errors
FrankaError::Command if the robot rejected the command, e.g. because manual error
recovery is required.
Sourcepub fn set_collision_behavior(
&self,
lower_torque_thresholds_acceleration: [f64; 7],
upper_torque_thresholds_acceleration: [f64; 7],
lower_torque_thresholds_nominal: [f64; 7],
upper_torque_thresholds_nominal: [f64; 7],
lower_force_thresholds_acceleration: [f64; 6],
upper_force_thresholds_acceleration: [f64; 6],
lower_force_thresholds_nominal: [f64; 6],
upper_force_thresholds_nominal: [f64; 6],
) -> FrankaResult<()>
pub fn set_collision_behavior( &self, lower_torque_thresholds_acceleration: [f64; 7], upper_torque_thresholds_acceleration: [f64; 7], lower_torque_thresholds_nominal: [f64; 7], upper_torque_thresholds_nominal: [f64; 7], lower_force_thresholds_acceleration: [f64; 6], upper_force_thresholds_acceleration: [f64; 6], lower_force_thresholds_nominal: [f64; 6], upper_force_thresholds_nominal: [f64; 6], ) -> FrankaResult<()>
Changes the collision behavior.
Set separate torque and force boundaries for acceleration/deceleration and constant velocity movement phases. Forces or torques between lower and upper threshold are shown as contacts in the robot state; above the upper threshold the robot stops and enters an error state.
§Errors
FrankaError::Command if the robot rejected the command.
Sourcepub fn set_collision_behavior_simple(
&self,
lower_torque_thresholds: [f64; 7],
upper_torque_thresholds: [f64; 7],
lower_force_thresholds: [f64; 6],
upper_force_thresholds: [f64; 6],
) -> FrankaResult<()>
pub fn set_collision_behavior_simple( &self, lower_torque_thresholds: [f64; 7], upper_torque_thresholds: [f64; 7], lower_force_thresholds: [f64; 6], upper_force_thresholds: [f64; 6], ) -> FrankaResult<()>
Robot::set_collision_behavior with the same thresholds for the acceleration and the
constant velocity phase.
Sourcepub fn set_joint_impedance(&self, K_theta: [f64; 7]) -> FrankaResult<()>
pub fn set_joint_impedance(&self, K_theta: [f64; 7]) -> FrankaResult<()>
Sets the impedance for each joint in the internal controller [Nm/rad].
User-provided torques are not affected by this setting.
Sourcepub fn set_cartesian_impedance(&self, K_x: [f64; 6]) -> FrankaResult<()>
pub fn set_cartesian_impedance(&self, K_x: [f64; 6]) -> FrankaResult<()>
Sets the Cartesian impedance for (x, y, z, roll, pitch, yaw) in the internal controller.
User-provided torques are not affected by this setting.
Sourcepub fn set_guiding_mode(
&self,
guiding_mode: [bool; 6],
elbow: bool,
) -> FrankaResult<()>
pub fn set_guiding_mode( &self, guiding_mode: [bool; 6], elbow: bool, ) -> FrankaResult<()>
Locks or unlocks guiding mode movement in (x, y, z, roll, pitch, yaw).
If elbow is true the elbow is locked and the flag for the 3rd and 5th joint is
ignored.
Sourcepub fn set_k(&self, EE_T_K: [f64; 16]) -> FrankaResult<()>
pub fn set_k(&self, EE_T_K: [f64; 16]) -> FrankaResult<()>
Sets the transformation from the end effector frame EE to the stiffness frame K,
column-major.
Sourcepub fn set_ee(&self, NE_T_EE: [f64; 16]) -> FrankaResult<()>
pub fn set_ee(&self, NE_T_EE: [f64; 16]) -> FrankaResult<()>
Sets the transformation from the nominal end effector frame NE to the end effector
frame EE, column-major.
The transformation from flange to NE is set in Desk.
Sourcepub fn set_load(
&self,
load_mass: f64,
F_x_Cload: [f64; 3],
load_inertia: [f64; 9],
) -> FrankaResult<()>
pub fn set_load( &self, load_mass: f64, F_x_Cload: [f64; 3], load_inertia: [f64; 9], ) -> FrankaResult<()>
Sets dynamic parameters of a payload: mass in [kg], centre of mass in the flange frame and the inertia matrix with respect to the centre of mass, column-major.
This is not for setting end effector parameters, which have to be set in the administrator’s interface.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Robot
impl RefUnwindSafe for Robot
impl Send for Robot
impl Sync for Robot
impl Unpin for Robot
impl UnsafeUnpin for Robot
impl UnwindSafe for Robot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.