-
Notifications
You must be signed in to change notification settings - Fork 2
OTPModuleRotationVelAccel
OTP Module Rotation Velocity/Acceleration
public struct OTPModuleRotationVelAccel: OTPModule, Equatable Implements an OTP Standard Module of the Rotation Velocity/Acceleration type and handles creation and parsing.
This data structure contains the rotational velocity and acceleration of a Point. Velocity is provided in thousandths of a decimal degree/s, and Acceleration in thousandths of a decimal degree/s².
This module supports velocities as low as 0.001 degrees/s and as high as 1000 revolutions/s. For example, a value of 45,000 for vX would mean a rotation of 45 degrees/s, or 0.125 revolutions/s, or 7.5 rpm.
Example usage:
// initialize a module at vX = 0°/s, vY = 0°/s, vZ = 15°/s and aX = 0°/s², aY = 0°/s², aZ = 5°/s²
let module = OTPModuleRotationVelAccel(vX: 0, vY: 0, vZ: 15000, aX: 0, aY: 0, aZ: 5000)
Equatable, OTPModule
Initializes this OTPModule with default values.
public init() Initializes an OTP Module Rotation Velocity/Acceleration.
public init(vX: Int32, vY: Int32, vZ: Int32, aX: Int32, aY: Int32, aZ: Int32) - vX: The X rotation velocity in thousandths of a decimal degree/s i.e. 5,000 = 5°/s.
- vY: The Y rotation velocity in thousandths of a decimal degree/s i.e. 5,000 = 5°/s.
- vZ: The Z rotation velocity in thousandths of a decimal degree/s i.e. 5,000 = 5°/s.
- aX: The X rotation acceleration in thousandths of a decimal degree/s² i.e. 5,000 = 5°/s².
- aY: The Y rotation acceleration in thousandths of a decimal degree/s² i.e. 5,000 = 5°/s².
- aZ: The Z rotation acceleration in thousandths of a decimal degree/s² i.e. 5,000 = 5°/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 = 24The total size of the module in bytes, including identifiers and length.
public static let moduleLength: OTPPDULength = dataLength + OTPPDULength(ModuleLayer.Offset.data.rawValue)The minimum permitted value for all variables in this module.
public static let minPermitted: Int32 = -360000000The maximum permitted value for all variables in this module.
public static let maxPermitted: Int32 = 360000000The X rotation velocity in thousandths of a decimal degree/s i.e. 5,000 = 5°/s.
public var vX: Int32 = 0The Y rotation velocity in thousandths of a decimal degree/s i.e. 5,000 = 5°/s.
public var vY: Int32 = 0The Z rotation velocity in thousandths of a decimal degree/s i.e. 5,000 = 5°/s.
public var vZ: Int32 = 0The X rotation acceleration in thousandths of a decimal degree/s² i.e. 5,000 = 5°/s².
public var aX: Int32 = 0The Y rotation acceleration in thousandths of a decimal degree/s² i.e. 5,000 = 5°/s².
public var aY: Int32 = 0The Z rotation acceleration in thousandths of a decimal degree/s² i.e. 5,000 = 5°/s².
public var aZ: Int32 = 0A 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 OTPModuleRotationVelocityAccel 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 OTPModuleRotationVelocityAccel and the length of the PDU.
Merges an arrray of modules.
public static func merge(modules: [OTPModule]) -> (module: Self?, excludePoint: Bool) - modules: The
OTPModules to be merged.
An optional OTPModule of this type, and whether to exclude the OTPPoint due to a mismatch.
Calculates whether this module is considered equal to another one.
public func isEqualToModule(_ module: OTPModule) -> Bool - module: The
OTPModuleto be compared against.
Whether these OTPModules are considered equal.
Calculates a valid value for this fields in this module from the string provided.
public static func validValue(from string: String) -> Int32 - string: The string to be evaluated.
A valid value for storing in this module.
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