引入最短舵角行驶的CommonUsage并更新项目引用

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-28 18:38:12 +08:00
co-authored by Cursor
parent 8e8af847db
commit 583a7d00ca
78 changed files with 5585 additions and 12 deletions
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class action
{
public string actionId { get; set; }
public string actionType { get; set; }
public string actionDescription { get; set; }
public string blockingType { get; set; }
}
}
@@ -0,0 +1,45 @@
using Newtonsoft.Json.Converters;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class actionState
{
public actionState(action action,ActionStateEnum state)
{
actionId = action.actionId;
actionDescription = action.actionDescription;
actionType = action.actionType;
actionStatus = state;
}
public actionState()
{
}
public string actionId { get; set; }
public string actionType { get; set; }
public string actionDescription { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public ActionStateEnum actionStatus { get; set; }
public string resultDescription { get; set; }
public enum ActionStateEnum
{
WAITING,
INITIALIZING,
RUNNING,
PAUSED,
FINISHED,
FAILED
}
}
}
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Text;
using static CommonUsage.Protocols.VDA5050.Objects.agvGeometry;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class agvGeometry
{
// Wheel Definitions
public List<wheelDefinition> wheelDefinitions { get; set; } = new List<wheelDefinition>();
// 2D Envelopes
public List<envelope2D> envelopes2D { get; set; } = new List<envelope2D>();
// 3D Envelopes
public List<envelope3D> envelopes3D { get; set; } = new List<envelope3D>();
public class wheelDefinition
{
public enum WheelType { DRIVE, CASTER, FIXED, MECANUM }
public WheelType type { get; set; }
public bool isActiveDriven { get; set; }
public bool isActiveSteered { get; set; }
// Wheel Position
public double positionX { get; set; }
public double positionY { get; set; }
public double positionTheta { get; set; } // Required for fixed wheels
// Wheel Properties
public double diameter { get; set; }
public double width { get; set; }
public double centerDisplacement { get; set; } = 0; // Default to 0 if not defined
public string constraints { get; set; }
}
public class envelope2D
{
public string set { get; set; }
public List<polygonPoint> polygonPoints { get; set; } = new List<polygonPoint>();
public string description { get; set; }
public class polygonPoint
{
public double x { get; set; }
public double y { get; set; }
}
}
public class envelope3D
{
public string set { get; set; }
public string format { get; set; }
public object data { get; set; } // JSON object for 3D envelope data
public string url { get; set; }
public string description { get; set; }
}
}
}
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class agvPosition
{
public bool positionInitialized;
public double x;
public double y;
public double theta;
public double localizationScore;
public double deviationRange;
public string mapId = "";
public string mapDescription = "";
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class batteryState
{
public double batteryCharge;
public double batteryVoltage;
public double batteryHealth;
public bool charging;
public int reach;
}
}
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class boundingBoxReference
{
public double X { get; set; } // Reference point X in AGV coordinate system
public double Y { get; set; } // Reference point Y in AGV coordinate system
public double Z { get; set; } // Reference point Z in AGV coordinate system
public double Theta { get; set; } // Orientation of the load bounding box
}
}
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class controlPoint
{
public float x;
public float y;
public float weight;
public controlPoint(float x, float y, float weight)
{
this.x = x;
this.y = y;
this.weight = weight;
}
}
}
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class edge : sequenceItem
{
public string edgeId;
public string edgeDescription;
public string startNodeId;
public string endNodeId;
public double maxSpeed;
public double orientation;
public trajectory? trajectory;
public float[] trackTypeInfo;
// public List<Vector2> controlPoints;
//
// public List<float> weights;
public action[] action = [];
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class edgeState : sequenceItem
{
public string edgeId;
public string edgeDescription;
public trajectory trajectory;
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class errorReference
{
public string referenceKey { get; set; } // Type of reference (e.g., nodeId, edgeId, actionId)
public string referenceValue { get; set; } // Value corresponding to the referenceKey
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class errorState
{
public List<errorReference> errorReferences { get; set; } = new List<errorReference>(); // Array of references
public string errorType { get; set; } // Required: Type/name of the error
public string errorDescription { get; set; } // Verbose description of the error
public string errorHint { get; set; } // Hint for resolving the error
public string errorLevel { get; set; } // Required: WARNING or FATAL
}
}
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class info
{
public string infoType { get; set; } // Type/name of the information
public List<infoReference> infoReferences { get; set; } = new List<infoReference>(); // List of references
public string infoDescription { get; set; } // Description of the information
public infoLevelEnum infoLevel { get; set; } // Debugging or visualization level
public class infoReference
{
public string ReferenceKey { get; set; } // Reference type (e.g., headerId, orderId)
public string ReferenceValue { get; set; } // The actual referenced field value
}
public enum infoLevelEnum
{
DEBUG, // Used for debugging
INFO // Used for visualization
}
}
}
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class load
{
public string loadId { get; set; } // Unique ID (barcode, RFID, etc.)
public string loadType { get; set; } // Type of load
public string loadPosition { get; set; } // Load handling position (e.g., "front", "back")
public boundingBoxReference boundingBoxReference { get; set; } = new boundingBoxReference();
public loadDimensions loadDimensions { get; set; } = new loadDimensions();
public double weight { get; set; } // Weight of load in kg (0.0 to ∞)
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class loadDimensions
{
public double Length { get; set; } // Length of the bounding box
public double Width { get; set; } // Width of the bounding box
public double Height { get; set; } // Height of the bounding box (optional)
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class node : sequenceItem
{
public string nodeId;
public string nodeDescription;
public nodePosition nodePosition;
public action[] actions = [];
}
}
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
/// <summary>
/// Defines the position on a map in a global project-specific world coordinate system.
/// Each floor has its own map.
/// All maps shall use the same project-specific global origin.
/// </summary>
public class nodePosition
{
/// <summary>
/// X-position on the map in reference to the map coordinate system.
/// Precision is up to the specific implementation.
/// </summary>
public double x;
/// <summary>
/// Y-position on the map in reference to the map coordinate system.
/// Precision is up to the specific implementation.
/// </summary>
public double y;
/// <summary>
/// Range: [-Pi ... Pi]
/// Absolute orientation of the AGV on the node.
/// Optional: vehicle can plan the path by itself. If defined, the AGV has to assume the theta angle on this node.
/// If previous edge disallows rotation, the AGV shall rotate on the node.
/// If following edge has a differing orientation defined but disallows rotation,
/// the AGV is to rotate on the node to the edges desired rotation before entering the edge.
/// </summary>
public double theta;
}
}
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class nodeState : sequenceItem
{
/// <summary>
/// Unique node identification.
/// </summary>
public string nodeId;
/// <summary>
/// Additional information on the node.
/// </summary>
public string nodeDescription;
/// <summary>
/// Node position.
/// The object is defined in 6.6 Topic: "order" (from master control to AGV)
/// Optional: Master control has this information. Can be sent additionally, e.g., for debugging purposes.
/// </summary>
public nodePosition nodePosition;
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class physicalParameters
{
public double speedMin;
public double speedMax;
public double angularSpeedMin;
public double angularSpeedMax;
public double accelerationMax;
public double decelerationMax;
public double heightMin;
public double heightMax;
public double width;
public double length;
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class protocolFeatures
{
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class protocolLimits
{
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class safetyState
{
public eStopEnum eStop { get; set; } // Emergency stop status
public bool fieldViolation { get; set; } // "true" if a safety field is violated, "false" otherwise
public enum eStopEnum
{
AUTOACK, // Auto-acknowledged emergency stop (e.g., triggered by a bumper)
MANUAL, // Manually confirmed emergency stop
REMOTE, // Remote-confirmed emergency stop
NONE // No emergency stop activated
}
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class sequenceItem
{
public uint sequenceId;
public bool released;
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class trajectory
{
public float degree;
public float[] knotVector;
public controlPoint[] controlPoints;
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class typeSpecification
{
public string agvKinemantic = "";
public string agvClass = "";
public double maxLoadMass;
public string[] localizationTypes; // Simplified description of localization type (e.g., NATURAL, REFLECTOR, RFID, DMC, GRID)
public string[] navigationTypes; // Path planning types (e.g., 'AUTONOMOUS', 'VIRTUAL_LINE_GUIDED')
}
}
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonUsage.Protocols.VDA5050.Objects
{
public class velocity
{
public double vx;
public double vy;
public double omega;
}
}