obstacledetection.go 335 B

123456789101112131415161718192021
  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. // TODO 如果速度很小则不触发
  12. func Rule(data *std_msgs.UInt8) string {
  13. if data.Data != 0 {
  14. return "obstacledetection"
  15. }
  16. return ""
  17. }