pub struct PositionDerivativeDependentPIDKValues {
pub position: PIDKValues,
pub velocity: PIDKValues,
pub acceleration: PIDKValues,
}Expand description
A set of PID k-values for controlling each position derivative.
Fields§
§position: PIDKValuesUse these k-values when controlling position.
velocity: PIDKValuesUse these k-values when controlling velocity.
acceleration: PIDKValuesUse these k-values when controlling acceleration.
Implementations§
Source§impl PositionDerivativeDependentPIDKValues
impl PositionDerivativeDependentPIDKValues
Sourcepub const fn new(
position: PIDKValues,
velocity: PIDKValues,
acceleration: PIDKValues,
) -> Self
pub const fn new( position: PIDKValues, velocity: PIDKValues, acceleration: PIDKValues, ) -> Self
Constructor for PositionDerivativeDependentPIDKValues.
Sourcepub fn get_k_values(
&self,
position_derivative: PositionDerivative,
) -> PIDKValues
pub fn get_k_values( &self, position_derivative: PositionDerivative, ) -> PIDKValues
Get the k-values for a specific position derivative.
Examples found in repository?
examples/devices.rs (line 71)
67fn main() {
68 println!("Commanding Motor to {:?}", COMMAND);
69 println!(
70 "K values are {:?}",
71 K_VALUES.get_k_values(PositionDerivative::from(COMMAND))
72 );
73 let motor = Motor::new();
74 let mut motor_wrapper =
75 devices::wrappers::PIDWrapper::new(motor, Time(0), STATE, COMMAND, K_VALUES);
76 let encoder = Encoder::default();
77 let mut encoder_wrapper = devices::wrappers::GetterStateDeviceWrapper::new(encoder);
78 connect(motor_wrapper.get_terminal(), encoder_wrapper.get_terminal());
79 for _ in 0..5 {
80 motor_wrapper.update().unwrap();
81 encoder_wrapper.update().unwrap();
82 }
83}Trait Implementations§
Source§impl Clone for PositionDerivativeDependentPIDKValues
impl Clone for PositionDerivativeDependentPIDKValues
Source§fn clone(&self) -> PositionDerivativeDependentPIDKValues
fn clone(&self) -> PositionDerivativeDependentPIDKValues
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PartialEq for PositionDerivativeDependentPIDKValues
impl PartialEq for PositionDerivativeDependentPIDKValues
Source§fn eq(&self, other: &PositionDerivativeDependentPIDKValues) -> bool
fn eq(&self, other: &PositionDerivativeDependentPIDKValues) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PositionDerivativeDependentPIDKValues
impl StructuralPartialEq for PositionDerivativeDependentPIDKValues
Auto Trait Implementations§
impl Freeze for PositionDerivativeDependentPIDKValues
impl RefUnwindSafe for PositionDerivativeDependentPIDKValues
impl Send for PositionDerivativeDependentPIDKValues
impl Sync for PositionDerivativeDependentPIDKValues
impl Unpin for PositionDerivativeDependentPIDKValues
impl UnwindSafe for PositionDerivativeDependentPIDKValues
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
Mutably borrows from an owned value. Read more