Struct g29::interface::G29Interface
source · pub struct G29Interface { /* private fields */ }
Expand description
! The G29Interface
struct is the underlying driver for the G29 device, managing communication and state.
Implementations§
source§impl G29Interface
impl G29Interface
sourcepub fn reset(&self)
pub fn reset(&self)
Resets the G29 device, including steering wheel calibration. calibration the steering wheel of the G2
sourcepub fn force_feedback_constant(&self, val: f32)
pub fn force_feedback_constant(&self, val: f32)
Sets constant force feedback on the G29 device.
sourcepub fn set_autocenter(&self, strength: f32, rate: f32)
pub fn set_autocenter(&self, strength: f32, rate: f32)
Configures autocentering strength and rate. default value to be used strength = 0.5 and rate = 0.05
sourcepub fn update_state(&mut self, byte_array: &Vec<u8>)
pub fn update_state(&mut self, byte_array: &Vec<u8>)
Updates the internal state based on the latest data.
sourcepub fn calculate_steering(&self, start: &u8, end: &u8) -> u8
pub fn calculate_steering(&self, start: &u8, end: &u8) -> u8
Calculates the scaled steering value based on raw input.
sourcepub fn carla_vehicle_controle(&self) -> HashMap<String, f32>
pub fn carla_vehicle_controle(&self) -> HashMap<String, f32>
Transform G29 Controller input to caral controlle throttle in range of 0 -> 1 brake in range of 0 -> 1 steer in range of -1 -> 1
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for G29Interface
impl Send for G29Interface
impl !Sync for G29Interface
impl Unpin for G29Interface
impl !UnwindSafe for G29Interface
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