12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package main
- import (
- "cicv-data-closedloop/pjisuv_msgs"
- "cicv-data-closedloop/pjisuv_param"
- "fmt"
- "math"
- )
- /*
- def callback_cicv_location(data):
- global angular_velocity_z
- global Ego_position_x
- global Ego_position_y
- global Ego_yaw
- Ego_position_x=data.position_x
- Ego_position_y=data.position_y
- Ego_yaw=data.yaw
- #print(Ego_yaw)
- angular_velocity_z=data.angular_velocity_z
- #print(angular_velocity_z)
- if abs(angular_velocity_z)>=27:
- event_label='overswing' #横摆角速度过大
- print(event_label)
- */
- func Topic() string {
- return "/cicv_location"
- }
- func Label() string {
- return "OverSwing"
- }
- func Rule(data *pjisuv_msgs.PerceptionLocalization, param *pjisuv_param.PjisuvParam) string {
- defer func() {
- if r := recover(); r != nil {
- fmt.Println("Recovered from panic:", r)
- }
- }()
- if math.Abs(data.AngularVelocityZ) >= 27.0 && param.AutomodeOfPjVehicleFdbPub == 1 {
- return "OverSwing"
- } else {
- return ""
- }
- }
|