Skip to main content

ActiveMotionGenerator

Struct ActiveMotionGenerator 

Source
pub struct ActiveMotionGenerator<'a, T: ActiveMotionInput> { /* private fields */ }
Expand description

An externally driven motion generator (Robot::start_*_control).

T is one of JointPositions, JointVelocities, CartesianPose or CartesianVelocities.

§Threading

Unlike crate::Robot, which is Send + Sync, this type is !Send: it holds the std::sync::MutexGuard for the robot’s control lock (franka::assertOwningLock) for as long as the motion runs, and a MutexGuard may not cross threads. Read and write the motion from the thread that started it; a crate::Robot::stop from another thread still works, because it goes through the Arc<Robot> and not through this handle.

Implementations§

Source§

impl<'a, T: ActiveMotionInput> ActiveMotionGenerator<'a, T>

Source

pub fn read_once(&mut self) -> FrankaResult<(RobotState, Duration)>

Waits for the next robot state and returns it together with the time elapsed since the previous read_once (zero on the first call).

Source

pub fn write_once( &mut self, motion_input: &T, control_input: Option<&Torques>, ) -> FrankaResult<()>

Sends the next motion setpoint, and the torques when the motion runs with an external controller.

control_input must be Some if and only if the motion was started with MoveControllerMode::ExternalController. Setting motion_finished on either input ends the control process.

§Errors

FrankaError::Control if the motion has already finished, if torques are given without an external controller (or missing with one), or if the motion was aborted; FrankaError::InvalidArgument for non-finite values, an invalid transformation matrix or an invalid elbow configuration.

Auto Trait Implementations§

§

impl<'a, T> !Send for ActiveMotionGenerator<'a, T>

§

impl<'a, T> Freeze for ActiveMotionGenerator<'a, T>

§

impl<'a, T> RefUnwindSafe for ActiveMotionGenerator<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Sync for ActiveMotionGenerator<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for ActiveMotionGenerator<'a, T>
where T: Unpin,

§

impl<'a, T> UnsafeUnpin for ActiveMotionGenerator<'a, T>

§

impl<'a, T> UnwindSafe for ActiveMotionGenerator<'a, T>
where T: UnwindSafe,

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.