Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
namespace RobotNet.VDA5050;
public record BrokerSetting
{
public string HostServer { get; set; } = string.Empty;
public int Port { get; set; } = 1883;
public string UserName { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public int PublishRepeat { get; set; }
public bool EnablePassword { get; set; }
public bool EnableTls { get; set; }
public bool EnableSSLSecure { get; set; }
public string? CAFile { get; set; }
public string? CerFile { get; set; }
public string? KeyFile { get; set; }
}

View File

@@ -0,0 +1,34 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Connection;
public class ConnectionMsg
{
[Required]
[JsonPropertyName("headerId")]
public uint HeaderId { get; set; }
[Required]
[JsonConverter(typeof(DateTimeConverter))]
[JsonPropertyName("timestamp")]
public DateTime Timestamp { get; set; }
[Required]
[JsonPropertyName("version")]
public string Version { get; set; } = string.Empty;
[Required]
[JsonPropertyName("manufacturer")]
public string Manufacturer { get; set; } = string.Empty;
[Required]
[JsonPropertyName("serialNumber")]
public string SerialNumber { get; set; } = string.Empty;
[Required]
[JsonPropertyName("connectionState")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public ConnectionState ConnectionState { get; set; }
}

View File

@@ -0,0 +1,26 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050;
public class DateTimeConverter : JsonConverter<DateTime>
{
private const string Format = "yyyy-MM-ddTHH:mm:ss.fffZ";
public override DateTime Read(ref Utf8JsonReader reader, System.Type typeToConvert, JsonSerializerOptions options)
{
var str = reader.GetString();
if (str != null && str.EndsWith('Z'))
{
str = str[..^1];
return DateTime.ParseExact(str, "yyyy-MM-ddTHH:mm:ss.fff", null, System.Globalization.DateTimeStyles.AssumeUniversal);
}
return DateTime.Parse(str!, null, System.Globalization.DateTimeStyles.AssumeUniversal);
}
public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options)
{
var utc = value.ToUniversalTime();
writer.WriteStringValue(utc.ToString(Format));
}
}

View File

@@ -0,0 +1,58 @@
using RobotNet.VDA5050.Type;
using System.Reflection;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050;
public static class EnumHelper
{
public static string ToJsonString(this VDA5050Topic enumValue)
{
var type = enumValue.GetType();
var memberInfo = type.GetMember(enumValue.ToString()).FirstOrDefault();
if (memberInfo == null) return enumValue.ToString();
var attribute = memberInfo.GetCustomAttribute<JsonStringEnumMemberNameAttribute>();
return attribute?.Name ?? enumValue.ToString();
}
public static string ToJsonString(this Enum enumValue)
{
var type = enumValue.GetType();
var memberInfo = type.GetMember(enumValue.ToString()).FirstOrDefault();
if (memberInfo == null) return enumValue.ToString();
var attribute = memberInfo.GetCustomAttribute<JsonStringEnumMemberNameAttribute>();
return attribute?.Name ?? enumValue.ToString();
}
private static readonly Dictionary<string, ActionType> Cache = BuildCache();
private static Dictionary<string, ActionType> BuildCache()
{
var result = new Dictionary<string, ActionType>();
foreach (ActionType value in Enum.GetValues<ActionType>())
{
var field = typeof(ActionType).GetField(value.ToString());
var attribute = field?.GetCustomAttribute<JsonStringEnumMemberNameAttribute>();
if (attribute != null)
{
result[attribute.Name] = value;
}
// Cũng thêm tên enum gốc để hỗ trợ cả hai
result[value.ToString()] = value;
}
return result;
}
public static bool TryParse(string value, out ActionType result)
{
return Cache.TryGetValue(value, out result);
}
}

View File

@@ -0,0 +1,24 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class ActionParameter
{
[Required]
[JsonPropertyName("key")]
public string Key { get; set; } = string.Empty;
[Required]
[JsonPropertyName("valueDataType")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public ValueDataType ValueDataType { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
[JsonPropertyName("isOptional")]
public bool IsOptional { get; set; }
}

View File

@@ -0,0 +1,30 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class AgvAction
{
[Required]
[JsonPropertyName("actionType")]
public string ActionType { get; set; } = string.Empty;
[JsonPropertyName("actionDescription")]
public string ActionDescription { get; set; } = string.Empty;
[Required]
[JsonPropertyName("actionScopes")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public ActionScope[] ActionScopes { get; set; } = [];
[JsonPropertyName("actionParameters")]
public ActionParameter[] ActionParameters { get; set; } = [];
[JsonPropertyName("resultDescription")]
public string ResultDescription { get; set; } = string.Empty;
[JsonPropertyName("blockingTypes")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public BlockingType[] BlockingTypes { get; set; } = [];
}

View File

@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class AgvGeometry
{
[JsonPropertyName("wheelDefinitions")]
public WheelDefinition[] WheelDefinitions { get; set; } = [];
[JsonPropertyName("envelopes2d")]
public Envelopes2d[] Envelopes2d { get; set; } = [];
[JsonPropertyName("envelopes3d")]
public Envelopes3d[] Envelopes3d { get; set; } = [];
}

View File

@@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class BoundingBoxReference
{
[Required]
[JsonPropertyName("x")]
public double X { get; set; }
[Required]
[JsonPropertyName("y")]
public double Y { get; set; }
[Required]
[JsonPropertyName("z")]
public double Z { get; set; }
[JsonPropertyName("theta")]
public double Theta { get; set; }
}

View File

@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class PolygonPoint
{
[Required]
[JsonPropertyName("x")]
public double X { get; set; }
[JsonPropertyName("y")]
[Required]
public double Y { get; set; }
}
public class Envelopes2d
{
[JsonPropertyName("set")]
[Required]
public string Set { get; set; } = string.Empty;
[JsonPropertyName("polygonPoints")]
[Required]
public PolygonPoint[] PolygonPoints { get; set; } = [];
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class Envelopes3d
{
[Required]
[JsonPropertyName("set")]
public string Set { get; set; } = string.Empty;
[Required]
[JsonPropertyName("format")]
public string Format { get; set; } = string.Empty;
[JsonPropertyName("data")]
public object? Data { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; } = string.Empty;
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,54 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class FactSheetMsg
{
[JsonPropertyName("headerId")]
public uint HeaderId { get; set; }
[JsonPropertyName("timestamp")]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime Timestamp { get; set; }
[Required]
[JsonPropertyName("version")]
public string Version { get; set; } = string.Empty;
[Required]
[JsonPropertyName("manufacturer")]
public string Manufacturer { get; set; } = string.Empty;
[Required]
[JsonPropertyName("serialNumber")]
public string SerialNumber { get; set; } = string.Empty;
[Required]
[JsonPropertyName("typeSpecification")]
public TypeSpecification TypeSpecification { get; set; } = new();
[Required]
[JsonPropertyName("physicalParameters")]
public PhysicalParameter PhysicalParameters { get; set; } = new();
[Required]
[JsonPropertyName("protocolLimits")]
public ProtocolLimits ProtocolLimits { get; set; } = new();
[Required]
[JsonPropertyName("protocolFeatures")]
public ProtocolFeatures ProtocolFeatures { get; set; } = new();
[Required]
[JsonPropertyName("agvGeometry")]
public AgvGeometry AgvGeometry { get; set; } = new();
[Required]
[JsonPropertyName("loadSpecification")]
public LoadSpecification LoadSpecification { get; set; } = new();
[JsonPropertyName("vehicleConfig")]
public VehicleConfig VehicleConfig { get; set; } = new();
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class LoadDimensions
{
[Required]
[JsonPropertyName("length")]
public double Length { get; set; }
[Required]
[JsonPropertyName("width")]
public double Width { get; set; }
[JsonPropertyName("height")]
public double Height { get; set; }
}

View File

@@ -0,0 +1,61 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class LoadSet
{
[JsonPropertyName("setName")]
public string SetName { get; set; } = string.Empty;
[JsonPropertyName("loadType")]
public string LoadType { get; set; } = string.Empty;
[JsonPropertyName("loadPositions")]
public string[] LoadPositions { get; set; } = [];
[JsonPropertyName("boundingBoxReference")]
public BoundingBoxReference BoundingBoxReference { get; set; } = new();
[JsonPropertyName("loadDimensions")]
public LoadDimensions LoadDimensions { get; set; } = new();
[JsonPropertyName("maxWeight")]
public double MaxWeigth { get; set; }
[JsonPropertyName("minLoadhandlingHeight")]
public double MinLoadhandlingHeight { get; set; }
[JsonPropertyName("maxLoadhandlingHeight")]
public double MaxLoadhandlingHeight { get; set; }
[JsonPropertyName("minLoadhandlingDepth")]
public double MinLoadhandlingDepth { get; set; }
[JsonPropertyName("maxLoadhandlingDepth")]
public double MaxLoadhandlingDepth { get; set; }
[JsonPropertyName("minLoadhandlingTilt")]
public double MinLoadhandlingTilt { get; set; }
[JsonPropertyName("maxLoadhandlingTilt")]
public double MaxLoadhandlingTilt { get; set; }
[JsonPropertyName("agvSpeedLimit")]
public double AgvSpeedLimit { get; set; }
[JsonPropertyName("agvAccelerationLimit")]
public double AgvAccelerationLimit { get; set; }
[JsonPropertyName("agvDecelerationLimit")]
public double AgvDecelerationLimit { get; set; }
[JsonPropertyName("pickTime")]
public double PickTime { get; set; }
[JsonPropertyName("dropTime")]
public double DropTime { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class LoadSpecification
{
[JsonPropertyName("loadPositions")]
public string[] LoadPositions { get; set; } = [];
[JsonPropertyName("loadSets")]
public LoadSet[] LoadSets { get; set; } = [];
}

View File

@@ -0,0 +1,95 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class OrderMaxArrayLens
{
[JsonPropertyName("nodes")]
public int Nodes { get; set; }
[JsonPropertyName("edges")]
public int Edges { get; set; }
}
public class NodeMaxArrayLens
{
[JsonPropertyName("actions")]
public int Actions { get; set; }
}
public class EdgeMaxArrayLens
{
[JsonPropertyName("actions")]
public int Actions { get; set; }
}
public class ActionMaxArrayLens
{
[JsonPropertyName("actionsParameters")]
public int ActionsParameters { get; set; }
}
public class TrajectoryMaxArrayLens
{
[JsonPropertyName("knotVector")]
public int KnotVector { get; set; }
[JsonPropertyName("controlPoints")]
public int ControlPoints { get; set; }
}
public class StateMaxArrayLens
{
[JsonPropertyName("nodeStates")]
public int NodeStates { get; set; }
[JsonPropertyName("edgeStates")]
public int EdgeStates { get; set; }
[JsonPropertyName("loads")]
public int Loads { get; set; }
[JsonPropertyName("actionStates")]
public int ActionStates { get; set; }
[JsonPropertyName("errors")]
public int Errors { get; set; }
[JsonPropertyName("information")]
public int Information { get; set; }
[JsonPropertyName("errorReferences")]
public int ErrorReferences { get; set; }
}
public class InformationMaxArrayLens
{
[JsonPropertyName("infoReferences")]
public int InfoReferences { get; set; }
}
public class MaxArrayLens
{
[JsonPropertyName("order")]
public OrderMaxArrayLens Order { get; set; } = new();
[JsonPropertyName("node")]
public NodeMaxArrayLens Node { get; set; } = new();
[JsonPropertyName("edge")]
public EdgeMaxArrayLens Edge { get; set; } = new();
[JsonPropertyName("action")]
public ActionMaxArrayLens Action { get; set; } = new();
[JsonPropertyName("instantActions")]
public int InstantActions { get; set; }
[JsonPropertyName("trajectory")]
public TrajectoryMaxArrayLens Trajectory { get; set; } = new();
[JsonPropertyName("state")]
public StateMaxArrayLens State { get; set; } = new();
[JsonPropertyName("information")]
public InformationMaxArrayLens Information { get; set; } = new();
}

View File

@@ -0,0 +1,27 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class MaxStringLens
{
[JsonPropertyName("msgLen")]
public int MsgLen { get; set; }
[JsonPropertyName("topicSerialLen")]
public int TopicSerialLen { get; set; }
[JsonPropertyName("topicElemLen")]
public int TopicElemLen { get; set; }
[JsonPropertyName("idLen")]
public int IdLen { get; set; }
[JsonPropertyName("idNumericalOnly")]
public bool IdNumericalOnly { get; set; }
[JsonPropertyName("enumLen")]
public int EnumLen { get; set; }
[JsonPropertyName("loadIdLen")]
public int LoadIdLen { get; set; }
}

View File

@@ -0,0 +1,21 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class OptionalParameter
{
[Required]
[JsonPropertyName("parameter")]
public string Parameter { get; set; } = string.Empty;
[Required]
[JsonPropertyName("support")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public Support Support { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,44 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class PhysicalParameter
{
[Required]
[JsonPropertyName("speedMin")]
public double SpeedMin { get; set; }
[Required]
[JsonPropertyName("speedMax")]
public double SpeedMax { get; set; }
[JsonPropertyName("angularSpeedMin")]
public double AngularSpeedMin { get; set; }
[JsonPropertyName("angularSpeedMax")]
public double AngularSpeedMax { get; set; }
[Required]
[JsonPropertyName("accelerationMax")]
public double AccelerationMax { get; set; }
[Required]
[JsonPropertyName("decelerationMax")]
public double DecelerationMax { get; set; }
[JsonPropertyName("heightMin")]
public double HeightMin { get; set; }
[Required]
[JsonPropertyName("heightMax")]
public double HeightMax { get; set; }
[Required]
[JsonPropertyName("width")]
public double Width { get; set; }
[Required]
[JsonPropertyName("length")]
public double Length { get; set; }
}

View File

@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class ProtocolFeatures
{
[Required]
[JsonPropertyName("optionalParameters")]
public OptionalParameter[] OptionalParameters { get; set; } = [];
[Required]
[JsonPropertyName("agvActions")]
public AgvAction[] AgvActions { get; set; } = [];
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class ProtocolLimits
{
[Required]
[JsonPropertyName("maxStringLens")]
public MaxStringLens MaxStringLens { get; set; } = new();
[Required]
[JsonPropertyName("maxArrayLens")]
public MaxArrayLens MaxArrayLens { get; set; } = new();
[Required]
[JsonPropertyName("timing")]
public Timing Timing { get; set; } = new();
}

View File

@@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class Timing
{
[Required]
[JsonPropertyName("minOrderInterval")]
public double MinOrderInterval { get; set; }
[Required]
[JsonPropertyName("minStateInterval")]
public double MinStateInterval { get; set; }
[JsonPropertyName("defaultStateInterval")]
public double DefaultStateInterval { get; set; }
[JsonPropertyName("visualizationInterval")]
public double VisualizationInterval { get; set; }
}

View File

@@ -0,0 +1,39 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class TypeSpecification
{
[Required]
[JsonPropertyName("seriesName")]
public string SeriesName { get; set; } = string.Empty;
[JsonPropertyName("seriesDescription")]
public string SeriesDescription { get; set; } = string.Empty;
[Required]
[JsonPropertyName("agvKinematic")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public AgvKinematic AgvKinematic { get; set; }
[Required]
[JsonPropertyName("agvClass")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public AgvClass AgvClass { get; set; }
[Required]
[JsonPropertyName("maxLoadMass")]
public double MaxLoadMass { get; set; }
[Required]
[JsonPropertyName("localizationTypes")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public LocalizationType[] LocalizationTypes { get; set; } = [];
[Required]
[JsonPropertyName("navigationTypes")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public NavigationType[] NavigationTypes { get; set; } = [];
}

View File

@@ -0,0 +1,39 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class Version
{
[JsonPropertyName("key")]
public string Key { get; set; } = string.Empty;
[JsonPropertyName("value")]
public string Value { get; set; } = string.Empty;
}
public class Network
{
[JsonPropertyName("dnsServers")]
public string[] DnsServers { get; set; } = [];
[JsonPropertyName("ntpServers")]
public string[] NtpServers { get; set; } = [];
[JsonPropertyName("localIpAddress")]
public string LocalIpAddress { get; set; } = string.Empty;
[JsonPropertyName("netmask")]
public string Netmask { get; set; } = string.Empty;
[JsonPropertyName("defaultGateway")]
public string DefaultGateway { get; set; } = string.Empty;
}
public class VehicleConfig
{
[JsonPropertyName("versions")]
public Version[] Versions { get; set; } = [];
[JsonPropertyName("network")]
public Network Network { get; set; } = new();
}

View File

@@ -0,0 +1,53 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Factsheet;
public class WheelDefinitionsPosition
{
[Required]
[JsonPropertyName("x")]
public double X { get; set; }
[JsonPropertyName("y")]
[Required]
public double Y { get; set; }
[JsonPropertyName("theta")]
public double Theta { get; set; }
}
public class WheelDefinition
{
[Required]
[JsonPropertyName("type")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public WheelDefinitionsType Type { get; set; }
[Required]
[JsonPropertyName("isActiveDriven")]
public bool IsActiveDriven { get; set; }
[Required]
[JsonPropertyName("isActiveSteered")]
public bool IsActiveSteered { get; set; }
[Required]
[JsonPropertyName("position")]
public WheelDefinitionsPosition Position { get; set; } = new();
[Required]
[JsonPropertyName("diameter")]
public double Diameter { get; set; }
[Required]
[JsonPropertyName("width")]
public double Width { get; set; }
[JsonPropertyName("centerDisplacement")]
public double CenterDisplacement { get; set; }
[JsonPropertyName("constraints")]
public string Constraints { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,27 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.InstantAction;
public class Action
{
[Required]
[JsonPropertyName("actionType")]
public string ActionType { get; set; } = "";
[Required]
[JsonPropertyName("actionId")]
public string ActionId { get; set; } = "";
[JsonPropertyName("actionDescription")]
public string? ActionDescription { get; set; }
[Required]
[JsonPropertyName("blockingType")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public BlockingType BlockingType { get; set; }
[JsonPropertyName("actionParameters")]
public ActionParameter[]? ActionParameters { get; set; }
}

View File

@@ -0,0 +1,43 @@
using RobotNet.VDA5050.Type;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.InstantAction;
/// <summary>
/// Action data transfer object for VDMA LIF actions
/// Used in VehicleType.Actions, NodeVehicleProperty.Actions, EdgeVehicleProperty.Actions
/// </summary>
public class ActionLIF
{
/// <summary>
/// Type of action (e.g., "pick", "drop", "charge")
/// </summary>
[JsonPropertyName("actionType")]
public string ActionType { get; set; } = string.Empty;
/// <summary>
/// Description of the action
/// </summary>
[JsonPropertyName("actionDescription")]
public string? ActionDescription { get; set; }
/// <summary>
/// Requirement type: REQUIRED, CONDITIONAL, OPTIONAL
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonPropertyName("requirementType")]
public RequirementType RequirementType { get; set; }
/// <summary>
/// Blocking type: NONE, SOFT, HARD
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonPropertyName("blockingType")]
public BlockingType BlockingType { get; set; }
/// <summary>
/// Action parameters as key-value pairs
/// </summary>
[JsonPropertyName("actionParameters")]
public List<ActionParameter> ActionParameters { get; set; } = [];
}

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.InstantAction;
public class ActionParameter
{
[Required]
[JsonPropertyName("key")]
public string Key { get; set; } = "";
[Required]
[JsonPropertyName("value")]
public string Value { get; set; } = "";
}

View File

@@ -0,0 +1,32 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.InstantAction;
public class InstantActionsMsg
{
[Required]
[JsonPropertyName("headerId")]
public uint HeaderId { get; set; }
[Required]
[JsonConverter(typeof(DateTimeConverter))]
[JsonPropertyName("timestamp")]
public DateTime Timestamp { get; set; }
[Required]
[JsonPropertyName("version")]
public string Version { get; set; } = "";
[Required]
[JsonPropertyName("manufacturer")]
public string Manufacturer { get; set; } = "";
[Required]
[JsonPropertyName("serialNumber")]
public string SerialNumber { get; set; } = "";
[Required]
[JsonPropertyName("actions")]
public Action[] Actions { get; set; } = [];
}

View File

@@ -0,0 +1,18 @@
using System.Text.Json;
namespace RobotNet.VDA5050;
public class JsonOptionExtends
{
public static readonly JsonSerializerOptions Read = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
WriteIndented = true,
};
public static readonly JsonSerializerOptions Write = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
WriteIndented = true,
};
}

View File

@@ -0,0 +1,21 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Order;
public class Corridor
{
[Required]
[JsonPropertyName("leftWidth")]
public double LeftWidth { get; set; }
[Required]
[JsonPropertyName("rightWidth")]
public double RightWidth { get; set; }
[JsonPropertyName("corridorRefPoint")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public CorridorRefPoint CorridorRefPoint { get; set; }
}

View File

@@ -0,0 +1,67 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Order;
public class Edge
{
[Required]
[JsonPropertyName("edgeId")]
public string EdgeId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("sequenceId")]
public int SequenceId { get; set; }
[JsonPropertyName("edgeDescription")]
public string? EdgeDescription { get; set; }
[Required]
[JsonPropertyName("released")]
public bool Released { get; set; }
[Required]
[JsonPropertyName("startNodeId")]
public string StartNodeId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("endNodeId")]
public string EndNodeId { get; set; } = string.Empty;
[JsonPropertyName("maxSpeed")]
public double? MaxSpeed { get; set; }
[JsonPropertyName("maxHeight")]
public double? MaxHeight { get; set; }
[JsonPropertyName("minHeight")]
public double? MinHeight { get; set; }
[JsonPropertyName("orientation")]
public double? Orientation { get; set; }
[JsonPropertyName("orientationType")]
public OrientationType? OrientationType { get; set; }
[JsonPropertyName("direction")]
public string? Direction { get; set; }
[JsonPropertyName("rotationAllowed")]
public bool? RotationAllowed { get; set; }
[JsonPropertyName("maxRotationSpeed")]
public double? MaxRotationSpeed { get; set; }
[JsonPropertyName("trajectory")]
public Trajectory? Trajectory { get; set; }
[JsonPropertyName("length")]
public double? Length { get; set; }
[JsonPropertyName("corridor")]
public Corridor? Corridor { get; set; }
[Required]
[JsonPropertyName("actions")]
public InstantAction.Action[] Actions { get; set; } = [];
}

View File

@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Order;
public class Node
{
[Required]
[JsonPropertyName("nodeId")]
public string NodeId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("sequenceId")]
public int SequenceId { get; set; }
[JsonPropertyName("nodeDescription")]
public string? NodeDescription { get; set; }
[Required]
[JsonPropertyName("released")]
public bool Released { get; set; }
[JsonPropertyName("nodePosition")]
public NodePosition? NodePosition { get; set; } = new();
[Required]
[JsonPropertyName("actions")]
public InstantAction.Action[] Actions { get; set; } = [];
}

View File

@@ -0,0 +1,32 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Order;
public class NodePosition
{
[Required]
[JsonPropertyName("x")]
public double X { get; set; }
[Required]
[JsonPropertyName("y")]
public double Y { get; set; }
[JsonPropertyName("theta")]
public double? Theta { get; set; }
[JsonPropertyName("allowedDeviationXY")]
public double? AllowedDeviationXY { get; set; }
[JsonPropertyName("allowedDeviationTheta")]
public double? AllowedDeviationTheta { get; set; }
[Required]
[JsonPropertyName("mapId")]
public string MapId { get; set; } = string.Empty;
[JsonPropertyName("mapDescription")]
public string? MapDescription { get; set; }
}

View File

@@ -0,0 +1,48 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Order;
public class OrderMsg
{
[Required]
[JsonPropertyName("headerId")]
public uint HeaderId { get; set; }
[Required]
[JsonConverter(typeof(DateTimeConverter))]
[JsonPropertyName("timestamp")]
public DateTime Timestamp { get; set; }
[Required]
[JsonPropertyName("version")]
public string Version { get; set; } = "";
[Required]
[JsonPropertyName("manufacturer")]
public string Manufacturer { get; set; } = "";
[Required]
[JsonPropertyName("serialNumber")]
public string SerialNumber { get; set; } = "";
[Required]
[JsonPropertyName("orderId")]
public string OrderId { get; set; } = "";
[Required]
[JsonPropertyName("orderUpdateId")]
public int OrderUpdateId { get; set; }
[JsonPropertyName("zoneSetId")]
public string? ZoneSetId { get; set; }
[Required]
[JsonPropertyName("nodes")]
public Node[] Nodes { get; set; } = [];
[Required]
[JsonPropertyName("edges")]
public Edge[] Edges { get; set; } = [];
}

View File

@@ -0,0 +1,33 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Order;
public class ControlPoint
{
[Required]
[JsonPropertyName("x")]
public double X { get; set; }
[Required]
[JsonPropertyName("y")]
public double Y { get; set; }
[JsonPropertyName("weight")]
public double? Weight { get; set; }
}
public class Trajectory
{
[Required]
[JsonPropertyName("degree")]
public int Degree { get; set; }
[Required]
[JsonPropertyName("knotVector")]
public double[] KnotVector { get; set; } = [];
[Required]
[JsonPropertyName("controlPoints")]
public ControlPoint[] ControlPoints { get; set; } = [];
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,26 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class ActionState
{
[Required]
[JsonPropertyName("actionId")]
public string ActionId { get; set; } = string.Empty;
[JsonPropertyName("actionType")]
public string ActionType { get; set; } = string.Empty;
[JsonPropertyName("actionDescription")]
public string? ActionDescription { get; set; }
[Required]
[JsonPropertyName("actionStatus")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public ActionStatus ActionStatus { get; set; }
[JsonPropertyName("resultDescription")]
public string ResultDescription { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class BatteryState
{
[Required]
[JsonPropertyName("batteryCharge")]
public double BatteryCharge { get; set; }
[JsonPropertyName("batteryVoltage")]
public double? BatteryVoltage { get; set; }
[Range(0, 100, ErrorMessage = "Value for BatteryHealth must be between 0 and 100.")]
[JsonPropertyName("batteryHealth")]
public double BatteryHealth { get; set; }
[Required]
[JsonPropertyName("charging")]
public bool Charging { get; set; }
[JsonPropertyName("reach")]
public double? Reach { get; set; }
}

View File

@@ -0,0 +1,27 @@
using RobotNet.VDA5050.Order;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class EdgeState
{
[Required]
[JsonPropertyName("edgeId")]
public string EdgeId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("sequenceId")]
public int SequenceId { get; set; }
[JsonPropertyName("edgeDescription")]
public string? EdgeDescription { get; set; }
[Required]
[JsonPropertyName("released")]
public bool Released { get; set; }
[JsonPropertyName("trajectory")]
public Trajectory? Trajectory { get; set; }
}

View File

@@ -0,0 +1,38 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class ErrorReference
{
[Required]
[JsonPropertyName("referenceKey")]
public string ReferenceKey { get; set; } = string.Empty;
[Required]
[JsonPropertyName("referenceValue")]
public string ReferenceValue { get; set; } = string.Empty;
}
public class Error
{
[Required]
[JsonPropertyName("errorType")]
public string ErrorType { get; set; } = string.Empty;
[JsonPropertyName("errorReferences")]
public ErrorReference[]? ErrorReferences { get; set; }
[JsonPropertyName("errorDescription")]
public string? ErrorDescription { get; set; }
[JsonPropertyName("errorHint")]
public string? ErrorHint { get; set; }
[JsonPropertyName("errorLevel")]
[JsonConverter(typeof(JsonStringEnumConverter))]
[Required]
public ErrorLevel ErrorLevel { get; set; }
}

View File

@@ -0,0 +1,35 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class InfomationReference
{
[Required]
[JsonPropertyName("referenceKey")]
public string ReferenceKey { get; set; } = string.Empty;
[Required]
[JsonPropertyName("referenceValue")]
public string ReferenceValue { get; set; } = string.Empty;
}
public class Information
{
[Required]
[JsonPropertyName("infoType")]
public string InfoType { get; set; } = string.Empty;
[JsonPropertyName("infoReferences")]
public InfomationReference[]? InfoReferences { get; set; }
[JsonPropertyName("infoDescription")]
public string? InfoDescription { get; set; }
[Required]
[JsonPropertyName("infoLevel")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public InfoLevel InfoLevel { get; set; }
}

View File

@@ -0,0 +1,26 @@
using RobotNet.VDA5050.Factsheet;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class Load
{
[JsonPropertyName("loadId")]
public string? LoadId { get; set; }
[JsonPropertyName("loadType")]
public string? LoadType { get; set; }
[JsonPropertyName("loadPosition")]
public string? LoadPosition { get; set; }
[JsonPropertyName("boundingBoxReference")]
public BoundingBoxReference? BoundingBoxReference { get; set; }
[JsonPropertyName("loadDimensions")]
public LoadDimensions? LoadDimensions { get; set; }
[JsonPropertyName("weight")]
public double? Weight { get; set; }
}

View File

@@ -0,0 +1,25 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class Map
{
[Required]
[JsonPropertyName("mapId")]
public string MapId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("mapVersion")]
public string MapVersion { get; set; } = string.Empty;
[JsonPropertyName("mapDescription")]
public string? MapDescription { get; set; }
[Required]
[JsonPropertyName("mapStatus")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public MapStatus MapStatus { get; set; }
}

View File

@@ -0,0 +1,27 @@
using RobotNet.VDA5050.Order;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class NodeState
{
[Required]
[JsonPropertyName("nodeId")]
public string NodeId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("sequenceId")]
public int SequenceId { get; set; }
[JsonPropertyName("nodeDescription")]
public string? NodeDescription { get; set; }
[Required]
[JsonPropertyName("released")]
public bool Released { get; set; }
[JsonPropertyName("nodePosition")]
public NodePosition? NodePosition { get; set; } = new();
}

View File

@@ -0,0 +1,17 @@
using RobotNet.VDA5050.Type;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class SafetyState
{
[Required]
[JsonPropertyName("eStop")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public EStop EStop { get; set; }
[Required]
[JsonPropertyName("fieldViolation")]
public bool FieldViolation { get; set; }
}

View File

@@ -0,0 +1,103 @@
using RobotNet.VDA5050.Visualization;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.State;
public class StateMsg
{
[Required]
[JsonPropertyName("headerId")]
public uint HeaderId { get; set; }
[JsonConverter(typeof(DateTimeConverter))]
[JsonPropertyName("timestamp")]
public DateTime Timestamp { get; set; }
[Required]
[JsonPropertyName("version")]
public string Version { get; set; } = string.Empty;
[Required]
[JsonPropertyName("manufacturer")]
public string Manufacturer { get; set; } = string.Empty;
[Required]
[JsonPropertyName("serialNumber")]
public string SerialNumber { get; set; } = string.Empty;
[JsonPropertyName("maps")]
public Map[]? Maps { get; set; }
[Required]
[JsonPropertyName("orderId")]
public string OrderId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("orderUpdateId")]
public int OrderUpdateId { get; set; }
[JsonPropertyName("zoneSetId")]
public string? ZoneSetId { get; set; }
[Required]
[JsonPropertyName("lastNodeId")]
public string LastNodeId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("lastNodeSequenceId")]
public int LastNodeSequenceId { get; set; }
[Required]
[JsonPropertyName("driving")]
public bool Driving { get; set; }
[JsonPropertyName("paused")]
public bool Paused { get; set; }
[JsonPropertyName("newBaseRequest")]
public bool NewBaseRequest { get; set; }
[JsonPropertyName("distanceSinceLastNode")]
public double? DistanceSinceLastNode { get; set; }
[Required]
[JsonPropertyName("operatingMode")]
public string OperatingMode { get; set; } = string.Empty;
[Required]
[JsonPropertyName("nodeStates")]
public NodeState[] NodeStates { get; set; } = [];
[Required]
[JsonPropertyName("edgeStates")]
public EdgeState[] EdgeStates { get; set; } = [];
[JsonPropertyName("agvPosition")]
public AgvPosition AgvPosition { get; set; } = new();
[JsonPropertyName("velocity")]
public Velocity Velocity { get; set; } = new();
[JsonPropertyName("loads")]
public Load[] Loads { get; set; } = [];
[Required]
[JsonPropertyName("actionStates")]
public ActionState[] ActionStates { get; set; } = [];
[Required]
[JsonPropertyName("batteryState")]
public BatteryState BatteryState { get; set; } = new();
[Required]
[JsonPropertyName("errors")]
public Error[] Errors { get; set; } = [];
[JsonPropertyName("information")]
public Information[] Information { get; set; } = [];
[Required]
[JsonPropertyName("safetyState")]
public SafetyState SafetyState { get; set; } = new();
}

View File

@@ -0,0 +1,8 @@
namespace RobotNet.VDA5050.Type;
public enum ActionScope
{
INSTANT,
NODE,
EDGE,
}

View File

@@ -0,0 +1,21 @@
namespace RobotNet.VDA5050.Type;
public enum ActionStatus
{
WAITING,
INITIALIZING,
RUNNING,
PAUSED,
FINISHED,
FAILED,
}
public enum ActionEvent
{
WAITING,
INITIALIZING,
RUNNING,
PAUSED,
FINISHED,
FAILED,
}

View File

@@ -0,0 +1,81 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Type;
public enum ActionType
{
[JsonStringEnumMemberName("startPause")]
START_PAUSE,
[JsonStringEnumMemberName("stopPause")]
STOP_PAUSE,
[JsonStringEnumMemberName("startCharging")]
START_CHARGING,
[JsonStringEnumMemberName("stopCharging")]
STOP_CHARGING,
[JsonStringEnumMemberName("initPosition")]
INIT_POSITION,
[JsonStringEnumMemberName("downloadMap")]
DOWNLOAD_MAP,
[JsonStringEnumMemberName("enableMap")]
ENABLE_MAP,
[JsonStringEnumMemberName("deleteMap")]
DELETE_MAP,
[JsonStringEnumMemberName("stateRequest")]
STATE_REQUEST,
[JsonStringEnumMemberName("logReport")]
LOG_REPORT,
[JsonStringEnumMemberName("pick")]
PICK,
[JsonStringEnumMemberName("drop")]
DROP,
[JsonStringEnumMemberName("detectObject")]
DETECT_OBJECT,
[JsonStringEnumMemberName("finePositioning")]
FINE_POSITIONING,
[JsonStringEnumMemberName("waitForTrigger")]
WAIT_FOR_TRIGGER,
[JsonStringEnumMemberName("cancelOrder")]
CANCEL_ORDER,
[JsonStringEnumMemberName("factsheetRequest")]
FACTSHEET_REQUEST,
[JsonStringEnumMemberName("liftRotate")]
LIFT_ROTATE,
[JsonStringEnumMemberName("rotate")]
ROTATE,
[JsonStringEnumMemberName("rotateKeepLift")]
ROTATE_KEEP_LIFT,
[JsonStringEnumMemberName("mutedBaseOn")]
MUTED_BASE_ON,
[JsonStringEnumMemberName("mutedBaseOff")]
MUTED_BASE_OFF,
[JsonStringEnumMemberName("mutedLoadOn")]
MUTED_LOAD_ON,
[JsonStringEnumMemberName("mutedLoadOff")]
MUTED_LOAD_OFF,
[JsonStringEnumMemberName("dockTo")]
DOCK_TO,
[JsonStringEnumMemberName("moveStraightToCoor")]
MOVE_STRAIGHT_TO_COOR,
[JsonStringEnumMemberName("moveStraightWithDistance")]
MOVE_STRAIGHT_WITH_DISTANCE,
[JsonStringEnumMemberName("example")]
EXAMPLE,
[JsonStringEnumMemberName("script")]
SCRIPT,
[JsonStringEnumMemberName("homingCamera")]
HOMING_CAMERA,
[JsonStringEnumMemberName("liftCameraByHeight")]
LIFT_CAMERA_BY_HEIGHT,
[JsonStringEnumMemberName("cameraLightOn")]
CAMERA_LIGHT_ON,
[JsonStringEnumMemberName("cameraLightOff")]
CAMERA_LIGHT_OFF,
[JsonStringEnumMemberName("controlLight")]
CONTROL_LIGHT,
}

View File

@@ -0,0 +1,9 @@
namespace RobotNet.VDA5050.Type;
public enum AgvClass
{
FORKLIFT,
CONVEYOR,
TUGGER,
CARRIER
}

View File

@@ -0,0 +1,8 @@
namespace RobotNet.VDA5050.Type;
public enum AgvKinematic
{
DIFF,
OMNI,
THREEWHEEL
}

View File

@@ -0,0 +1,8 @@
namespace RobotNet.VDA5050.Type;
public enum BlockingType
{
NONE,
SOFT,
HARD
}

View File

@@ -0,0 +1,9 @@
namespace RobotNet.VDA5050.Type;
public enum ConnectionState
{
ONLINE,
OFFLINE,
CONNECTIONBROKEN
}

View File

@@ -0,0 +1,7 @@
namespace RobotNet.VDA5050.Type;
public enum CorridorRefPoint
{
KINEMATICCENTER,
CONTOUR
}

View File

@@ -0,0 +1,9 @@
namespace RobotNet.VDA5050.Type;
public enum EStop
{
AUTOACK,
MANUAL,
REMOTE,
NONE,
}

View File

@@ -0,0 +1,9 @@
namespace RobotNet.VDA5050.Type;
public enum ErrorLevel
{
NONE,
WARNING,
FATAL
}

View File

@@ -0,0 +1,33 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Type;
public enum ErrorType
{
[JsonStringEnumMemberName("validationError")]
VALIDATION_ERROR,
[JsonStringEnumMemberName("orderError")]
ORDER_ERROR,
[JsonStringEnumMemberName("orderUpdateError")]
ORDER_UPDATE_ERROR,
[JsonStringEnumMemberName("peripheralError")]
PERIPHERAL_ERROR,
[JsonStringEnumMemberName("initializeOrder")]
INITIALIZE_ORDER,
[JsonStringEnumMemberName("navigationError")]
NAVIGATION_ERROR,
[JsonStringEnumMemberName("localizationError")]
LOCALIZATION_ERROR,
[JsonStringEnumMemberName("batteryError")]
BATTERY_ERROR,
[JsonStringEnumMemberName("driverError")]
DRIVER_ERROR,
}

View File

@@ -0,0 +1,7 @@
namespace RobotNet.VDA5050.Type;
public enum InfoLevel
{
INFO,
DEBUG
}

View File

@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Type;
public enum InformationType
{
[JsonStringEnumMemberName("general")]
GENERAL,
}
public enum InformationReferencesKey
{
[JsonStringEnumMemberName("state")]
STATE,
}

View File

@@ -0,0 +1,11 @@
namespace RobotNet.VDA5050.Type;
public enum LocalizationType
{
NATURAL,
REFLECTOR,
RFID,
DMC,
SPOT,
GRID,
}

View File

@@ -0,0 +1,8 @@
namespace RobotNet.VDA5050.Type;
public enum MapStatus
{
Enabled,
Disabled,
}

View File

@@ -0,0 +1,8 @@
namespace RobotNet.VDA5050.Type;
public enum NavigationType
{
PHYSICAL_LINDE_GUIDED,
VIRTUAL_LINE_GUIDED,
AUTONOMOUS,
}

View File

@@ -0,0 +1,10 @@
namespace RobotNet.VDA5050.Type;
public enum OperatingMode
{
AUTOMATIC,
SEMIAUTOMATIC,
MANUAL,
SERVICE,
TEACHIN,
}

View File

@@ -0,0 +1,18 @@
namespace RobotNet.VDA5050.Type;
/// <summary>
/// Orientation type for vehicle on edge (VDMA LIF: orientationType)
/// </summary>
public enum OrientationType
{
/// <summary>
/// Global orientation - absolute to map origin
/// </summary>
GLOBAL = 0,
/// <summary>
/// Tangential orientation - follows edge direction
/// </summary>
TANGENTIAL = 1
}

View File

@@ -0,0 +1,33 @@
namespace RobotNet.VDA5050.Type;
/// <summary>
/// Specifies the requirement level for a parameter or field.
/// </summary>
/// <remarks>Use this enumeration to indicate whether a value is required, optional, or conditionally required in
/// a given context. The meaning of 'conditional' should be defined by the consuming API or documentation.</remarks>
public enum RequirementType
{
/// <summary>
/// Indicates that the associated member or parameter is required.
/// </summary>
/// <remarks>Use this attribute to specify that a value must be provided for the decorated member or
/// parameter. This is commonly used for validation purposes in data models or method signatures.</remarks>
REQUIRED,
/// <summary>
/// Indicates that a method or class is conditionally compiled based on the presence of a specified preprocessing
/// symbol.
/// </summary>
/// <remarks>Apply this attribute to methods or classes to include them in the compiled output only if the
/// specified conditional compilation symbol is defined. This is commonly used to include debugging or tracing code
/// in builds where certain symbols (such as DEBUG) are present. If the symbol is not defined, calls to the
/// attributed method are omitted from the compiled code.</remarks>
CONDITIONAL,
/// <summary>
/// Indicates that the associated parameter is optional.
/// </summary>
/// <remarks>This attribute can be applied to parameters to specify that they are optional. When used,
/// callers may omit the parameter when invoking the method or constructor.</remarks>
OPTIONAL
}

View File

@@ -0,0 +1,28 @@
namespace RobotNet.VDA5050.Type;
/// <summary>
/// Rotation direction allowed at nodes (VDMA LIF: rotationAtStartNodeAllowed, rotationAtEndNodeAllowed)
/// </summary>
public enum RotationDirection
{
/// <summary>
/// No rotation allowed
/// </summary>
NONE = 0,
/// <summary>
/// Counter-clockwise rotation allowed
/// </summary>
CCW = 1,
/// <summary>
/// Clockwise rotation allowed
/// </summary>
CW = 2,
/// <summary>
/// Both clockwise and counter-clockwise rotation allowed
/// </summary>
BOTH = 3
}

View File

@@ -0,0 +1,7 @@
namespace RobotNet.VDA5050.Type;
public enum Support
{
SUPPORTED,
REQUIRED,
}

View File

@@ -0,0 +1,12 @@
namespace RobotNet.VDA5050.Type;
public enum ValueDataType
{
BOOL,
NUMBER,
INTEGER,
FLOAT,
STRING,
OBJECT,
ARRAY,
}

View File

@@ -0,0 +1,9 @@
namespace RobotNet.VDA5050.Type;
public enum WheelDefinitionsType
{
DRIVE,
CASTER,
FIXED,
MECANUM,
}

View File

@@ -0,0 +1,9 @@
namespace RobotNet.VDA5050;
public record VDA5050Setting
{
public string SerialNumber { get; set; } = string.Empty;
public string Manufacturer { get; set; } = string.Empty;
public string Version { get; set; } = string.Empty;
public string? TopicPrefix { get; set; }
}

View File

@@ -0,0 +1,26 @@
using RobotNet.VDA5050.Type;
using System.Reflection;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050;
public enum VDA5050Topic
{
[JsonStringEnumMemberName("connection")]
CONNECTION,
[JsonStringEnumMemberName("order")]
ORDER,
[JsonStringEnumMemberName("instantActions")]
INSTANTACTIONS,
[JsonStringEnumMemberName("state")]
STATE,
[JsonStringEnumMemberName("visualization")]
VISUALIZATION,
[JsonStringEnumMemberName("factsheet")]
FACTSHEET
}

View File

@@ -0,0 +1,37 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Visualization;
public class AgvPosition
{
[Required]
[JsonPropertyName("x")]
public double X { get; set; }
[Required]
[JsonPropertyName("y")]
public double Y { get; set; }
[Required]
[JsonPropertyName("theta")]
public double Theta { get; set; }
[Required]
[JsonPropertyName("mapId")]
public string MapId { get; set; } = string.Empty;
[Required]
[JsonPropertyName("mapDescription")]
public string MapDescription { get; set; } = string.Empty;
[Required]
[JsonPropertyName("positionInitialized")]
public bool PositionInitialized { get; set; }
[JsonPropertyName("localizationScore")]
public double LocalizationScore { get; set; }
[JsonPropertyName("deviationRange")]
public double DeviationRange { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Visualization;
public class Velocity
{
[Required]
[JsonPropertyName("vx")]
public double Vx { get; set; }
[Required]
[JsonPropertyName("vy")]
public double Vy { get; set; }
[Required]
[JsonPropertyName("omega")]
public double Omega { get; set; }
}

View File

@@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet.VDA5050.Visualization;
public class VisualizationMsg
{
[Required]
[JsonPropertyName("headerId")]
public uint HeaderId { get; set; }
[Required]
[JsonPropertyName("timestamp")]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime Timestamp { get; set; }
[Required]
[JsonPropertyName("version")]
public string Version { get; set; } = string.Empty;
[Required]
[JsonPropertyName("manufacturer")]
public string Manufacturer { get; set; } = string.Empty;
[Required]
[JsonPropertyName("serialNumber")]
public string SerialNumber { get; set; } = string.Empty;
[JsonPropertyName("agvPosition")]
public AgvPosition AgvPosition { get; set; } = new();
[JsonPropertyName("velocity")]
public Velocity Velocity { get; set; } = new();
}