#[non_exhaustive]pub struct CurrentCommand {
pub d_a: f32,
pub q_a: f32,
}Expand description
DQ-axis current command.
§Examples
use moteus_protocol::CanFdFrame;
use moteus_protocol::command::{CurrentCommand, CurrentFormat};
let mut frame = CanFdFrame::new();
let cmd = CurrentCommand::new()
.d_current(0.0)
.q_current(0.5);
cmd.serialize(&mut frame, &CurrentFormat::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.d_a: f32D-axis current in Amps
q_a: f32Q-axis current in Amps
Implementations§
Source§impl CurrentCommand
impl CurrentCommand
Sourcepub fn serialize(&self, frame: &mut CanFdFrame, format: &CurrentFormat)
pub fn serialize(&self, frame: &mut CanFdFrame, format: &CurrentFormat)
Serializes this command to a CAN frame.
Trait Implementations§
Source§impl Clone for CurrentCommand
impl Clone for CurrentCommand
Source§fn clone(&self) -> CurrentCommand
fn clone(&self) -> CurrentCommand
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 CurrentCommand
impl Debug for CurrentCommand
Auto Trait Implementations§
impl Freeze for CurrentCommand
impl RefUnwindSafe for CurrentCommand
impl Send for CurrentCommand
impl Sync for CurrentCommand
impl Unpin for CurrentCommand
impl UnsafeUnpin for CurrentCommand
impl UnwindSafe for CurrentCommand
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