diff --git a/MultiWheel/MultiWheelC/PilotConfig.cs b/MultiWheel/MultiWheelC/PilotConfig.cs index d341731..2889dba 100644 --- a/MultiWheel/MultiWheelC/PilotConfig.cs +++ b/MultiWheel/MultiWheelC/PilotConfig.cs @@ -6,15 +6,14 @@ namespace MultiWheelC; public class PilotConfig : MultiWheelPilotConfig { - // ===== 多车联动(已从 MDCSToolBox 内联回 Tutorial)===== - [FieldMember(desc = "[sync] 转向角加速度(deg/s^2)")] public float SyncThAccPerSec = 30f; - [FieldMember(desc = "[sync] 编队车间距(mm)")] public float TestCarSyncDistance = 2400f; - [FieldMember(desc = "[sync] 编队布局偏角(deg)")] public float TestCarSyncTh = 0f; - // 手动遥控 Vx 已是 m/s、Vth 已是转向角(deg),此处系数保持 1(直通),不要再次缩放。 - [FieldMember(desc = "[sync] 手动Vx系数")] public float ManualCarSyncVxFac = 1f; - // Manual crab mode: VxFac scales linear speed, VyFac maps steer stick ratio to crab steer angle in degrees. - [FieldMember(desc = "[sync] 手动Vy系数(蟹行满杆舵角deg)")] public float ManualCarSyncVyFac = 60f; - [FieldMember(desc = "[sync] 手动Vth系数")] public float ManualCarSyncVthFac = 1f; + [FieldMember(desc = "[sync] steering angle acceleration(deg/s^2)")] public float SyncThAccPerSec = 30f; + [FieldMember(desc = "[sync] fleet member distance(mm)")] public float TestCarSyncDistance = 2400f; + [FieldMember(desc = "[sync] fleet layout bias angle(deg)")] public float TestCarSyncTh = 0f; + // Fleet manual remote IO values are normalized joystick ratios. Keep all speed/angle scaling here. + [FieldMember(desc = "[sync] fleet manual max linear speed(m/s)")] public float FleetManualMaxSpeed = 0.3f; + [FieldMember(desc = "[sync] fleet manual normal-mode full-stick steering angle(deg)")] public float FleetManualMaxSteerAngleDeg = 45f; + [FieldMember(desc = "[sync] fleet manual crab-mode full-stick steering angle(deg)")] public float FleetManualMaxCrabAngleDeg = 60f; + [FieldMember(desc = "[sync] fleet manual rotate-mode full-stick angular speed(deg/s)")] public float FleetManualMaxRotateOmegaDegPerSec = 45f; [FieldMember(desc = "[sync] 蟹行舵角上限(deg,应与Medulla舵轮角度限制匹配,默认120)")] public float MultiVehicleCrabSteerLimitDeg = 120f; [FieldMember(desc = "[sync] 检测中心偏移(mm)")] public float DeltaDetectCenter = 350f; // 仅控制"车队内姿态纠正"(POS 补偿)是否使用 Detour 的 SLAM 位姿,不影响"整个车队姿态的计算"。 diff --git a/MultiWheel/MultiWheelC/PilotDefinition.cs b/MultiWheel/MultiWheelC/PilotDefinition.cs index 5c83c8e..95e740e 100644 --- a/MultiWheel/MultiWheelC/PilotDefinition.cs +++ b/MultiWheel/MultiWheelC/PilotDefinition.cs @@ -37,14 +37,17 @@ public class PilotDefinition : MultiWheelPilotDefinition= 200) { _fleetDiagLastStick = DateTime.Now; - FleetDiag($"STICK mode={mode} pos=({pos.X:0.00},{pos.Y:0.00}) manip={manipulating} ratio={ratio:0.00} " + - $"-> Vx={MultiVehicleManualVx:0.000} Vy={MultiVehicleManualVy:0.000} Vth={MultiVehicleManualVth:0.0} en={MultiVehicleManualEnabled}"); + FleetDiag($"STICK mode={mode} pos=({pos.X:0.00},{pos.Y:0.00}) manip={manipulating} raw " + + $"-> Vx={MultiVehicleManualVx:0.000} Vy={MultiVehicleManualVy:0.000} Vth={MultiVehicleManualVth:0.000} en={MultiVehicleManualEnabled}"); } } }); @@ -169,15 +164,6 @@ public partial class CartDefinition } }); - manip.AddWidget(new UseGesture.ThrottleWidget - { - name = "fleet_speed_ratio", - text = "速度比例", - position = "50%+10px, 64%+10px", - size = "37.5%-10px, 10%-10px", - bounceBack = false, - OnValue = (val, _) => speedRatio = Math.Clamp(val, 0, 1) - }); manip.AddWidget(new UseGesture.ButtonWidget { @@ -218,8 +204,7 @@ public partial class CartDefinition pb.SeparatorText("状态"); var modeName = MultiVehicleManualMode == 2 ? "原地旋转" : MultiVehicleManualMode == 1 ? "蟹行" : "常规"; pb.Label($"车队联动: {MultiVehicleManualEnabled} 模式: {modeName}"); - pb.Label($"速度比例: {speedRatio:0.00}"); - pb.Label($"Vx={MultiVehicleManualVx:0.000} Vy={MultiVehicleManualVy:0.000} m/s, Vth={MultiVehicleManualVth:0.0}"); + pb.Label($"VxRatio={MultiVehicleManualVx:0.000} VyRatio={MultiVehicleManualVy:0.000}, VthRatio={MultiVehicleManualVth:0.000}"); pb.Label($"优先级: {CartActivator.CartDefinition.currentPriority} ({CartActivator.CartDefinition.currentPriorityDesc})"); pb.Label("请勿同时打开「手动控制」面板"); pb.Panel.Repaint(); diff --git a/MultiWheel/MultiWheelS/MultiVehicleCar.cs b/MultiWheel/MultiWheelS/MultiVehicleCar.cs deleted file mode 100644 index d0b15b2..0000000 --- a/MultiWheel/MultiWheelS/MultiVehicleCar.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Threading.Tasks; -using SimpleComposer.RCS; -using SimpleCore.PropType; - -namespace MultiWheelS -{ - [CarType(Name = "多车联动AGV")] - public class MultiVehicleCar : GhostCar - { - public bool MultiVehicleSync = true; - - public static new async Task Create() - { - return new MultiVehicleCar - { - lstatus = "连接中", - address = "127.0.0.1", - name = "联动AGV" - }; - } - } -} diff --git a/MultiWheel/MultiWheelS/MultiWheelS.csproj b/MultiWheel/MultiWheelS/MultiWheelS.csproj deleted file mode 100644 index 2b61b20..0000000 --- a/MultiWheel/MultiWheelS/MultiWheelS.csproj +++ /dev/null @@ -1,62 +0,0 @@ - - - - - latest - - - Debug - AnyCPU - {D1D1D1D1-E2E2-F3F3-A4A4-B5B5B5B5B5B3} - Library - MultiWheelS - MultiWheelS - v4.8 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - D:\MDCS\Release\deps\LessokajiWeaverUtilities.dll - - - D:\MDCS\Dependencies\Simple\RefSimpleCore.dll - - - D:\MDCS\Executables\Simple\SimpleComposer.exe - - - - - - - - - - if not exist "$(SolutionDir)build\Simple\plugins" mkdir "$(SolutionDir)build\Simple\plugins" -if not exist "$(SolutionDir)build\Simple" mkdir "$(SolutionDir)build\Simple" -xcopy "$(TargetDir)$(TargetFileName)" "$(SolutionDir)build\Simple\plugins" /y -xcopy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)build\Simple\plugins" /y -copy /Y "D:\MDCS\Executables\Simple\SimpleComposer.exe" "$(SolutionDir)build\Simple\" -copy /Y "D:\MDCS\Release\MDCSToolBox.dll" "$(SolutionDir)build\Simple\" -copy /Y "D:\MDCS\Release\CommonUsage.dll" "$(SolutionDir)build\Simple\" -copy /Y "D:\MDCS\Dependencies\Simple\RefSimpleCore.dll" "$(SolutionDir)build\Simple\" - - diff --git a/Tutorial.sln b/Tutorial.sln index f64cace..6450b94 100644 --- a/Tutorial.sln +++ b/Tutorial.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.5.33424.131 @@ -15,8 +14,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MultiWheelM", "MultiWheel\M EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MultiWheelC", "MultiWheel\MultiWheelC\MultiWheelC.csproj", "{C8C64C7C-A9C6-5C7F-0C1A-609F8C9277D0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiWheelS", "MultiWheel\MultiWheelS\MultiWheelS.csproj", "{D1D1D1D1-E2E2-F3F3-A4A4-B5B5B5B5B5B3}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,10 +36,6 @@ Global {C8C64C7C-A9C6-5C7F-0C1A-609F8C9277D0}.Debug|Any CPU.Build.0 = Debug|Any CPU {C8C64C7C-A9C6-5C7F-0C1A-609F8C9277D0}.Release|Any CPU.ActiveCfg = Release|Any CPU {C8C64C7C-A9C6-5C7F-0C1A-609F8C9277D0}.Release|Any CPU.Build.0 = Release|Any CPU - {D1D1D1D1-E2E2-F3F3-A4A4-B5B5B5B5B5B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D1D1D1D1-E2E2-F3F3-A4A4-B5B5B5B5B5B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D1D1D1D1-E2E2-F3F3-A4A4-B5B5B5B5B5B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D1D1D1D1-E2E2-F3F3-A4A4-B5B5B5B5B5B3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -52,7 +45,6 @@ Global {A1B2C3D4-E5F6-7890-ABCD-EF1234567890} = {A1A1A1A1-B2B2-C3C3-D4D4-E5E5E5E5E5E1} {B7B53B6B-98B5-4B6F-9B09-598F7B8166C9} = {A1A1A1A1-B2B2-C3C3-D4D4-E5E5E5E5E5E2} {C8C64C7C-A9C6-5C7F-0C1A-609F8C9277D0} = {A1A1A1A1-B2B2-C3C3-D4D4-E5E5E5E5E5E2} - {D1D1D1D1-E2E2-F3F3-A4A4-B5B5B5B5B5B3} = {A1A1A1A1-B2B2-C3C3-D4D4-E5E5E5E5E5E2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EF6B92D5-5691-42DE-8B38-C17AE7DD7418} diff --git a/docs/MultiVehicleConfig.md b/docs/MultiVehicleConfig.md index 25403c2..3d76dfa 100644 --- a/docs/MultiVehicleConfig.md +++ b/docs/MultiVehicleConfig.md @@ -94,17 +94,18 @@ TwoLegGuessX = -(TestCarSyncDistance - DeltaDetectCenter) ## 4. 手动遥控(Medulla 车队遥控) -遥控在 Medulla 侧产生指令(`MultiVehicleManual*`,`[AsLowerIO]` 上报 Clumsy)。摇杆输出已是物理单位,Clumsy 端系数应保持 **1(直通)**。 +遥控在 Medulla 侧产生指令(`MultiVehicleManual*`,`[AsLowerIO]` 上报 Clumsy)。车队联动遥控只上报归一化摇杆比例 `[-1,1]`;实际速度/舵角/角速度统一在 Clumsy 的 `FleetManual*` 参数中换算,避免 Medulla 和 Clumsy 两层缩放叠加。 | 端 | 字段 | 含义 | 推荐值 | |----|------|------|--------| -| Medulla `[AsInitParam]` | `MaxManualSpeed` | 车队手动**最大线速度(m/s)** | `0.3` | -| Medulla `[AsInitParam]` | `MaxManualAngularSpeed` | 车队手动**最大转向角(deg)** | `45` | -| Clumsy `clumsy.json` | `ManualCarSyncVxFac` | 手动 Vx 系数(**保持 1,勿再缩放**) | `1.0` | -| Clumsy `clumsy.json` | `ManualCarSyncVthFac` | 手动 Vth 系数(**保持 1**) | `1.0` | +| Medulla `[AsLowerIO]` | `MultiVehicleManualVx/Vy/Vth` | 车队遥控摇杆比例(仅 `[-1,1]`,不带物理单位) | 摇杆值 | +| Clumsy `clumsy.json` | `FleetManualMaxSpeed` | 满杆线速度(m/s) | `0.3` | +| Clumsy `clumsy.json` | `FleetManualMaxSteerAngleDeg` | 常规模式满杆转向舵角(deg) | `45` | +| Clumsy `clumsy.json` | `FleetManualMaxCrabAngleDeg` | 蟹行模式满杆蟹行舵角(deg) | `60` | +| Clumsy `clumsy.json` | `FleetManualMaxRotateOmegaDegPerSec` | 原地旋转模式满杆角速度(deg/s) | `45` | | Clumsy `clumsy.json` | `SyncThAccPerSec` | 转向角爬升速率(deg/s) | `30` | -> 历史坑:`ManualCarSyncVxFac=0.2 × MaxManualSpeed=0.3 → 0.06 m/s`,肉眼几乎不动;`VthFac=5 → 225°` 超舵轮范围。已统一为系数=1。 +> 历史坑:旧链路会出现 `ManualCarSyncVxFac × MaxManualSpeed` 叠乘,导致满杆只有 `0.06 m/s` 这类异常低速;现在车队联动不再使用 Medulla 的 `MaxManualSpeed/MaxManualAngularSpeed`,这些字段只属于普通手动遥控。 操作:在 Medulla 打开车体工具 **「FleetRemote / 车队联动遥控」**(workspace 摇杆,松手自动回零),开「车队联动」开关后拖摇杆即可。主车摇杆驱动全队;从车由主车广播自动跟随,**无需**各自开开关。**不要**同时打开普通「手动控制」面板(会抢占优先级)。 @@ -212,8 +213,10 @@ TwoLegGuessX = -(TestCarSyncDistance - DeltaDetectCenter) "TwoLegGuessX": -1600, "MultiVehicleFleetNum": 2, "MultiVehicleUseDetect": true, -"ManualCarSyncVxFac": 1.0, -"ManualCarSyncVthFac": 1.0, +"FleetManualMaxSpeed": 0.3, +"FleetManualMaxSteerAngleDeg": 45, +"FleetManualMaxCrabAngleDeg": 60, +"FleetManualMaxRotateOmegaDegPerSec": 45, "SyncThAccPerSec": 30, "MultiVehicleMasterEndpoint": "/", // 从车: "127.0.0.1:8008" "PlaygroundRobotName": "agv_multi_1", // 从车: "agv_multi_2"