pub struct SkidSteer { /* private fields */ }Expand description
Skid-steer (tracked or four-wheel) drive: turning by spinning each side at a different speed.
A skid-steer robot steers like a differential one, but its wheels or tracks must slip
sideways to turn, so the geometric track under-predicts the turn. The standard correction is
an effective track wider than the real one by a slip factor (at least one), found by
calibration: commanding a yaw rate needs a larger left-right speed difference than the bare
geometry suggests. With slip of one this reduces to plain differential drive.
§Examples
use pamoja_kit::SkidSteer;
// Wheels 0.5 m apart that slip enough to need a 1.2x wider effective track.
let drive = SkidSteer::new(0.5, 1.2);
// Spin in place at 2 rad/s: each side runs at omega * effective_track / 2.
let (left, right) = drive.wheel_speeds(0.0, 2.0);
assert!((left + 0.6).abs() < 1e-6 && (right - 0.6).abs() < 1e-6);
// Reading the wheels back recovers the body motion.
let (linear, angular) = drive.body_motion(left, right);
assert!(linear.abs() < 1e-6 && (angular - 2.0).abs() < 1e-6);Implementations§
Source§impl SkidSteer
impl SkidSteer
Sourcepub fn new(track: f32, slip: f32) -> Self
pub fn new(track: f32, slip: f32) -> Self
Creates a model for wheels track apart with a given slip factor.
§Arguments
track- the distance between the left and right wheels or tracks; its magnitude is used.slip- how much wider the effective track is than the geometric one; its magnitude is used, and a value of zero is treated as one (no slip).
§Returns
The kinematics model.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SkidSteer
impl RefUnwindSafe for SkidSteer
impl Send for SkidSteer
impl Sync for SkidSteer
impl Unpin for SkidSteer
impl UnsafeUnpin for SkidSteer
impl UnwindSafe for SkidSteer
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