Skip to main content

TargetControlOptions

Struct TargetControlOptions 

Source
pub struct TargetControlOptions {
    pub limits: OtgLimits,
    pub rotation_limits: OtgLimits,
    pub backend: Backend,
    pub controller_mode: ControllerMode,
    pub max_deviation: f64,
    pub max_angular_deviation: f64,
    pub settle: Settle,
    pub limit_rate: bool,
    pub realtime_priority: Option<i32>,
    pub observer: Option<CartesianObserver>,
}
Expand description

Options of Robot::start_cartesian_target_control; Default is the documented starting point and the with_* methods change one field each.

Fields§

§limits: OtgLimits

The translational budget as a norm: m/s, m/s^2, m/s^3. The generator gets OtgLimits::per_axis_for_norm(3) of it and the backstop the norm itself. Default 0.3, 0.5, 20: measured on a real FER, the robot’s joint-space continuity check refuses 2.5 m/s^2 near the ready pose and its collision threshold trips above about 1 m/s^2, so the default sits well below both.

§rotation_limits: OtgLimits

The rotational budget as a norm: rad/s, rad/s^2, rad/s^3; the generator gets libfranka’s pose-interface factor (0.99) of its per_axis_for_norm(3), the backstop applies that factor itself. Default 0.5, 1.0, 20: a fifth of the FR3’s velocity limit, validated on the simulator’s joint-side check only.

§backend: Backend

What turns the generator’s pose into a command: the crate’s impedance law sending torques, or a pose stream to the robot’s own controller. Default Backend::Impedance of ImpedanceOptions::cartesian.

§controller_mode: ControllerMode

The robot’s internal controller, with Backend::RobotController only. Default ControllerMode::CartesianImpedance.

§max_deviation: f64

How far, m, the measured O_T_EE position may stray from the start before the target is frozen and the loop ends with super::DEVIATION_MESSAGE. Default 0.30.

§max_angular_deviation: f64

How far, rad, the measured O_T_EE orientation may turn from the start before the same guard fires. Default 0.5.

§settle: Settle

When a stop counts as settled; the tolerance applies to the position in m and to the orientation error in rad alike. Default 1 mm and 1 mrad for 250 cycles.

§limit_rate: bool

Whether limit_rate_cartesian_pose runs under the two budgets as the backstop, with the loop’s own libfranka limiter behind it; with Backend::Impedance, whether the torque rate limiter runs. Default true.

§realtime_priority: Option<i32>

SCHED_FIFO priority for the loop thread; None is the highest, as in Robot::new.

§observer: Option<CartesianObserver>

Called every cycle on the realtime thread; see CartesianObserver.

Implementations§

Source§

impl TargetControlOptions

Source

pub fn with_limits(self, limits: OtgLimits) -> Self

Sets the translational norm budget.

Source

pub fn with_rotation_limits(self, limits: OtgLimits) -> Self

Sets the rotational norm budget (rad/s, rad/s^2, rad/s^3).

Source

pub fn with_backend(self, backend: Backend) -> Self

Sets the backend.

Source

pub fn with_controller_mode(self, mode: ControllerMode) -> Self

Sets the robot’s internal controller (Backend::RobotController only).

Source

pub fn with_max_deviation(self, metres: f64) -> Self

Sets the deviation guard on the position, m.

Source

pub fn with_max_angular_deviation(self, radians: f64) -> Self

Sets the deviation guard on the orientation, rad.

Source

pub fn with_settle(self, settle: Settle) -> Self

Sets the settle criterion.

Source

pub fn with_limit_rate(self, limit_rate: bool) -> Self

Switches the backstop and the loop’s limiter.

Source

pub fn with_realtime_priority(self, priority: Option<i32>) -> Self

Sets the loop thread’s SCHED_FIFO priority (None: the highest).

Source

pub fn with_observer( self, observer: impl FnMut(&RobotState, &CartesianSent) + Send + 'static, ) -> Self

Installs the observer.

Source

pub fn validate(&self) -> FrankaResult<()>

Checks the options without starting anything.

§Errors

crate::error::FrankaError::InvalidArgument naming the field.

Trait Implementations§

Source§

impl Debug for TargetControlOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TargetControlOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

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

§

fn to_subset(&self) -> Option<SS>

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.