Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
misha7b committed Nov 16, 2024
1 parent 9199d1f commit 8a97f96
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions lib/localisation/src/control/localizer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
filtering::kalman_filter::KalmanFilter,
preprocessing::{
accelerometer::AccelerometerPreprocessor, keyence::KeyenceAgrees,
accelerometer::AccelerometerPreprocessor, keyence::{KeyenceAgrees, SensorChecks},
optical::process_optical_data,
},
};
Expand All @@ -17,9 +17,8 @@ pub struct Localizer {
velocity: f64,
acceleration: f64,
kalman_filter: KalmanFilter,
current_optical_reading: Option<Vec<Vec<f64, 2>, 2>>,
current_keyence_reading: Option<Vec<bool, 2>>,
current_accelerometer_reading: Option<Vec<f64, 4>>,
accelerometer_preprocessor: AccelerometerPreprocessor,
keyence_checker: KeyenceAgrees,
}

impl Localizer {
Expand Down Expand Up @@ -65,6 +64,8 @@ impl Localizer {
velocity: 0.0,
acceleration: 0.0,
kalman_filter,
accelerometer_preprocessor: AccelerometerPreprocessor::new(),
keyence_checker: KeyenceAgrees::new(),
}
}

Expand Down Expand Up @@ -96,10 +97,26 @@ impl Localizer {
self.acceleration
}

//pub fn preproccesor(
// &mut self,
// optical_data: Vec<Vec<f64, 2>, 2>,
// keyence_data: Vec<bool, 2>,
// accelerometer_data: Vec<f64, 4>,
//)
pub fn preprocessor(
&mut self,
optical_data: Vec<Vec<f64, 2>, 2>,
keyence_data: Vec<bool, 2>,
accelerometer_data: Vec<f64, 4>,
) {

let processed_optical_data = process_optical_data(optical_data);

let keyence_status = self.keyence_checker.check_keyence_agrees(keyence_data.clone());
//if keyence_status == SensorChecks::Unacceptable {
//TODOLater: Change state
// return;
//}






}

}

0 comments on commit 8a97f96

Please sign in to comment.