OverSpeed.go 361 B

12345678910111213141516171819202122
  1. package main
  2. import (
  3. "cicv-data-closedloop/pjisuv_msgs"
  4. "math"
  5. )
  6. func Topic() string {
  7. return "/cicv_location"
  8. }
  9. func Label() string {
  10. return "OverSpeed"
  11. }
  12. func Rule(data *pjisuv_msgs.PerceptionLocalization) string {
  13. if math.Pow(math.Pow(data.VelocityX, 2)+math.Pow(data.VelocityY, 2), 0.5)*3.6 >= 65 {
  14. return "OverSpeed"
  15. } else {
  16. return ""
  17. }
  18. }