Skip to content

Commit

Permalink
add quaternion
Browse files Browse the repository at this point in the history
  • Loading branch information
WT-MM committed Nov 15, 2024
1 parent cfdd6a4 commit 41bbe57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions platforms/kbot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kos_core = { version = "0.1.1", path = "../../kos_core" }
eyre = "0.6"
tracing = "0.1"
async-trait = "0.1"
robstride = "0.2.8"
robstride = "0.2.9"

[target.'cfg(target_os = "linux")'.dependencies]
imu = "0.1.4"
imu = "0.1.6"
11 changes: 9 additions & 2 deletions platforms/kbot/src/hexmove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ impl IMU for KBotIMU {
}

async fn get_quaternion(&self) -> Result<QuaternionResponse> {
error!("Quaternion operation not implemented");
Err(eyre::eyre!("Not implemented"))
debug!("Reading quaternion");
let data = self.imu.get_data();
Ok(QuaternionResponse {
w: data.qw as f64,
x: data.qx as f64,
y: data.qy as f64,
z: data.qz as f64,
error: None,
})
}
}

0 comments on commit 41bbe57

Please sign in to comment.