Skip to content

Commit

Permalink
return result
Browse files Browse the repository at this point in the history
  • Loading branch information
WT-MM committed Nov 15, 2024
1 parent 2bf2d89 commit 11ee94c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions actuator/robstride/src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@ impl MotorsSupervisor {
Ok(())
}

pub fn get_latest_feedback(&self) -> HashMap<u8, MotorFeedback> {
pub fn get_latest_feedback(&self) -> Result<HashMap<u8, MotorFeedback>, eyre::Error> {
let latest_feedback = self.latest_feedback.read()
.map_err(|e| eyre!("Failed to read latest_feedback: {}", e))?;
latest_feedback.clone()
Ok(latest_feedback.clone())
}

pub fn toggle_pause(&self) -> Result<(), eyre::Error> {
Expand Down Expand Up @@ -617,8 +617,8 @@ impl MotorsSupervisor {
Ok(())
}

pub fn get_actual_update_rate(&self) -> f64 {
*self.actual_update_rate.read().map_err(|e| eyre!("Failed to read actual_update_rate: {}", e))?
pub fn get_actual_update_rate(&self) -> Result<f64, eyre::Error> {
Ok(*self.actual_update_rate.read().map_err(|e| eyre!("Failed to read actual_update_rate: {}", e))?)
}

pub fn get_serial(&self) -> Result<bool, eyre::Error> {
Expand Down

0 comments on commit 11ee94c

Please sign in to comment.