OverSpeed.go 479 B

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