obstacledetection.go 471 B

1234567891011121314151617181920212223242526
  1. package main
  2. import (
  3. "github.com/bluenviron/goroslib/v2/pkg/msgs/std_msgs"
  4. )
  5. func Topic() string {
  6. return "/obstacle_detection"
  7. }
  8. func Label() string {
  9. return "obstacledetection"
  10. }
  11. func Rule(data *std_msgs.UInt8) string {
  12. /*
  13. 0-表示导航前方无障碍物,
  14. 1-表示找不到全局路径
  15. 2-表示前方有障碍物但能绕过去
  16. 3-表示前方有障碍物且局部规划不过去
  17. */
  18. if data.Data == 3 {
  19. return "obstacledetection"
  20. }
  21. return ""
  22. }