LingxinMeng 10 maanden geleden
bovenliggende
commit
b236cf5ee3
4 gewijzigde bestanden met toevoegingen van 100 en 101 verwijderingen
  1. 100 0
      src/package/entity/project.go
  2. 0 44
      src/package/entity/sensor.go
  3. 0 26
      src/package/entity/task.go
  4. 0 31
      src/package/entity/vehicle.go

+ 100 - 0
src/package/entity/project.go

@@ -7,3 +7,103 @@ type Project struct {
 	Parallelism        int64  `json:"parallelism"`
 	Tasks              []Task `json:"tasks"`
 }
+type Task struct {
+	Info     TaskInfo     `json:"info"`
+	Scenario TaskScenario `json:"scenario"`
+	Vehicle  TaskVehicle  `json:"vehicle"`
+}
+
+type TaskInfo struct {
+	ProjectId   string `json:"project_id"`
+	TaskId      string `json:"task_id"`
+	TaskPath    string `json:"task_path"`
+	DefaultTime int    `json:"default_time"`
+}
+
+type TaskScenario struct {
+	ScenarioOsc  string `json:"scenario_osc"`
+	ScenarioOdr  string `json:"scenario_odr"`
+	ScenarioOsgb string `json:"scenario_osgb"`
+}
+
+type TaskVehicle struct {
+	Model    VehicleModel    `json:"model"`
+	Dynamics VehicleDynamics `json:"dynamics"`
+	Sensors  VehicleSensors  `json:"sensors"`
+}
+type VehicleModel struct {
+	ModelLabel string `json:"model_label"`
+}
+
+// VehicleDynamics 动力学配置
+type VehicleDynamics struct {
+	DynamicsMaxspeed              float64 `json:"dynamics_maxspeed"`              // 最大速度(千米/小时)
+	DynamicsEnginepower           float64 `json:"dynamics_enginepower"`           // 发动机功率(千瓦)
+	DynamicsMaxdecel              float64 `json:"dynamics_maxdecel"`              // 最大减速度(米/秒2)
+	DynamicsMaxsteering           float64 `json:"dynamics_maxsteering"`           // 最大减速度(米/秒2)
+	DynamicsMass                  float64 `json:"dynamics_mass"`                  // 质量(千克)
+	DynamicsFrontsurfaceeffective float64 `json:"dynamics_frontsurfaceeffective"` // 前表面有效面积(平方米)
+	DynamicsAirdragcoefficient    float64 `json:"dynamics_airdragcoefficient"`    // 空气阻力系数
+	DynamicsRollingresistance     float64 `json:"dynamics_rollingresistance"`     // 滚动阻力系数
+	DynamicsWheeldiameter         float64 `json:"dynamics_wheeldiameter"`         // 车轮直径(米)
+	DynamicsWheeldrive            string  `json:"dynamics_wheeldrive"`            // 驱动方式
+	DynamicsOverallefficiency     float64 `json:"dynamics_overallefficiency"`     // 总效率
+	DynamicsDistfront             float64 `json:"dynamics_distfront"`             // 车前距(米)
+	DynamicsDistrear              float64 `json:"dynamics_distrear"`              // 车后距(米)
+	DynamicsDistleft              float64 `json:"dynamics_distleft"`              // 车左距(米)
+	DynamicsDistright             float64 `json:"dynamics_distright"`             // 车右距(米)
+	DynamicsDistheight            float64 `json:"dynamics_distheight"`            // 车高(米)
+	DynamicsWheelbase             float64 `json:"dynamics_wheelbase"`             // 轴距(米)
+}
+
+type VehicleSensors struct {
+	Camera []SensorCamera `json:"camera"`
+	OGT    []SensorOgt    `json:"OGT"`
+}
+type Sensor struct {
+	SensorName string  `json:"sensor_name"` // 传感器名称
+	SensorNear float64 `json:"sensor_near"` // 盲区距离
+	SensorFar  float64 `json:"sensor_far"`  // 探测距离
+	SensorX    float64 `json:"sensor_x"`    // 传感器横向偏移量(x轴)
+	SensorY    float64 `json:"sensor_y"`    // 传感器纵向偏移量(y轴)
+	SensorZ    float64 `json:"sensor_z"`    // 传感器安装高度(z轴)
+	SensorH    float64 `json:"sensor_h"`    // 传感器横摆角
+	SensorP    float64 `json:"sensor_p"`    // 传感器俯仰角
+	SensorR    float64 `json:"sensor_r"`    // 传感器横滚角
+}
+
+// SensorParam 从数据闭环平台接收到的参数,通用
+type SensorParam struct {
+	Sensor
+	SensorForH       float64 `json:"sensor_fovH"`        // 水平视场角
+	SensorForV       float64 `json:"sensor_fovV"`        // 垂直视场角
+	SensorForHOffset float64 `json:"sensor_fovH_offset"` // 水平视场角偏移量
+	SensorForVOffset float64 `json:"sensor_fovV_offset"` // 垂直视场角偏移量
+}
+
+// SensorCamera 摄像头
+type SensorCamera struct {
+	Sensor
+	SensorForH       float64 `json:"sensor_fovH"`       // 水平现场角
+	SensorFovV       float64 `json:"sensor_fovV"`       // 垂直现场角
+	SensorResolution string  `json:"sensor_resolution"` // 分辨率
+	SensorFrameRate  float64 `json:"sensor_frameRate"`  // 帧率
+}
+
+// SensorOgt 完美传感器
+type SensorOgt struct {
+	Sensor
+	SensorFovH       float64 `json:"sensor_fovH"`
+	SensorResolution string  `json:"sensor_resolution"` // 分辨率
+	SensorFovV       float64 `json:"sensor_fovV"`       // 垂直现场角
+	SensorFrameRate  float64 `json:"sensor_frameRate"`  // 帧率
+	SensorFilter     string  `json:"sensor_filter"`     // 目标物筛选序列(0,1,2)
+	SensorDisplay    bool    `json:"sensor_display"`    // 显示目标物
+	SensorMaxObjects int     `json:"sensor_maxObjects"` // 最大目标物个数
+	SensorPort       string  `json:"sensor_port"`       // 端口
+	SensorMax0bjects int     `json:"sensor_max0bjects"` // 最大目标物个数
+	SensorForHLeft   float64 `json:"sensor_fovHLeft"`   // 水平现场角右
+	SensorForHRight  float64 `json:"sensor_fovHRight"`  // 水平现场角右
+	SensorForHTop    float64 `json:"sensor_fovVTop"`    // 垂直现场角顶
+	SensorForHBottom float64 `json:"sensor_fovVBottom"` // 垂直现场角底
+}

