#[non_exhaustive]pub struct StayWithinCommand {
pub lower_bound: Option<f32>,
pub upper_bound: Option<f32>,
pub feedforward_torque: Option<f32>,
pub kp_scale: Option<f32>,
pub kd_scale: Option<f32>,
pub maximum_torque: Option<f32>,
pub watchdog_timeout: Option<f32>,
pub ilimit_scale: Option<f32>,
pub ignore_position_bounds: Option<f32>,
}Expand description
Stay-within mode command.
Unlike PositionCommand which drives to a target, this mode keeps the
servo within position bounds while applying minimal control effort.
§Examples
use moteus_protocol::CanFdFrame;
use moteus_protocol::command::{StayWithinCommand, StayWithinFormat};
let mut frame = CanFdFrame::new();
let cmd = StayWithinCommand::new()
.lower_bound(-0.5)
.upper_bound(0.5);
cmd.serialize(&mut frame, &StayWithinFormat::default());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.lower_bound: Option<f32>Lower position bound in revolutions
upper_bound: Option<f32>Upper position bound in revolutions
feedforward_torque: Option<f32>Feedforward torque in Nm
kp_scale: Option<f32>Kp scale factor
kd_scale: Option<f32>Kd scale factor
maximum_torque: Option<f32>Maximum torque in Nm
watchdog_timeout: Option<f32>Watchdog timeout in seconds
ilimit_scale: Option<f32>Current limit scale
ignore_position_bounds: Option<f32>Ignore position bounds flag
Implementations§
Source§impl StayWithinCommand
impl StayWithinCommand
pub fn lower_bound(self, value: f32) -> Self
pub fn upper_bound(self, value: f32) -> Self
pub fn feedforward_torque(self, value: f32) -> Self
pub fn kp_scale(self, value: f32) -> Self
pub fn kd_scale(self, value: f32) -> Self
pub fn maximum_torque(self, value: f32) -> Self
pub fn watchdog_timeout(self, value: f32) -> Self
pub fn ilimit_scale(self, value: f32) -> Self
pub fn ignore_position_bounds(self, value: f32) -> Self
Source§impl StayWithinCommand
impl StayWithinCommand
Sourcepub fn serialize(&self, frame: &mut CanFdFrame, format: &StayWithinFormat)
pub fn serialize(&self, frame: &mut CanFdFrame, format: &StayWithinFormat)
Serializes this command to a CAN frame.
Trait Implementations§
Source§impl Clone for StayWithinCommand
impl Clone for StayWithinCommand
Source§fn clone(&self) -> StayWithinCommand
fn clone(&self) -> StayWithinCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StayWithinCommand
impl Debug for StayWithinCommand
Source§impl Default for StayWithinCommand
impl Default for StayWithinCommand
Source§fn default() -> StayWithinCommand
fn default() -> StayWithinCommand
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StayWithinCommand
impl RefUnwindSafe for StayWithinCommand
impl Send for StayWithinCommand
impl Sync for StayWithinCommand
impl Unpin for StayWithinCommand
impl UnsafeUnpin for StayWithinCommand
impl UnwindSafe for StayWithinCommand
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