Skip to main content

ImpedanceOptions

Struct ImpedanceOptions 

Source
pub struct ImpedanceOptions {
Show 13 fields pub gains: ImpedanceGains, pub torque_limits: [f64; 7], pub cutoff_frequency: f64, pub posture: Option<[f64; 7]>, pub ik: IkOptions, pub velocity_feedforward: bool, pub velocity_feedforward_gain: f64, pub velocity_feedforward_cutoff: f64, pub leash: Leash, pub project_joint_gains: bool, pub joint_velocity_fraction: f64, pub velocity_barrier_fraction: f64, pub joint_position_margin: f64,
}
Expand description

Options of Backend::Impedance; cartesian and joint are the documented starting points and the with_* methods change one field each.

Fields§

§gains: ImpedanceGains

The gains of the law.

§torque_limits: [f64; 7]

Per-joint clamp on the commanded torque, Nm, at most RATED_TORQUES. Default 86 on joints 1-4, 11.5 on 5-7.

§cutoff_frequency: f64

Cutoff, Hz, of the crate’s first-order low-pass on the commanded torque; MAX_CUTOFF_FREQUENCY switches it off. Default 100.

§posture: Option<[f64; 7]>

The configuration the Cartesian IK’s nullspace bias pulls toward; None, the default, is the configuration the loop starts in. Ignored by the joint interface.

§ik: IkOptions

The Cartesian interface’s inverse kinematics. Ignored by the joint interface.

§velocity_feedforward: bool

Whether the damping acts on the velocity error, Kd (dq_goal - dq), with dq_goal the goal’s velocity, its own finite difference on both interfaces (of the boxed step on the joint one, of the IK solution on the Cartesian one), so a goal held at the leash feeds nothing forward; false damps the absolute velocity, DROID parity, and a goal moving at v is then tracked Kd v / Kp behind. Default false: on real arms the full feedforward shook them, since dq_goal is a finite difference (of the IK solution on the Cartesian interface) and Kd carries its noise into the torque. Try velocity_feedforward_cutoff against that ripple when switching it on.

§velocity_feedforward_gain: f64

Weight of the goal velocity in the damping term when velocity_feedforward is on, in [0, 1]. At 1 the damping acts on the velocity error dq_goal - dq, so a joint at steady speed needs no lag; at 0 it acts on -dq alone and holding speed v costs a standing error of (Kqd / Kq) v, which a leash then caps into a speed limit. Values between trade that lag against how much of the goal’s own ripple the law forwards. Default 1, so switching the feedforward on means all of it.

§velocity_feedforward_cutoff: f64

Cutoff, Hz, of a first-order low-pass on dq_goal before it is fed forward; MAX_CUTOFF_FREQUENCY switches it off. The feedforward carries the joint reference’s ripple into the torque, so bounding its bandwidth keeps the lead without the ripple. Default off.

§leash: Leash

How far the desired state may run ahead of the measured one; see Leash.

§project_joint_gains: bool

Whether the joint gains are projected into the nullspace of the Jacobian (N Kq N, N Kqd N, N = I - J⁺ J with the damped pseudoinverse of IkOptions::damping), so that the Cartesian gains alone are felt at the end effector; false leaves them unprojected, DROID parity. For the Cartesian interface: projected joint gains hold the nullspace only, so with zero Cartesian gains the end effector would be free. Default false.

§joint_velocity_fraction: f64

The fraction of the arm’s joint velocity limits (max_joint_velocity, which narrows toward the position limits on the FR3 and is flat on the FER) the joint goal may move at: a goal step that would move any joint faster is scaled down as a whole, keeping its direction. A joint measured faster, or faster than FADE_BAND under velocity_barrier_fraction if that is lower, keeps less of the law’s torque along its motion. In (0, 1]. Default 0.7.

§velocity_barrier_fraction: f64

The fraction of the joint velocity limits above which a measured joint velocity meets the velocity barrier, VELOCITY_BARRIER_GAIN Nm per rad/s of the excess opposing it, at most the joint’s torque limit, and none of the law’s torque along it. In [joint_velocity_fraction, 1]. Default 0.85.

§joint_position_margin: f64

How far, rad, the joint goal keeps from the joint position limits. Toward a limit the goal brakes to stop here along a braking profile built on half the FER’s joint acceleration limit, the FR3’s published ddq_dec on the FR3, under its velocity limit; a joint measured inside keeps less and less of the law’s torque toward the limit over POSITION_FADE_BAND, and beyond that meets a spring of POSITION_BARRIER_STIFFNESS and the velocity barrier with its onset brought down to the same envelope. Joint targets and postures inside it are refused. In [0.035, 0.5]. Default 0.05.

Implementations§

Source§

impl ImpedanceOptions

Source

pub fn cartesian() -> Self

The defaults of the Cartesian interface: ImpedanceGains::CARTESIAN.

Source

pub fn joint() -> Self

The defaults of the joint interface: ImpedanceGains::JOINT.

Source

pub fn with_gains(self, gains: ImpedanceGains) -> Self

Sets the gains.

Source

pub fn with_torque_limits(self, limits: [f64; 7]) -> Self

Sets the per-joint torque clamp, Nm.

Source

pub fn with_cutoff_frequency(self, hertz: f64) -> Self

Sets the torque low-pass cutoff, Hz.

Source

pub fn with_posture(self, posture: Option<[f64; 7]>) -> Self

Sets the IK’s posture (None: the start configuration).

Source

pub fn with_ik(self, ik: IkOptions) -> Self

Sets the IK options.

Source

pub fn with_velocity_feedforward(self, on: bool) -> Self

Switches the damping between the velocity error (true) and the absolute velocity.

Source

pub fn with_velocity_feedforward_gain(self, gain: f64) -> Self

Source

pub fn with_velocity_feedforward_cutoff(self, hertz: f64) -> Self

Source

pub fn with_leash(self, leash: Leash) -> Self

Sets the leash.

Source

pub fn with_project_joint_gains(self, on: bool) -> Self

Switches the projection of the joint gains into the Jacobian’s nullspace.

Source

pub fn with_joint_velocity_fraction(self, fraction: f64) -> Self

Sets the fraction of the joint velocity limits the goal may move at.

Source

pub fn with_velocity_barrier_fraction(self, fraction: f64) -> Self

Sets the fraction of the joint velocity limits the velocity barrier starts at.

Source

pub fn with_joint_position_margin(self, margin: f64) -> Self

Sets the distance, rad, the joint goal keeps from the joint position limits.

Source

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

Checks the options without starting anything.

§Errors

FrankaError::InvalidArgument naming the field: a gain that is not finite or negative, a torque limit, cutoff frequency or leash that is not finite and positive, a posture that is not finite, a joint_velocity_fraction outside (0, 1] or a velocity_barrier_fraction outside [joint_velocity_fraction, 1], a joint_position_margin outside [0.035, 0.5], or invalid IkOptions.

Trait Implementations§

Source§

impl Clone for ImpedanceOptions

Source§

fn clone(&self) -> ImpedanceOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ImpedanceOptions

Source§

impl Debug for ImpedanceOptions

Source§

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

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

impl PartialEq for ImpedanceOptions

Source§

fn eq(&self, other: &ImpedanceOptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ImpedanceOptions

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.