pub struct Twist {
pub vx: f32,
pub vy: f32,
pub omega: f32,
}Expand description
A planar body velocity: the command a wheeled robot is driven with.
The frame follows the robotics convention (ROS REP-103): x points forward, y points to
the robot’s left, and a positive omega turns counter-clockwise (toward the left).
Nonholonomic drives (differential, Ackermann, skid-steer) cannot move sideways and ignore
vy; holonomic drives (mecanum, omni) use it.
§Examples
use pamoja_kit::Twist;
let forward = Twist::planar(1.0, 0.0); // 1 m/s ahead, no turn
assert_eq!(forward.vy, 0.0);
assert_eq!(Twist::zero(), Twist::new(0.0, 0.0, 0.0));Fields§
§vx: f32Forward speed along the x axis.
vy: f32Leftward speed along the y axis; zero for drives that cannot strafe.
omega: f32Yaw rate about the z axis, positive counter-clockwise.
Implementations§
Trait Implementations§
impl Copy for Twist
impl StructuralPartialEq for Twist
Auto Trait Implementations§
impl Freeze for Twist
impl RefUnwindSafe for Twist
impl Send for Twist
impl Sync for Twist
impl Unpin for Twist
impl UnsafeUnpin for Twist
impl UnwindSafe for Twist
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