✨ feat: 初始化飞拍替换方案仓库骨架
* 建立 .NET 8 解决方案及分层项目结构 * 添加 Flyshot.Core.Domain 领域模型(机器人、轨迹、运动学) * 添加 Flyshot.Core.Planning 规划层(ICSP、CubicSpline、采样器) * 添加 Flyshot.Core.Triggering 触发时序与 IO 时间轴 * 添加 Flyshot.Core.Config 配置兼容与 .robot 解析 * 添加 Flyshot.Server.Host 最小宿主及 /healthz 端点 * 补充单元测试与集成测试项目 * 添加 CLAUDE.md、AGENTS.md、README.md 项目规范
This commit is contained in:
86
src/Flyshot.Core.Domain/TrajectoryRequest.cs
Normal file
86
src/Flyshot.Core.Domain/TrajectoryRequest.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Flyshot.Core.Domain;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to plan or execute a flyshot trajectory.
|
||||
/// </summary>
|
||||
public sealed class TrajectoryRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a trajectory request with compatibility-oriented defaults.
|
||||
/// </summary>
|
||||
public TrajectoryRequest(
|
||||
RobotProfile robot,
|
||||
FlyshotProgram program,
|
||||
PlanningMethod method,
|
||||
bool moveToStart = false,
|
||||
bool saveTrajectoryArtifacts = false,
|
||||
bool useCache = false)
|
||||
{
|
||||
Robot = robot ?? throw new ArgumentNullException(nameof(robot));
|
||||
Program = program ?? throw new ArgumentNullException(nameof(program));
|
||||
Method = method;
|
||||
MoveToStart = moveToStart;
|
||||
SaveTrajectoryArtifacts = saveTrajectoryArtifacts;
|
||||
UseCache = useCache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the robot profile that constrains planning and runtime compatibility.
|
||||
/// </summary>
|
||||
[JsonPropertyName("robot")]
|
||||
public RobotProfile Robot { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the uploaded program to be planned or executed.
|
||||
/// </summary>
|
||||
[JsonPropertyName("program")]
|
||||
public FlyshotProgram Program { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the selected planning method.
|
||||
/// </summary>
|
||||
[JsonPropertyName("method")]
|
||||
public PlanningMethod Method { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the robot should move to the first waypoint before execution.
|
||||
/// </summary>
|
||||
[JsonPropertyName("moveToStart")]
|
||||
public bool MoveToStart { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether trajectory artifacts should be exported.
|
||||
/// </summary>
|
||||
[JsonPropertyName("saveTrajectoryArtifacts")]
|
||||
public bool SaveTrajectoryArtifacts { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether cached planning artifacts may be reused.
|
||||
/// </summary>
|
||||
[JsonPropertyName("useCache")]
|
||||
public bool UseCache { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the planning mode requested by compatibility APIs.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public enum PlanningMethod
|
||||
{
|
||||
/// <summary>
|
||||
/// Uses the cubic-spline ICSP planner.
|
||||
/// </summary>
|
||||
Icsp,
|
||||
|
||||
/// <summary>
|
||||
/// Uses the adaptive ICSP planner that may insert additional points.
|
||||
/// </summary>
|
||||
SelfAdaptIcsp,
|
||||
|
||||
/// <summary>
|
||||
/// Uses the Double-S planner.
|
||||
/// </summary>
|
||||
Doubles
|
||||
}
|
||||
Reference in New Issue
Block a user