Эх сурвалжийг харах

Merge remote-tracking branch 'gogs/master'

# Conflicts:
#	trigger/pjisuv/cicv_location/Brake/main/Brake.go
#	trigger/pjisuv/cicv_location/RapidAccel/main/RapidAccel.go
LingxinMeng 10 сар өмнө
parent
commit
ae93fb85c7

+ 4 - 4
trigger/kinglong/cicv_extend/cutin_difference/main/cutin_difference.go

@@ -1,7 +1,7 @@
 package main
 
 import (
-	"cicv-data-closedloop/common/entity"
+	"cicv-data-closedloop/kinglong_param"
 	"math"
 	"sort"
 )
@@ -15,7 +15,7 @@ func Label() string {
 	return "brake"
 }
 
-func Rule(param entity.KinglongParam) string {
+func Rule(param kinglong_param.KinglongParam) string {
 	for _, objValue := range param.ObjDicOfTpperception {
 		if len(objValue) <= 5 || !isCuttingIn(objValue, param) || !isDifference(param) {
 			continue
@@ -25,7 +25,7 @@ func Rule(param entity.KinglongParam) string {
 	return ""
 }
 
-func isCuttingIn(objYList []float32, param entity.KinglongParam) bool {
+func isCuttingIn(objYList []float32, param kinglong_param.KinglongParam) bool {
 	for i, objY := range objYList {
 		if math.Abs(float64(objY)) >= 1.3 && math.Abs(param.AngularVelocityZOfCicvLocation) <= 0.6 {
 			for j := 0; j < len(objYList)-i-1; j++ {
@@ -39,7 +39,7 @@ func isCuttingIn(objYList []float32, param entity.KinglongParam) bool {
 }
 
 // 利用曼惠特尼U检验的方式判断车端数据和驾驶员控制数据是否存在显著差异
-func isDifference(param entity.KinglongParam) bool {
+func isDifference(param kinglong_param.KinglongParam) bool {
 	_, pValueSteering := mannWhitneyUTest(param.EgoSteeringRealOfDataRead, param.EgoSteeringCmdOfJinlongControlPub)
 	_, pValueThrottle := mannWhitneyUTest(param.EgoThrottleRealOfDataRead, param.EgoThrottleRealOfDataRead)
 	_, pValueBrake := mannWhitneyUTest(param.EgoBrakeRealOfDataRead, param.EgoBrakeCmdOfJinlongControlPub)

+ 50 - 0
trigger/pjisuv/cicv_location/AuLongStop/main/AuLongStop.go

@@ -0,0 +1,50 @@
+package main
+
+import (
+	"cicv-data-closedloop/pjisuv_msgs"
+	"cicv-data-closedloop/pjisuv_param"
+	"fmt"
+	"time"
+)
+
+var (
+	StartTime int64
+	IsStopped bool
+)
+
+func Topic() string {
+	return "/pj_vehicle_fdb_pub"
+}
+
+// Label todo 禁止存在下划线_
+func Label() string {
+	return "AuLongStop"
+}
+
+func Rule(data *pjisuv_msgs.PerceptionLocalization, param pjisuv_param.PjisuvParam) string {
+	if param.AutomodeOfPjVehicleFdbPub == 1 {
+		if data.VelocityX < 0.5 {
+			// 如果之前没有记录开始时间,记录当前时间
+			if StartTime == 0 {
+				StartTime = time.Now().Unix()
+			}
+			// 判断是否持续超过 50s
+			if time.Now().Unix()-StartTime > 50 {
+				if !IsStopped {
+					event_label := "AuLongStop"
+					fmt.Println(event_label)
+					IsStopped = true
+					return "AuLongStop"
+				}
+			}
+		} else {
+			// 如果速度大于 0.1,重置开始时间和停止标志
+			StartTime = 0
+			IsStopped = false
+		}
+	} else {
+		StartTime = 0
+		IsStopped = false
+	}
+	return ""
+}