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>
impl<'a, T: ActiveMotionInput> ActiveMotionGenerator<'a, T>
Sourcepub fn read_once(&mut self) -> FrankaResult<(RobotState, Duration)>
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).
Sourcepub fn write_once(
&mut self,
motion_input: &T,
control_input: Option<&Torques>,
) -> FrankaResult<()>
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> 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.