package kinglong_msgs

import (
	"github.com/bluenviron/goroslib/v2/pkg/msg"
	"github.com/bluenviron/goroslib/v2/pkg/msgs/std_msgs"
)

type FaultInfo struct {
	msg.Package  `ros:"common_msgs"`
	TimestampSec float64
	ModuleName   string
	Version      string
	ErrorCode    int32
	Msg          string
	FaultLevel   int8
	FaultType    int8
}

type Header struct {
	msg.Package    `ros:"common_msgs"`
	SequenceNum    int32
	TimeStamp      float64
	ModuleName     string
	Version        string
	FaultVec       FaultVec
	TimeStatistics TimeStatistics
}

type FaultVec struct {
	msg.Package      `ros:"common_msgs"`
	InfoVec          []FaultInfo
	ModuleFaultLevel int32
}

type TimeStatistics struct {
	msg.Package      `ros:"common_msgs"`
	DevTimeStatusMsg []TimeStatus
	SendingTimestamp float64
}

type TimeStatus struct {
	msg.Package         `ros:"common_msgs"`
	Dtime               float64
	SourceNodeName      string
	DestinationNodeName string
}

type Retrieval struct {
	msg.Package            `ros:"common_msgs"`
	Header                 std_msgs.Header `rosname:"header"`
	AsVehAccelerationValue float64         `rosname:"AS_Veh_Acceleration_Value"` // 惯导采集到的加速度
	AsDriverTakeoverReq    int16           `rosname:"AS_Driver_TakeOver_Req"`    // 驾驶员接管提醒(2B9)
	VcuAccelPosValue       float64         `rosname:"VCU_Accel_Pos_Value"`       // 实际加速踏板位置
	VcuBrkPelPosValue      float64         `rosname:"VCU_BrkPel_Pos_Value"`      // 实际制动踏板位置
	VcuRealSpeed           float64         `rosname:"VCU_Real_Speed"`            // 当前车速
	VcuCurrentGear         int16           `rosname:"VCU_Current_Gear"`          // 当前档位
	VcuParkingSt           int16           `rosname:"VCU_Parking_St"`            // 当前P档位
	AutoDLimitInReason     int16           `rosname:"AutoD_Limitin_Reason"`      // 限制进入自动驾驶原因
	EmergencyStopReason    int16           `rosname:"Emergency_Stop_Reason"`     // 紧急停车激活原因
	VcuDriverTakeoverReq   int16           `rosname:"VCU_Driver_TakeOver_Req"`   // 驾驶员接管提醒(2BA)
	VcuVehicleDriveModeSt  int16           `rosname:"VCU_Vehicle_Drive_Mode_St"` // 车辆驾驶模式
	AutoDOutReason         int16           `rosname:"AutoD_Out_Reason"`          // 退出自动驾驶原因
	BrakeSysFaultSt        int16           `rosname:"Brak_Sys_Fault_St"`         // 制动系统故障
	StrgAngleRealValue     float64         `rosname:"Strg_Angle_Real_Value"`     // 方向盘实际转角
	StrgAngleSpdValue      float64         `rosname:"Strg_Angle_Spd_Value"`      // 方向盘当前实际速度反馈
	StrgWorkmodeSt         int16           `rosname:"Strg_WorkMode_St"`          // 当前系统实际工作模式
	BCHornSt               int16           `rosname:"BC_Horn_St"`                // 喇叭状态

}
