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: BackendWhat 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: ControllerModeThe robot’s internal controller, with Backend::RobotController only. Default
ControllerMode::JointImpedance.
max_deviation: f64How 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: SettleWhen a stop counts as settled. Default 1 mrad for 250 cycles.
limit_rate: boolWhether 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
impl JointTargetControlOptions
Sourcepub fn scaled_limits(version: FciVersion, fraction: f64) -> [OtgLimits; 7]
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.
Sourcepub fn with_limits(self, limits: [OtgLimits; 7]) -> Self
pub fn with_limits(self, limits: [OtgLimits; 7]) -> Self
Sets the per-joint limits.
Sourcepub fn with_backend(self, backend: Backend) -> Self
pub fn with_backend(self, backend: Backend) -> Self
Sets the backend.
Sourcepub fn with_controller_mode(self, mode: ControllerMode) -> Self
pub fn with_controller_mode(self, mode: ControllerMode) -> Self
Sets the robot’s internal controller (Backend::RobotController only).
Sourcepub fn with_max_deviation(self, radians: f64) -> Self
pub fn with_max_deviation(self, radians: f64) -> Self
Sets the deviation guard, rad.
Sourcepub fn with_settle(self, settle: Settle) -> Self
pub fn with_settle(self, settle: Settle) -> Self
Sets the settle criterion.
Sourcepub fn with_limit_rate(self, limit_rate: bool) -> Self
pub fn with_limit_rate(self, limit_rate: bool) -> Self
Switches the backstop and the loop’s limiter.
Sourcepub fn with_realtime_priority(self, priority: Option<i32>) -> Self
pub fn with_realtime_priority(self, priority: Option<i32>) -> Self
Sets the loop thread’s SCHED_FIFO priority (None: the highest).
Sourcepub fn with_observer(
self,
observer: impl FnMut(&RobotState, &JointSent) + Send + 'static,
) -> Self
pub fn with_observer( self, observer: impl FnMut(&RobotState, &JointSent) + Send + 'static, ) -> Self
Installs the observer.
Sourcepub fn validate(&self) -> FrankaResult<()>
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
impl Debug for JointTargetControlOptions
Auto Trait Implementations§
impl !RefUnwindSafe for JointTargetControlOptions
impl !Sync for JointTargetControlOptions
impl !UnwindSafe for JointTargetControlOptions
impl Freeze for JointTargetControlOptions
impl Send for JointTargetControlOptions
impl Unpin for JointTargetControlOptions
impl UnsafeUnpin for JointTargetControlOptions
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.