Files
Tutorial/MultiWheel/MultiWheelC/VehicleSyncModels.cs
T

41 lines
2.0 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using ClumsyCore;
using Newtonsoft.Json;
namespace MultiWheelC;
public class VehicleSyncInfo
{
[JsonProperty("Master")] public bool Master { get; set; }
[JsonProperty("Ip")] public string Ip { get; set; } = "";
[JsonProperty("Port")] public int Port { get; set; } = 8008;
[JsonProperty("PosAvailable")] public bool PosAvailable { get; set; }
[JsonProperty("X")] public float X { get; set; }
[JsonProperty("Y")] public float Y { get; set; }
[JsonProperty("Th")] public float Th { get; set; }
[JsonProperty("LayoutX")] public float LayoutX { get; set; }
[JsonProperty("LayoutY")] public float LayoutY { get; set; }
[JsonProperty("LayoutTh")] public float LayoutTh { get; set; }
[JsonProperty("Aligned")] public bool Aligned { get; set; }
// 本车本轮是否成功识别到邻车(关闭互识别时恒为 true)。任一车为 false 则整队停车。
[JsonProperty("DetectOk")] public bool DetectOk { get; set; }
}
public class VehicleSyncNotification
{
[JsonProperty("PosAvailable")] public bool PosAvailable { get; set; }
[JsonProperty("CenterX")] public float CenterX { get; set; }
[JsonProperty("CenterY")] public float CenterY { get; set; }
[JsonProperty("CenterTh")] public float CenterTh { get; set; }
[JsonProperty("Aligned")] public bool Aligned { get; set; }
[JsonProperty("Fleet")] public Dictionary<int, VehicleSyncInfo> Fleet { get; set; } = new();
[JsonProperty("FleetVx")] public float FleetVx { get; set; }
[JsonProperty("FleetFrontTh")] public float FleetFrontTh { get; set; }
[JsonProperty("FleetRearTh")] public float FleetRearTh { get; set; }
[JsonProperty("AutoEnabled")] public bool AutoEnabled { get; set; }
[JsonProperty("ManualEnabled")] public bool ManualEnabled { get; set; }
[JsonProperty("SyncTh")] public float SyncTh { get; set; }
[JsonProperty("SyncDistance")] public float SyncDistance { get; set; }
[JsonProperty("DeltaDetectCenter")] public float DeltaDetectCenter { get; set; }
}