+ 0 - 44
src/package/entity/sensor.go

@@ -1,44 +0,0 @@
-package entity
-
-type Sensor struct {
-	SensorName string  `json:"sensor_name"` // 传感器名称
-	SensorNear float64 `json:"sensor_near"` // 盲区距离
-	SensorFar  float64 `json:"sensor_far"`  // 探测距离
-	SensorX    float64 `json:"sensor_x"`    // 传感器横向偏移量(x轴)
-	SensorY    float64 `json:"sensor_y"`    // 传感器纵向偏移量(y轴)
-	SensorZ    float64 `json:"sensor_z"`    // 传感器安装高度(z轴)
-	SensorH    float64 `json:"sensor_h"`    // 传感器横摆角
-	SensorP    float64 `json:"sensor_p"`    // 传感器俯仰角
-	SensorR    float64 `json:"sensor_r"`    // 传感器横滚角
-}
-
-// SensorParam 从数据闭环平台接收到的参数,通用
-type SensorParam struct {
-	Sensor
-	SensorForH       float64 `json:"sensor_fovH"`        // 水平视场角
-	SensorForV       float64 `json:"sensor_fovV"`        // 垂直视场角
-	SensorForHOffset float64 `json:"sensor_fovH_offset"` // 水平视场角偏移量
-	SensorForVOffset float64 `json:"sensor_fovV_offset"` // 垂直视场角偏移量
-}
-
-// SensorCamera 摄像头
-type SensorCamera struct {
-	Sensor
-	SensorForH       float64 `json:"sensor_fovH"`       // 水平现场角
-	SensorForV       float64 `json:"sensor_fovV"`       // 垂直现场角
-	SensorResolution string  `json:"sensor_resolution"` // 分辨率
-	SensorFrameRate  float64 `json:"sensor_frameRate"`  // 帧率
-}
-
-// SensorOgt 完美传感器
-type SensorOgt struct {
-	Sensor
-	SensorForHLeft   float64 `json:"sensor_fovHLeft"`   // 水平现场角左
-	SensorForHRight  float64 `json:"sensor_fovHRight"`  // 水平现场角右
-	SensorForHTop    float64 `json:"sensor_fovVTop"`    // 垂直现场角顶
-	SensorForHBottom float64 `json:"sensor_fovVBottom"` // 垂直现场角底
-	SensorFilter     string  `json:"sensor_filter"`     // 目标物筛选序列(0,1,2)
-	SensorDisplay    bool    `json:"sensor_display"`    // 显示目标物
-	SensorMaxObjects int     `json:"sensor_maxObjects"` // 最大目标物个数
-	SensorPort       int     `json:"sensor_port"`       // 端口
-}

