imu: no -0.0 in published values
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ fn units() -> HashMap<String, String> {
|
|||||||
fn signals(m: &Motion) -> [(&'static str, Value); 5] {
|
fn signals(m: &Motion) -> [(&'static str, Value); 5] {
|
||||||
let r = |v: f64, places: i32| {
|
let r = |v: f64, places: i32| {
|
||||||
let f = 10f64.powi(places);
|
let f = 10f64.powi(places);
|
||||||
json!((v * f).round() / f)
|
json!((v * f).round() / f + 0.0) // + 0.0 turns -0.0 into 0.0
|
||||||
};
|
};
|
||||||
[
|
[
|
||||||
("imu_roll_deg", r(m.roll_deg, 1)),
|
("imu_roll_deg", r(m.roll_deg, 1)),
|
||||||
|
|||||||
Reference in New Issue
Block a user