|
@@ -0,0 +1,25 @@
|
|
|
|
+package main
|
|
|
|
+
|
|
|
|
+import (
|
|
|
|
+ "github.com/bluenviron/goroslib/v2/pkg/msgs/sensor_msgs"
|
|
|
|
+ "math"
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+输入电源欠压
|
|
|
|
+*/
|
|
|
|
+
|
|
|
|
+func Topic() string {
|
|
|
|
+ return "/diagnostics"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func Label() string {
|
|
|
|
+ return "errorcode#1#21031701"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func Rule(data *sensor_msgs.Imu) string {
|
|
|
|
+ if math.Abs(data.LinearAcceleration.X) >= 0.7 && math.Abs(data.LinearAcceleration.Y) >= 0.7 {
|
|
|
|
+ return "unstabledriving"
|
|
|
|
+ }
|
|
|
|
+ return ""
|
|
|
|
+}
|