package main

import (
	"cicv-data-closedloop/pjisuv_msgs"
	"cicv-data-closedloop/pjisuv_param"
)

/*
   if obj_type_dic is not {}: #相邻两帧对于同一目标物感知类型不一致
       if obj.id in obj_type_dic:
           if obj.type != obj_type_dic[obj.id]:
               event_label='perceptiontypediffer'

               print(event_label)
           else:
               print(obj.type,"   ",obj_type_dic[obj.id])
*/

func Topic() string {
	return "/tpperception"
}

// Label todo 禁止存在下划线_
func Label() string {
	return "perceptiontypediffer"
}

func Rule(data *pjisuv_msgs.PerceptionObjects, param pjisuv_param.PjisuvParam) string {
	for _, obj := range data.Objs {
		if len(param.ObjTypeDicOfTpperception) != 0 {
			for _, lastObjType := range param.ObjTypeDicOfTpperception {
				if lastObjType != obj.Type {
					return "perceptiontypediffer"
				}
			}
		}
	}
	return ""
}
