Add Clumsy plugins and dual-vehicle fleet sync demo.

Restructure into DiffWheel/MultiWheel folders, add DiffWheelC and MultiWheelC with MovementTests, FleetRemote multi-vehicle manual sync, deploy templates, and documentation. Update dependency paths to D:\MDCS\Release and mirror motor feedback in MotorRoutine for simulation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-28 15:04:55 +08:00
co-authored by Cursor
parent e5aeae9c33
commit 235c6c70ac
40 changed files with 2750 additions and 99 deletions
+32
View File
@@ -0,0 +1,32 @@
using CartActivator;
namespace DiffWheelM;
[UseManualController(manualController = typeof(Remote))]
[UseLadderLogic(logic = typeof(MotorRoutine), scanInterval = 50)]
public class CartDefinition : CartActivator.CartDefinition
{
[AsUpperIO(desc = "左轮下发速度", timeOutReset = true)]
[Playground]
public float SpeedLeft;
[AsUpperIO(desc = "右轮下发速度", timeOutReset = true)]
[Playground]
public float SpeedRight;
[AsLowerIO(desc = "左轮实际速度")]
[Playground]
public float ActualSpeedLeft;
[AsLowerIO(desc = "右轮实际速度")]
[Playground]
public float ActualSpeedRight;
[AsInitParam(desc = "手动最大轮速(m/s)")]
public float MaxManualSpeed = 0.3f;
public override void Init()
{
Console.WriteLine("[DiffWheelM] Minimal Medulla cart initialized.");
}
}
+31
View File
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU</Platforms>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>..\..\build\Medulla\plugins\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="CartActivator">
<HintPath>D:\MDCS\Release\Medulla\RefCartActivator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MedullaCore">
<HintPath>D:\MDCS\Release\Medulla\RefMedullaCore.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Medulla">
<HintPath>D:\MDCS\Release\Medulla\RefMedulla2.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="FundamentalLib">
<HintPath>D:\MDCS\Release\deps\RefFundamentalLib.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
</Project>
+12
View File
@@ -0,0 +1,12 @@
using CartActivator;
namespace DiffWheelM;
public class MotorRoutine : LadderLogic<CartDefinition>
{
public override void Operation(int iteration)
{
cart.ActualSpeedLeft = cart.SpeedLeft;
cart.ActualSpeedRight = cart.SpeedRight;
}
}
+31
View File
@@ -0,0 +1,31 @@
using CartActivator;
namespace DiffWheelM;
public class Remote : ManualController<CartDefinition>
{
[AsControlItem(name = "速度摇杆", keyboard = "Up,Down,Left,Right", joystick = "Axis0,Axis1")]
public Stick Direction;
[AsControlItem(name = "速度比例", keyboard = "Q,W")]
public Throttle SpeedRatio;
public override void Operation()
{
var maxSpeed = Math.Max(0, cart.MaxManualSpeed);
var speedRatio = Math.Clamp(SpeedRatio.val, 0, 1);
var left = Direction.y - Direction.x;
var right = Direction.y + Direction.x;
var wheelScale = Math.Max(1, Math.Max(Math.Abs(left), Math.Abs(right)));
left = left / wheelScale * maxSpeed * speedRatio;
right = right / wheelScale * maxSpeed * speedRatio;
cart.SpeedLeft = Math.Clamp(left, -maxSpeed, maxSpeed);
cart.SpeedRight = Math.Clamp(right, -maxSpeed, maxSpeed);
statusText = $"L={cart.SpeedLeft:0.000}m/s, R={cart.SpeedRight:0.000}m/s";
}
}