pub struct PidController { /* private fields */ }Expand description
PID 控制器
实现经典的比例-积分-微分控制算法。
Implementations§
Source§impl PidController
impl PidController
Sourcepub fn new(target: JointArray<Rad>) -> Self
pub fn new(target: JointArray<Rad>) -> Self
Sourcepub fn with_gains(self, kp: f64, ki: f64, kd: f64) -> Self
pub fn with_gains(self, kp: f64, ki: f64, kd: f64) -> Self
Sourcepub fn with_integral_limit(self, limit: f64) -> Self
pub fn with_integral_limit(self, limit: f64) -> Self
Sourcepub fn with_output_limit(self, limit: f64) -> Self
pub fn with_output_limit(self, limit: f64) -> Self
Sourcepub fn set_target(&mut self, target: JointArray<Rad>)
pub fn set_target(&mut self, target: JointArray<Rad>)
Sourcepub fn target(&self) -> JointArray<Rad>
pub fn target(&self) -> JointArray<Rad>
获取当前目标位置
Sourcepub fn integral(&self) -> JointArray<f64>
pub fn integral(&self) -> JointArray<f64>
获取当前积分项
用于调试和监控。
Trait Implementations§
Source§impl Clone for PidController
impl Clone for PidController
Source§fn clone(&self) -> PidController
fn clone(&self) -> PidController
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 Controller for PidController
impl Controller for PidController
Source§fn tick(
&mut self,
current: &JointArray<Rad>,
dt: Duration,
) -> Result<JointArray<NewtonMeter>, Self::Error>
fn tick( &mut self, current: &JointArray<Rad>, dt: Duration, ) -> Result<JointArray<NewtonMeter>, Self::Error>
计算一步控制输出 Read more
Auto Trait Implementations§
impl Freeze for PidController
impl RefUnwindSafe for PidController
impl Send for PidController
impl Sync for PidController
impl Unpin for PidController
impl UnwindSafe for PidController
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more