GlobalPathContext.cs
2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
namespace Rcs.Application.Services.PathFind.Models;
/// <summary>
/// 全局路径上下文(扩展版,包含机器人速度信息)
/// @author zzy
/// </summary>
public class GlobalPathContext
{
/// <summary>
/// 机器人已规划的边(机器人ID -> 边列表)
/// </summary>
public Dictionary<Guid, List<PlannedEdge>> RobotPlannedEdges { get; set; } = new();
/// <summary>
/// 机器人平均速度(机器人ID -> 速度(米/秒))
/// 用于预估当前机器人到达冲突边的时间
/// </summary>
public Dictionary<Guid, double> RobotAverageSpeeds { get; set; } = new();
}
/// <summary>
/// 已规划边(扩展版,包含机器人运行时状态)
/// @author zzy
/// </summary>
public class PlannedEdge
{
/// <summary>
/// 起始节点ID
/// </summary>
public Guid FromNodeId { get; set; }
/// <summary>
/// 目标节点ID
/// </summary>
public Guid ToNodeId { get; set; }
/// <summary>
/// 起始节点Code(用于跨地图冲突检测)
/// </summary>
public string FromNodeCode { get; set; } = string.Empty;
/// <summary>
/// 目标节点Code(用于跨地图冲突检测)
/// </summary>
public string ToNodeCode { get; set; } = string.Empty;
/// <summary>
/// 地图编码(用于区分不同厂商地图)
/// </summary>
public string MapCode { get; set; } = string.Empty;
/// <summary>
/// 边的长度(米)
/// </summary>
public double Length { get; set; }
/// <summary>
/// 机器人在该边上已行驶的距离(米)
/// 0表示还未到达该边,只是计划要走
/// </summary>
public double TraveledDistance { get; set; }
/// <summary>
/// 机器人当前速度(米/秒),0表示停止
/// </summary>
public double CurrentSpeed { get; set; }
/// <summary>
/// 机器人平均速度(米/秒),用于预估到达时间
/// </summary>
public double AverageSpeed { get; set; }
/// <summary>
/// 是否被障碍物阻挡(如遇到人)
/// </summary>
public bool IsBlocked { get; set; }
/// <summary>
/// 机器人到达该边起点的预估时间(秒)
/// 仅当 TraveledDistance == 0 时有效,表示机器人还需要多久才能到达该边
/// </summary>
public double EstimatedArrivalTime { get; set; }
}