Struct syact::act::Gear

source ·
pub struct Gear<C: SyncActuator> {
    pub ctrl: C,
    pub ratio: f32,
}
Expand description

A gear component

§Gears

Fields§

§ctrl: C

Steppercontrol for the motor of the bearing

§ratio: f32

Angle ration from motor to bearing (velocity_b / velocity_m)

Implementations§

source§

impl<C: SyncActuator> Gear<C>

source

pub fn new(ctrl: C, ratio: f32) -> Self

Creates a new Gearbearing

  • device: The parent component driving the cylinder

Trait Implementations§

source§

impl<C: SyncActuator> ActuatorParent for Gear<C>

§

type Child = C

source§

fn child(&self) -> &Self::Child

source§

fn child_mut(&mut self) -> &mut Self::Child

source§

impl<C: Debug + SyncActuator> Debug for Gear<C>

source§

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

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

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<C: SyncActuator> RatioActuatorParent for Gear<C>

source§

fn ratio(&self) -> f32

The linear ratio that defines the relation between the child and the parent component Read more
source§

fn gamma_for_child(&self, parent_gamma: Gamma) -> Gamma

source§

fn gamma_for_parent(&self, child_gamma: Gamma) -> Gamma

source§

fn delta_for_chlid(&self, parent_delta: Delta) -> Delta

source§

fn delta_for_parent(&self, child_delta: Delta) -> Delta

source§

fn velocity_for_child(&self, parent_velocity: Velocity) -> Velocity

source§

fn velocity_for_parent(&self, child_velocity: Velocity) -> Velocity

source§

fn alpha_for_child(&self, parent_alpha: Acceleration) -> Acceleration

source§

fn alpha_for_parent(&self, child_alpha: Acceleration) -> Acceleration

source§

fn force_for_child(&self, parent_force: Force) -> Force

source§

fn force_for_parent(&self, child_force: Force) -> Force

source§

fn inertia_for_child(&self, parent_inertia: Inertia) -> Inertia

source§

fn inertia_for_parent(&self, child_intertia: Inertia) -> Inertia

source§

impl<C> Serialize for Gear<C>

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<C: SyncActuator> Setup for Gear<C>

source§

fn setup(&mut self) -> Result<(), Error>

Calls all required functions to assure the components functionality
source§

fn setup_inline(self) -> Result<Self, Error>
where Self: Sized,

Points to `setup``, helper function

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsyncActuator for T

source§

fn drive(&mut self, dir: Direction, speed: Factor) -> Result<(), Box<dyn Error>>

Starts the movement process of the component in the given direction with a given speed factor Read more
source§

fn dir(&self) -> Direction

Returns the current movement direction
source§

fn speed(&self) -> Factor

Returns the current speed factor
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
source§

impl<T> DefinedActuator for T

source§

fn ptp_time_for_distance(&self, gamma_0: Gamma, gamma_t: Gamma) -> Time

The time required to perform a certain PTP (Point-To-Point movement)
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Interruptible for T

source§

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>

Returns the interrupt reason if there is any (returns None otherwise) Read more
source§

fn add_interruptor_inline( self, interruptor: Box<dyn Interruptor + Send> ) -> Self
where Self: Sized,

Calls add_interruptor on an owned object
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.

source§

impl<T> StepperActuator for T

source§

fn consts(&self) -> &StepperConst

Returns the constants of the stepper motor
source§

fn config(&self) -> &StepperConfig

Returns a reference to the StepperConfig used by the stepper motor
source§

fn set_config(&mut self, config: StepperConfig)

Set the config used by the Stepper motor
source§

fn microsteps(&self) -> MicroSteps

The amount of microsteps in a full step
source§

fn set_microsteps(&mut self, micro: MicroSteps)

Set the amount of microsteps in a full step
source§

fn step_ang(&self) -> Delta

The angular distance of a step considering microstepping
source§

impl<T> SyncActuator for T

source§

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 gamma(&self) -> Gamma

Returns the absolute position of the component. Read more
source§

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

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 more
source§

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 more
source§

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>)

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)

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>)

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 force_gen(&self) -> Force

Will always be positive
source§

fn force_dir(&self) -> Force

Positive means CW direction
source§

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>>

Value positive in CW direction
source§

fn inertia(&self) -> Inertia

Returns the inertia applied to the component
source§

fn apply_inertia(&mut self, inertia: Inertia)

Apply a load inertia to the component, slowing down movements Read more
source§

fn drive_abs(&mut self, gamma: Gamma, speed: Factor) -> SyncDriveFuture

Moves the component to the given position as fast as possible, halts the script until the movement is finished and returns the actual relative distance travelled.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,