LingxinMeng пре 10 месеци
родитељ
комит
404324d2a7
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      trigger/kinglong/tpperception/TTC/main/TTC.go

+ 1 - 1
trigger/kinglong/tpperception/TTC/main/TTC.go

@@ -15,7 +15,7 @@ func Label() string {
 
 func Rule(data *kinglong_msgs.PerceptionObjects, velocityX float64, velocityY float64, yaw float64) string {
 	for _, obj := range data.Objs {
-		if math.Abs(float64(obj.Y)) <= 2 && obj.X >= 8 {
+		if math.Abs(float64(obj.Y)) <= 2 && obj.X >= 8 && math.Abs(velocityX) > 0.5 {
 			theta := DegreesToRadians(yaw)
 			vxrel := (float64(obj.Vxabs)-velocityX)*math.Cos(theta) + (float64(obj.Vyabs)-velocityY)*math.Sin(theta)
 			ttc := -((float64(obj.X) - 5.2) / (vxrel + 0.001))