-
Notifications
You must be signed in to change notification settings - Fork 2
OTPModulePositionVelAccel
OTP Module Position Velocity/Acceleration
public struct OTPModulePositionVelAccel: OTPModule, Equatable
Implements an OTP Standard Module of the Position Velocity/Acceleration type and handles creation and parsing.
This data structure contains the positional velocity and acceleration of a Point. Velocity is provided in μm/s, and Acceleration in μm/s².
Example usage:
// initialize a module at vX = 0.5m/s, vY = 0m/s, vZ = 0m/s and aX = 0.05m/s², aY = 0m/s², aZ = 0m/s²
let module = OTPModulePositionVelAccel(vX: 500000, vY: 0, vZ: 0, aX: 50000, aY: 0, aZ: 0)
Equatable
, OTPModule
Initializes this OTPModule
with default values.
public init()
Initializes an OTP Module Position Velocity/Acceleration.
public init(vX: Int32, vY: Int32, vZ: Int32, aX: Int32, aY: Int32, aZ: Int32)
- vX: The X position velocity in μm/s.
- vY: The Y position velocity in μm/s.
- vZ: The Z position velocity in μm/s.
- aX: The X position acceleration in μm/s².
- aY: The Y position acceleration in μm/s².
- aZ: The Z position acceleration in μm/s².
Uniquely identifies the module using an OTPModuleIdentifier
.
public static let identifier: OTPModuleIdentifier
The size of the module's data in bytes.
public static let dataLength: OTPPDULength = 24
The total size of the module in bytes, including identifiers and length.
public static let moduleLength: OTPPDULength = dataLength + OTPPDULength(ModuleLayer.Offset.data.rawValue)
The X position velocity in μm/s.
public var vX: Int32 = 0
The Y position velocity in μm/s.
public var vY: Int32 = 0
The Z position velocity in μm/s.
public var vZ: Int32 = 0
The X position acceleration in μm/s².
public var aX: Int32 = 0
The Y position acceleration in μm/s².
public var aY: Int32 = 0
The Z position acceleration in μm/s².
public var aZ: Int32 = 0
A human-readable log description of this module.
public var logDescription: String
Creates a Module as Data.
public func createAsData() -> Data
The OTPModule
as a Data
object.
Attempts to create an OTPModulePositionVelocityAccel
from the data.
public static func parse(fromData data: Data) throws -> (module: Self, length: OTPPDULength)
- data: The data to be parsed.
An error of type ModuleLayerValidationError
.
A valid OTPModulePositionVelocityAccel
and the length of the PDU.
Merges an arrray of modules.
public static func merge(modules: [OTPModule]) -> (module: Self?, excludePoint: Bool)
- modules: The
OTPModule
s to be merged.
An optional OTPModule
of this type, and whether to exclude the OTPPoint
due to a mismatch.
Compares these modules for equality.
public func isEqualToModule(_ module: OTPModule) -> Bool
- module: The module to compare against.
Whether these modules are equal.
Generated at 2021-09-01T18:46:51+0000 using swift-doc 1.0.0-rc.1.
Types
- ComponentSocketError
- OTPAddress
- OTPComponentState
- OTPConsumer
- OTPConsumerStatus
- OTPIPMode
- OTPModuleIdentifier
- OTPModulePosition
- OTPModulePosition.Scaling
- OTPModulePositionVelAccel
- OTPModuleReferenceFrame
- OTPModuleRotation
- OTPModuleRotationVelAccel
- OTPModuleScale
- OTPPoint
- OTPPointValidationError
- OTPProducer
- OTPProducerStatus