pub struct Gear<C: SyncActuator> {
pub ctrl: C,
pub ratio: f32,
}Expand description
A gear component
§Gears
Fields§
§ctrl: CSteppercontrol for the motor of the bearing
ratio: f32Angle ration from motor to bearing (velocity_b / velocity_m)
Implementations§
Trait Implementations§
source§impl<C: SyncActuator> ActuatorParent for Gear<C>
impl<C: SyncActuator> ActuatorParent for Gear<C>
source§impl<'de, C> Deserialize<'de> for Gear<C>where
C: Deserialize<'de> + SyncActuator,
impl<'de, C> Deserialize<'de> for Gear<C>where
C: Deserialize<'de> + SyncActuator,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<C: SyncActuator> RatioActuatorParent for Gear<C>
impl<C: SyncActuator> RatioActuatorParent for Gear<C>
source§fn ratio(&self) -> f32
fn ratio(&self) -> f32
The linear ratio that defines the relation between the child and the parent component Read more
fn gamma_for_child(&self, parent_gamma: Gamma) -> Gamma
fn gamma_for_parent(&self, child_gamma: Gamma) -> Gamma
fn delta_for_chlid(&self, parent_delta: Delta) -> Delta
fn delta_for_parent(&self, child_delta: Delta) -> Delta
fn velocity_for_child(&self, parent_velocity: Velocity) -> Velocity
fn velocity_for_parent(&self, child_velocity: Velocity) -> Velocity
fn alpha_for_child(&self, parent_alpha: Acceleration) -> Acceleration
fn alpha_for_parent(&self, child_alpha: Acceleration) -> Acceleration
fn force_for_child(&self, parent_force: Force) -> Force
fn force_for_parent(&self, child_force: Force) -> Force
fn inertia_for_child(&self, parent_inertia: Inertia) -> Inertia
fn inertia_for_parent(&self, child_intertia: Inertia) -> Inertia
Auto Trait Implementations§
impl<C> Freeze for Gear<C>where
C: Freeze,
impl<C> RefUnwindSafe for Gear<C>where
C: RefUnwindSafe,
impl<C> Send for Gear<C>where
C: Send,
impl<C> Sync for Gear<C>where
C: Sync,
impl<C> Unpin for Gear<C>where
C: Unpin,
impl<C> UnwindSafe for Gear<C>where
C: UnwindSafe,
Blanket Implementations§
source§impl<T> AsyncActuator for T
impl<T> AsyncActuator for T
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
Mutably borrows from an owned value. Read more
source§impl<T> DefinedActuator for T
impl<T> DefinedActuator for T
source§impl<T> Interruptible for T
impl<T> Interruptible for T
source§fn add_interruptor(&mut self, interruptor: Box<dyn Interruptor + Send>)
fn add_interruptor(&mut self, interruptor: Box<dyn Interruptor + Send>)
Add an interruptor to the component, often used for measurements or other processes checking the movement
source§fn intr_reason(&mut self) -> Option<InterruptReason>
fn intr_reason(&mut self) -> Option<InterruptReason>
Returns the interrupt reason if there is any (returns
None otherwise) Read moresource§fn add_interruptor_inline(
self,
interruptor: Box<dyn Interruptor + Send>
) -> Selfwhere
Self: Sized,
fn add_interruptor_inline(
self,
interruptor: Box<dyn Interruptor + Send>
) -> Selfwhere
Self: Sized,
Calls
add_interruptor on an owned objectsource§impl<T> StepperActuator for T
impl<T> StepperActuator for T
source§fn consts(&self) -> &StepperConst
fn consts(&self) -> &StepperConst
Returns the constants of the stepper motor
source§fn config(&self) -> &StepperConfig
fn config(&self) -> &StepperConfig
Returns a reference to the
StepperConfig used by the stepper motorsource§fn set_config(&mut self, config: StepperConfig)
fn set_config(&mut self, config: StepperConfig)
Set the config used by the Stepper motor
source§fn microsteps(&self) -> MicroSteps
fn microsteps(&self) -> MicroSteps
The amount of microsteps in a full step
source§fn set_microsteps(&mut self, micro: MicroSteps)
fn set_microsteps(&mut self, micro: MicroSteps)
Set the amount of microsteps in a full step
source§impl<T> SyncActuator for T
impl<T> SyncActuator for T
source§fn drive_rel(&mut self, delta: Delta, speed: Factor) -> SyncDriveFuture ⓘ
fn drive_rel(&mut self, delta: Delta, speed: Factor) -> SyncDriveFuture ⓘ
Moves the component by the relative distance as fast as possible, halts the script until
the movement is finshed and returns the actual relative distance travelled
source§fn set_gamma(&mut self, gamma: Gamma)
fn set_gamma(&mut self, gamma: Gamma)
Overwrite the current absolute position of the component without triggering actual movements. Read more
source§fn velocity_max(&self) -> Velocity
fn velocity_max(&self) -> Velocity
Returns the maximum velocity of the component. It can be set using
SyncComp::set_velocity_max().
The component cannot move faster than the velocity given (valid for all movement operations) Read moresource§fn set_velocity_max(&mut self, velocity_max: Velocity)
fn set_velocity_max(&mut self, velocity_max: Velocity)
Set the maximum velocity of the component, current maximum velocity can be access with
SyncComp::velocity_max() Read moresource§fn limits_for_gamma(&self, gamma: Gamma) -> Delta
fn limits_for_gamma(&self, gamma: Gamma) -> Delta
Returns if any limit positions have been reached. The value returned can either be radians or millimeters,
depending on the type of component. Read more
source§fn set_limits(&mut self, min: Option<Gamma>, max: Option<Gamma>)
fn set_limits(&mut self, min: Option<Gamma>, max: Option<Gamma>)
Set the limits for the minimum and maximum angles that the component can reach, note that the limit will
be converted and transfered to the parent component if defined. Read more
source§fn set_end(&mut self, set_gamma: Gamma)
fn set_end(&mut self, set_gamma: Gamma)
Sets an endpoint in the current direction by modifying the components limits. For example, when the component is moving
in the positive direction and the endpoint is set, this function will overwrite the current maximum limit with the current
gamma value. The component is then not allowed to move in the current direction anymore.
source§fn overwrite_limits(&mut self, min: Option<Gamma>, max: Option<Gamma>)
fn overwrite_limits(&mut self, min: Option<Gamma>, max: Option<Gamma>)
Set the limits for the minimum and maximum angles that the component can reach, note that the limit will
be converted and transfered to the parent component if this component has one. Read more
source§fn apply_gen_force(&mut self, force: Force) -> Result<(), Box<dyn Error>>
fn apply_gen_force(&mut self, force: Force) -> Result<(), Box<dyn Error>>
Apply a load force to the component, slowing down movements Read more
source§fn apply_dir_force(&mut self, force: Force) -> Result<(), Box<dyn Error>>
fn apply_dir_force(&mut self, force: Force) -> Result<(), Box<dyn Error>>
Value positive in CW direction
source§fn apply_inertia(&mut self, inertia: Inertia)
fn apply_inertia(&mut self, inertia: Inertia)
Apply a load inertia to the component, slowing down movements Read more