EnterTjunction.go 618 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "cicv-data-closedloop/pjisuv_msgs"
  4. "fmt"
  5. "sync"
  6. )
  7. func Topic() string {
  8. return "/cicv_location"
  9. }
  10. // Label todo 禁止存在下划线_
  11. func Label() string {
  12. return "EnterTjunction"
  13. }
  14. func Rule(shareVars *sync.Map, data *pjisuv_msgs.PerceptionLocalization) string {
  15. defer func() {
  16. if r := recover(); r != nil {
  17. fmt.Println("Recovered from panic:", r)
  18. }
  19. }()
  20. EnterJunctionFlag, ok := shareVars.Load("EnterJunctionFlag")
  21. AbsSpeed, ok1 := shareVars.Load("AbsSpeed")
  22. if ok && ok1 && EnterJunctionFlag.(bool) == true && AbsSpeed.(float64) >= 1 {
  23. return Label()
  24. }
  25. return ""
  26. }