/* ========================================================================
* Copyright (c) 2005-2026 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
namespace Robotics
{
///
/// Supported deterministic motion styles for a robot mount.
///
public enum RobotMotionMode
{
///
/// The robot stays at its origin and keeps a fixed heading.
///
Fixed,
///
/// The robot traces a lemniscate around its origin.
///
FigureEight,
///
/// The robot traces a circle around its origin.
///
Circle,
///
/// The robot travels back and forth along the X axis.
///
Shuttle
}
///
/// Per-robot motion configuration.
///
public sealed class RobotMotionOptions
{
///
/// The motion style the robot follows.
///
public RobotMotionMode Mode { get; set; } = RobotMotionMode.FigureEight;
///
/// The X coordinate the path is centred on, in metres.
///
public double OriginX { get; set; }
///
/// The Y coordinate the path is centred on, in metres.
///
public double OriginY { get; set; }
///
/// The Z coordinate the path is centred on, in metres.
///
public double OriginZ { get; set; }
///
/// Half the width of the
/// path, in metres.
///
public double AmplitudeX { get; set; } = 0.6;
///
/// Half the height of the
/// path, in metres.
///
public double AmplitudeY { get; set; } = 0.35;
///
/// The radius of the path, in
/// metres.
///
public double Radius { get; set; } = 0.5;
///
/// The travel distance of the
/// path, in metres.
///
public double ShuttleDistance { get; set; } = 0.8;
///
/// The time the robot takes to complete one full path, in seconds.
///
public double PeriodSeconds { get; set; } = 20.0;
///
/// The offset into the path the robot starts from, in seconds. Lets
/// two robots sharing a path stay apart.
///
public double PhaseSeconds { get; set; }
///
/// The heading held when is
/// false, in degrees.
///
public double FixedHeadingDegrees { get; set; }
///
/// Whether the heading is derived from the direction of travel rather
/// than from .
///
public bool HeadingFollowsPath { get; set; } = true;
}
///
/// Position simulation configuration for both mobile robots.
///
public sealed class MobileRobotPositionOptions
{
///
/// Creates the options with the two robots placed either side of the
/// origin and offset in phase so they do not overlap.
///
public MobileRobotPositionOptions()
{
R1.OriginX = -1.2;
R2.OriginX = 1.2;
R2.PhaseSeconds = 10.0;
}
///
/// Motion configuration for the first robot.
///
public RobotMotionOptions R1 { get; set; } = new();
///
/// Motion configuration for the second robot.
///
public RobotMotionOptions R2 { get; set; } = new();
///
/// How often a new position is published, in milliseconds.
///
///
/// This matches the cell's simulation tick on purpose. Publishing the platform
/// slower than the arm and the workpieces makes the robot lag its own gripper: at
/// 200 ms and cruise speed the platform trails by 170 mm, and a carried part - which
/// rides the tool centre point - visibly floats out in front of the jaws.
///
public int UpdateIntervalMilliseconds { get; set; } = 50;
}
}