Skip to main content

JointTargetControlOptions

Struct JointTargetControlOptions 

Source
pub struct JointTargetControlOptions {
    pub limits: Option<[OtgLimits; 7]>,
    pub backend: Backend,
    pub controller_mode: ControllerMode,
    pub max_deviation: f64,
    pub settle: Settle,
    pub limit_rate: bool,
    pub realtime_priority: Option<i32>,
    pub observer: Option<JointObserver>,
}
Expand description

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

Fields§

§limits: Option<[OtgLimits; 7]>

Per-joint limits, rad/s, rad/s^2, rad/s^3, for the generator and, with Backend::RobotController, the backstop alike. None, the default, is JointTargetControlOptions::scaled_limits of the negotiated FCI version at DEFAULT_LIMIT_FRACTION, resolved when the loop starts.

§backend: Backend

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

§controller_mode: ControllerMode

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

§max_deviation: f64

How far, rad, any measured joint may stray from its start before the target is frozen and the loop ends with super::DEVIATION_MESSAGE. Default 1.0.

§settle: Settle

When a stop counts as settled. Default 1 mrad for 250 cycles.

§limit_rate: bool

Whether limit_rate_joint_positions runs under the limits 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<JointObserver>

Called every cycle on the realtime thread; see JointObserver.

Implementations§

Source§

impl JointTargetControlOptions

Source

pub fn scaled_limits(version: FciVersion, fraction: f64) -> [OtgLimits; 7]

fraction of version’s joint limits: the FR3’s flat velocity caps or the FER’s MAX_JOINT_VELOCITY, and the version’s MAX_JOINT_ACCELERATION and MAX_JOINT_JERK.

Source

pub fn with_limits(self, limits: [OtgLimits; 7]) -> Self

Sets the per-joint limits.

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, radians: f64) -> Self

Sets the deviation guard, 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, &JointSent) + 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 JointTargetControlOptions

Source§

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

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

impl Default for JointTargetControlOptions

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.