- Gate rotate-mode compensation PI by active fleet omega and reset the integrator/timer when idle, so releasing the joystick stops the cars cleanly instead of drifting/self-rotating from a wound-up integral. - Add conditional integration anti-windup in RotatePiTerm to reduce the startup overshoot after the initial relative-pose spike. - Raise translational P gain for faster startup correction. - Superimpose body-frame compensation onto swerve rotation and add MultiVehicleDbg / RotateDbg / RotatePoseDbg diagnostics. Co-authored-by: Cursor <cursoragent@cursor.com>
45 lines
2.3 KiB
C#
45 lines
2.3 KiB
C#
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; }
|
|
// 联动运动模式:0=常规(前进+转向) 1=蟹行(四轮同向平移) 2=原地旋转(绕车队中心)
|
|
[JsonProperty("Mode")] public int Mode { get; set; }
|
|
// 原地旋转角速度(deg/s,逆时针为正),仅 Mode==2 有效
|
|
[JsonProperty("FleetOmega")] public float FleetOmega { 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; }
|
|
}
|