+ 0 - 26
src/package/entity/task.go

@@ -1,26 +0,0 @@
-package entity
-
-type Task struct {
-	Info     TaskInfo     `json:"info"`
-	Scenario TaskScenario `json:"scenario"`
-	Vehicle  TaskVehicle  `json:"vehicle"`
-}
-
-type TaskInfo struct {
-	ProjectId   string `json:"project_id"`
-	TaskId      string `json:"task_id"`
-	TaskPath    string `json:"task_path"`
-	DefaultTime int    `json:"default_time"`
-}
-
-type TaskScenario struct {
-	ScenarioOsc  string `json:"scenario_osc"`
-	ScenarioOdr  string `json:"scenario_odr"`
-	ScenarioOsgb string `json:"scenario_osgb"`
-}
-
-type TaskVehicle struct {
-	Model    VehicleModel    `json:"model"`
-	Dynamics VehicleDynamics `json:"dynamics"`
-	Sensors  VehicleSensors  `json:"sensors"`
-}

+ 0 - 31
src/package/entity/vehicle.go

@@ -1,31 +0,0 @@
-package entity
-
-type VehicleModel struct {
-	ModelLabel string `json:"model_label"`
-}
-
-// VehicleDynamics 动力学配置
-type VehicleDynamics struct {
-	DynamicsMaxspeed              float64 `json:"dynamics_maxspeed"`              // 最大速度(千米/小时)
-	DynamicsEnginepower           float64 `json:"dynamics_enginepower"`           // 发动机功率(千瓦)
-	DynamicsMaxdecel              float64 `json:"dynamics_maxdecel"`              // 最大减速度(米/秒2)
-	DynamicsMaxsteering           float64 `json:"dynamics_maxsteering"`           // 最大减速度(米/秒2)
-	DynamicsMass                  float64 `json:"dynamics_mass"`                  // 质量(千克)
-	DynamicsFrontsurfaceeffective float64 `json:"dynamics_frontsurfaceeffective"` // 前表面有效面积(平方米)
-	DynamicsAirdragcoefficient    float64 `json:"dynamics_airdragcoefficient"`    // 空气阻力系数
-	DynamicsRollingresistance     float64 `json:"dynamics_rollingresistance"`     // 滚动阻力系数
-	DynamicsWheeldiameter         float64 `json:"dynamics_wheeldiameter"`         // 车轮直径(米)
-	DynamicsWheeldrive            string  `json:"dynamics_wheeldrive"`            // 驱动方式
-	DynamicsOverallefficiency     float64 `json:"dynamics_overallefficiency"`     // 总效率
-	DynamicsDistfront             float64 `json:"dynamics_distfront"`             // 车前距(米)
-	DynamicsDistrear              float64 `json:"dynamics_distrear"`              // 车后距(米)
-	DynamicsDistleft              float64 `json:"dynamics_distleft"`              // 车左距(米)
-	DynamicsDistright             float64 `json:"dynamics_distright"`             // 车右距(米)
-	DynamicsDistheight            float64 `json:"dynamics_distheight"`            // 车高(米)
-	DynamicsWheelbase             float64 `json:"dynamics_wheelbase"`             // 轴距(米)
-}
-
-type VehicleSensors struct {
-	Camera []SensorCamera `json:"camera"`
-	OGT    []SensorOgt    `json:"OGT"`
-}