Documentation
¶
Overview ¶
Package xsens provides primitives for communication with Xsens IMU sensors.
Index ¶
- Constants
- func ScanMessages(data []byte, atEOF bool) (advance int, token []byte, err error)
- type Acceleration
- type AccelerationHR
- type AltitudeEllipsoid
- type BaroPressure
- type CANBaudRate
- type CANBaudRateID
- type CANConfig
- type CANDataIdentifier
- type CANIDLengthFlag
- type CANOutputConfiguration
- type CANOutputConfigurationSetting
- type Client
- func (c *Client) Acceleration() *Acceleration
- func (c *Client) AltitudeEllipsoid() *AltitudeEllipsoid
- func (c *Client) BaroPressure() *BaroPressure
- func (c *Client) Close() error
- func (c *Client) DataType() DataType
- func (c *Client) DeltaQ() *DeltaQ
- func (c *Client) DeltaV() *DeltaV
- func (c *Client) EulerAngles() *EulerAngles
- func (c *Client) FreeAcceleration() *FreeAcceleration
- func (c *Client) GNSSPVTData() *GNSSPVTData
- func (c *Client) GNSSSatInfo() *GNSSSatInfo
- func (c *Client) GetCANConfiguration(ctx context.Context) (*CANConfig, error)
- func (c *Client) GetCANOutputConfiguration(ctx context.Context) (CANOutputConfiguration, error)
- func (c *Client) GetDeviceID(ctx context.Context) (*DeviceID, error)
- func (c *Client) GetHWVersion(ctx context.Context) (*HWVersion, error)
- func (c *Client) GetOutputConfiguration(ctx context.Context) (OutputConfiguration, error)
- func (c *Client) GetProductCode(ctx context.Context) (*ProductCode, error)
- func (c *Client) GoToConfig(ctx context.Context) error
- func (c *Client) GoToMeasurement(ctx context.Context) error
- func (c *Client) LatLon() *LatLon
- func (c *Client) MagneticField() *MagneticField
- func (c *Client) MeasurementData() MeasurementData
- func (c *Client) MessageIdentifier() MessageIdentifier
- func (c *Client) PacketCounter() *PacketCounter
- func (c *Client) PositionECEF() *PositionECEF
- func (c *Client) Quaternion() *Quaternion
- func (c *Client) RateOfTurn() *RateOfTurn
- func (c *Client) RawMessage() []byte
- func (c *Client) RawPacket() []byte
- func (c *Client) Receive(_ context.Context) error
- func (c *Client) RotationMatrix() *RotationMatrix
- func (c *Client) SampleTimeCoarse() *SampleTimeCoarse
- func (c *Client) SampleTimeFine() *SampleTimeFine
- func (c *Client) ScanMeasurementData() bool
- func (c *Client) SetCANConfiguration(ctx context.Context, configuration CANConfig) error
- func (c *Client) SetCANOutputConfiguration(ctx context.Context, configuration CANOutputConfiguration) error
- func (c *Client) SetOutputConfiguration(ctx context.Context, configuration OutputConfiguration) error
- func (c *Client) StatusByte() *StatusByte
- func (c *Client) StatusWord() *StatusWord
- func (c *Client) Temperature() *Temperature
- func (c *Client) UTCTime() *UTCTime
- func (c *Client) VelocityXYZ() *VelocityXYZ
- type CoordinateSystem
- type DataIdentifier
- type DataType
- type DeltaQ
- type DeltaV
- type DeviceID
- type ErrorCode
- type EulerAngles
- type FP1220
- type FP1632
- type FixType
- type FreeAcceleration
- type GNSSPVTData
- type GNSSSat
- type GNSSSatInfo
- type HWVersion
- type IDMask
- type LatLon
- type MTData2
- type MTData2Packet
- type MagneticField
- type MeasurementData
- type Message
- func (m Message) BusIdentifier() uint8
- func (m Message) Checksum() uint8
- func (m Message) Data() []byte
- func (m Message) ErrorCode() ErrorCode
- func (m Message) Identifier() MessageIdentifier
- func (m Message) IsError() bool
- func (m Message) IsExtended() bool
- func (m Message) Length() uint16
- func (m Message) Preamble() uint8
- func (m Message) String() string
- func (m Message) Validate() error
- type MessageIdentifier
- type OutputConfiguration
- type OutputConfigurationSetting
- type OutputFrequency
- type PacketCounter
- type PositionECEF
- type Precision
- type ProductCode
- type Quaternion
- type RateOfTurn
- type RateOfTurnHR
- type RotationMatrix
- type SampleTimeCoarse
- type SampleTimeFine
- type Scalar
- type StatusByte
- type StatusWord
- type Temperature
- type UTCTime
- type UTCValidity
- type VectorXYZ
- type VelocityXYZ
Constants ¶
const ( DefaultSerialBaudRate = 115200 DefaultSerialDataBits = 8 DefaultSerialStopBits = 1 )
Default serial communication options.
const ( UTCDateValidFlag = 0x01 UTCTimeOfDayValidFlag = 0x02 UTCTimeOfDayFullyResolvedFlag = 0x04 )
const MinLengthOfMessage = lengthOfPreamble +
lengthOfBusIdentifier +
lengthOfMessageIdentifier +
lengthOfLength +
lengthOfChecksum
MinLengthOfMessage is the minimum length of a valid Xsens message.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Acceleration ¶ added in v0.15.0
type Acceleration = VectorXYZ
Acceleration contains the calibrated acceleration vector in x, y, and z axes in m/s 2 .
type AccelerationHR ¶ added in v0.15.0
type AccelerationHR = VectorXYZ
AccelerationHR contains the high-resolution calibrated acceleration vector in x, y, and z axes in m/s 2 .
For the MTi 1-series, with the exception of the MTi-7, the output data rate is 1000 Hz based on the internal clock of the IMU which is not aligned with other data; data has not been processed in the SDI algorithm. It has been calibrated with the Xsens calibration parameters (except for g-sensitivity).
For the MTi-7, the output data is 800 Hz based on the internal clock of the IMUs which are not aligned with other data; data has not been processed in the SDI algorithm. It has been calibrated with the Xsens calibration parameters (except for g-sensitivity).
For the MTi 100-series and MTi-G-710, the output data is 1000 Hz, synchronized with the internal clock of the MTi 100-series (10 ppm; 1 ppm with GNSS ClockSync). The data has been processed in the SDI algorithm. Note that AccelerationHR is not grouped with messages coming out at the same time.
type AltitudeEllipsoid ¶ added in v0.15.0
type AltitudeEllipsoid = Scalar
AltitudeEllipsoid contains the altitude of the MTi-G in meters above the WGS-84 Ellipsoid.
type BaroPressure ¶ added in v0.9.0
type BaroPressure uint32
BaroPressure contains the pressure as measured by the internal barometer expressed in Pascal.
func (*BaroPressure) MarshalMTData2Packet ¶ added in v0.15.0
func (b *BaroPressure) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*BaroPressure) String ¶ added in v0.9.0
func (b *BaroPressure) String() string
String returns a string representation of the value.
func (*BaroPressure) UnmarshalMTData2Packet ¶ added in v0.15.0
func (b *BaroPressure) UnmarshalMTData2Packet(packet MTData2Packet) error
type CANBaudRate ¶ added in v0.18.0
type CANBaudRate int
func (CANBaudRate) ID ¶ added in v0.19.0
func (c CANBaudRate) ID() (CANBaudRateID, error)
type CANBaudRateID ¶ added in v0.19.0
type CANBaudRateID int8
const ( CANBaudRate1M CANBaudRateID = 0x0C CANBaudRate800k CANBaudRateID = 0x0B CANBaudRate500k CANBaudRateID = 0x0A CANBaudRate250k CANBaudRateID = 0x00 CANBaudRate125k CANBaudRateID = 0x01 CANBaudRate100k CANBaudRateID = 0x02 CANBaudRate83k3 CANBaudRateID = 0x03 CANBaudRate62k5 CANBaudRateID = 0x04 CANBaudRate50k CANBaudRateID = 0x05 CANBaudRate33k3 CANBaudRateID = 0x06 CANBaudRate20k CANBaudRateID = 0x07 CANBaudRate10k CANBaudRateID = 0x08 CANBaudRate5k CANBaudRateID = 0x09 )
func (CANBaudRateID) String ¶ added in v0.19.0
func (i CANBaudRateID) String() string
type CANConfig ¶ added in v0.18.0
type CANConfig struct {
Enable bool
BaudRate CANBaudRateID
}
func (*CANConfig) MarshalBinary ¶ added in v0.18.0
MarshalBinary returns the wire representation of the CAN configuration.
func (*CANConfig) MarshalText ¶ added in v0.18.0
MarshalText returns a text representation of the CAN configuration.
func (*CANConfig) UnmarshalBinary ¶ added in v0.18.0
UnmarshalBinary sets *o from a wire representation of the CAN configuration.
type CANDataIdentifier ¶ added in v0.18.0
type CANDataIdentifier uint8
const ( CANDataIdentifierInvalid CANDataIdentifier = 0x00 CANDataIdentifierError CANDataIdentifier = 0x01 CANDataIdentifierWarning CANDataIdentifier = 0x02 CANDataIdentifierSampleTime CANDataIdentifier = 0x05 CANDataIdentifierGroupCounter CANDataIdentifier = 0x06 CANDataIdentifierUtcTime CANDataIdentifier = 0x07 CANDataIdentifierStatusWord CANDataIdentifier = 0x11 CANDataIdentifierQuaternion CANDataIdentifier = 0x21 CANDataIdentifierEulerAngles CANDataIdentifier = 0x22 CANDataIdentifierDeltaV CANDataIdentifier = 0x31 CANDataIdentifierRateOfTurn CANDataIdentifier = 0x32 CANDataIdentifierDeltaQ CANDataIdentifier = 0x33 CANDataIdentifierAcceleration CANDataIdentifier = 0x34 CANDataIdentifierFreeAcceleration CANDataIdentifier = 0x35 CANDataIdentifierMagneticField CANDataIdentifier = 0x41 CANDataIdentifierTemperature CANDataIdentifier = 0x51 CANDataIdentifierBaroPressure CANDataIdentifier = 0x52 CANDataIdentifierRateOfTurnHR CANDataIdentifier = 0x61 CANDataIdentifierAccelerationHR CANDataIdentifier = 0x62 CANDataIdentifierLatLong CANDataIdentifier = 0x71 CANDataIdentifierAltitudeEllipsoid CANDataIdentifier = 0x72 CANDataIdentifierPositionEcefX CANDataIdentifier = 0x73 CANDataIdentifierPositionEcefY CANDataIdentifier = 0x74 CANDataIdentifierPositionEcefZ CANDataIdentifier = 0x75 CANDataIdentifierVelocityXYZ CANDataIdentifier = 0x76 CANDataIdentifierGnssReceiverStatus CANDataIdentifier = 0x79 CANDataIdentifierGnssReceiverDop CANDataIdentifier = 0x7A )
func (CANDataIdentifier) String ¶ added in v0.18.0
func (i CANDataIdentifier) String() string
func (*CANDataIdentifier) UnmarshalText ¶ added in v0.18.0
func (i *CANDataIdentifier) UnmarshalText(text []byte) error
type CANIDLengthFlag ¶ added in v0.18.0
type CANIDLengthFlag bool
const ( CANIDLengthFlag11bits CANIDLengthFlag = false CANIDLengthFlag29bits CANIDLengthFlag = true )
type CANOutputConfiguration ¶ added in v0.18.0
type CANOutputConfiguration []CANOutputConfigurationSetting
func (*CANOutputConfiguration) MarshalBinary ¶ added in v0.18.0
func (o *CANOutputConfiguration) MarshalBinary() ([]byte, error)
MarshalBinary returns the wire representation of the CAN output configuration.
func (*CANOutputConfiguration) MarshalText ¶ added in v0.18.0
func (o *CANOutputConfiguration) MarshalText() ([]byte, error)
MarshalText returns a text representation of the CAN output configuration.
func (*CANOutputConfiguration) UnmarshalBinary ¶ added in v0.18.0
func (o *CANOutputConfiguration) UnmarshalBinary(data []byte) error
UnmarshalBinary sets *o from a wire representation of the CAN output configuration.
type CANOutputConfigurationSetting ¶ added in v0.18.0
type CANOutputConfigurationSetting struct {
// DataIdentifier is the data identifier of the data.
CANDataIdentifier CANDataIdentifier
// CANIDLengthFlag specifies whether the CAN address is 11 (CANIDLengthFlag11bits)
// or 29 bits (CANIDLengthFlag29bits).
CANIDLengthFlag CANIDLengthFlag
// IDMask is a uint32 version of CANDataIdentifier.
//
// Only used for reading. DefaultIDMask is used for writing.
IDMask IDMask
// OutputFrequency is the output frequency of the data.
//
// Selecting an Output OutputFrequency of either 0x0000 or 0xFFFF, makes the device select the
// maximum frequency for the given data identifier. The device reports the resulting effective
// frequencies in its response message.
OutputFrequency OutputFrequency
}
CANOutputConfigurationSetting is the output configuration for a single CAN measurement data type.
func (*CANOutputConfigurationSetting) DefaultIDMask ¶ added in v0.19.1
func (o *CANOutputConfigurationSetting) DefaultIDMask() IDMask
DefaultIDMask returns the default CAN ID Mask.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for communicating with an Xsens device.
func NewClient ¶
func NewClient(p io.ReadWriteCloser) *Client
NewClient returns a new client using the provided ReadWriterCloser for communication.
func (*Client) Acceleration ¶ added in v0.15.0
func (c *Client) Acceleration() *Acceleration
func (*Client) AltitudeEllipsoid ¶ added in v0.15.0
func (c *Client) AltitudeEllipsoid() *AltitudeEllipsoid
func (*Client) BaroPressure ¶ added in v0.15.0
func (c *Client) BaroPressure() *BaroPressure
func (*Client) DataType ¶ added in v0.15.0
DataType returns the data type of the current scanned measurement data packet.
func (*Client) EulerAngles ¶ added in v0.15.0
func (c *Client) EulerAngles() *EulerAngles
func (*Client) FreeAcceleration ¶ added in v0.15.0
func (c *Client) FreeAcceleration() *FreeAcceleration
func (*Client) GNSSPVTData ¶ added in v0.15.0
func (c *Client) GNSSPVTData() *GNSSPVTData
func (*Client) GNSSSatInfo ¶ added in v0.15.0
func (c *Client) GNSSSatInfo() *GNSSSatInfo
func (*Client) GetCANConfiguration ¶ added in v0.18.0
GetCANConfiguration returns the Xsens CAN output configuration.
func (*Client) GetCANOutputConfiguration ¶ added in v0.18.0
func (c *Client) GetCANOutputConfiguration(ctx context.Context) (CANOutputConfiguration, error)
GetCANOutputConfiguration returns the Xsens CAN output configuration.
func (*Client) GetDeviceID ¶ added in v0.18.0
GetDeviceID returns the Xsens DeviceID.
func (*Client) GetHWVersion ¶ added in v0.20.0
GetHWVersion returns the Xsens HWVersion.
func (*Client) GetOutputConfiguration ¶ added in v0.15.0
func (c *Client) GetOutputConfiguration(ctx context.Context) (OutputConfiguration, error)
GetOutputConfiguration returns the Xsens output configuration.
func (*Client) GetProductCode ¶ added in v0.20.0
func (c *Client) GetProductCode(ctx context.Context) (*ProductCode, error)
GetProductCode returns the Xsens ProductCode.
func (*Client) GoToConfig ¶ added in v0.15.0
GoToConfig puts the Xsens device in config mode.
func (*Client) GoToMeasurement ¶ added in v0.15.0
GoToMeasurement puts the Xsens device in measurement mode.
func (*Client) MagneticField ¶ added in v0.15.0
func (c *Client) MagneticField() *MagneticField
func (*Client) MeasurementData ¶ added in v0.15.0
func (c *Client) MeasurementData() MeasurementData
MeasurementData returns the last scanned measurement data.
func (*Client) MessageIdentifier ¶ added in v0.15.0
func (c *Client) MessageIdentifier() MessageIdentifier
MessageIdentifier returns the message identifier of the last received message.
func (*Client) PacketCounter ¶ added in v0.15.0
func (c *Client) PacketCounter() *PacketCounter
func (*Client) PositionECEF ¶ added in v0.15.0
func (c *Client) PositionECEF() *PositionECEF
func (*Client) Quaternion ¶ added in v0.15.0
func (c *Client) Quaternion() *Quaternion
func (*Client) RateOfTurn ¶ added in v0.15.0
func (c *Client) RateOfTurn() *RateOfTurn
func (*Client) RawMessage ¶ added in v0.15.0
RawMessage returns the raw bytes of the last received message.
func (*Client) RawPacket ¶ added in v0.15.0
RawPacket returns the raw bytes of the current measurement data packet.
func (*Client) Receive ¶ added in v0.15.0
Receive an Xsens message.
Clears state related to a previously received message, such as scanned measurement data.
func (*Client) RotationMatrix ¶ added in v0.15.0
func (c *Client) RotationMatrix() *RotationMatrix
func (*Client) SampleTimeCoarse ¶ added in v0.15.0
func (c *Client) SampleTimeCoarse() *SampleTimeCoarse
func (*Client) SampleTimeFine ¶ added in v0.15.0
func (c *Client) SampleTimeFine() *SampleTimeFine
func (*Client) ScanMeasurementData ¶ added in v0.15.0
ScanMeasurementData advances to the next measurement data packet, when the current message contains measurement data.
func (*Client) SetCANConfiguration ¶ added in v0.18.0
SetCANConfiguration sets the Xsens device CAN configuration.
func (*Client) SetCANOutputConfiguration ¶ added in v0.18.0
func (c *Client) SetCANOutputConfiguration(ctx context.Context, configuration CANOutputConfiguration) error
SetCANOutputConfiguration sets the Xsens device CAN output configuration.
func (*Client) SetOutputConfiguration ¶ added in v0.15.0
func (c *Client) SetOutputConfiguration(ctx context.Context, configuration OutputConfiguration) error
SetOutputConfiguration sets the Xsens device output configuration.
func (*Client) StatusByte ¶ added in v0.15.0
func (c *Client) StatusByte() *StatusByte
func (*Client) StatusWord ¶ added in v0.15.0
func (c *Client) StatusWord() *StatusWord
func (*Client) Temperature ¶ added in v0.15.0
func (c *Client) Temperature() *Temperature
func (*Client) VelocityXYZ ¶ added in v0.15.0
func (c *Client) VelocityXYZ() *VelocityXYZ
type CoordinateSystem ¶ added in v0.9.0
type CoordinateSystem uint8
CoordinateSystem represents the coordinate system of a measurement data output.
const ( CoordinateSystemEastNorthUp CoordinateSystem = 0x0 CoordinateSystemNorthEastDown CoordinateSystem = 0x4 CoordinateSystemNorthWestUp CoordinateSystem = 0x8 )
Coordinate systems.
func (CoordinateSystem) String ¶ added in v0.9.0
func (i CoordinateSystem) String() string
type DataIdentifier ¶ added in v0.9.0
type DataIdentifier struct {
DataType DataType
CoordinateSystem CoordinateSystem
Precision Precision
}
DataIdentifier is an Xsens data identifier.
Each data identifier is constructed in this way:
+-------------------------------------------------------------------------------+ | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +------------------------+--------------+-------------------+-------------------+ | Group | Reserved | Type | Format | +------------------------+--------------+-------------------+-------------------+
Group defines the category of the data, such as timestamps, orientations, angular velocities, etc.
Type combined with Group defines the actual type of the data.
func (DataIdentifier) DataSize ¶ added in v0.15.0
func (d DataIdentifier) DataSize() uint8
DataSize returns the data size (in bytes) of measurement data with the current identifier.
Returns 0 for unsupported data identifiers.
func (*DataIdentifier) SetUint16 ¶ added in v0.15.0
func (d *DataIdentifier) SetUint16(value uint16)
SetUint16 sets the data identifier from a uint16 representation.
func (DataIdentifier) String ¶ added in v0.9.0
func (d DataIdentifier) String() string
String returns a string representation of the data identifier.
func (DataIdentifier) Uint16 ¶ added in v0.15.0
func (d DataIdentifier) Uint16() uint16
Uint16 returns the data identifier represented as a uint16.
type DataType ¶ added in v0.9.0
type DataType uint16
DataType represents an Xsens data type.
const ( DataTypeUTCTime DataType = 0x1010 DataTypePacketCounter DataType = 0x1020 DataTypeITOW DataType = 0x1030 DataTypeGPSAge DataType = 0x1040 DataTypePressureAge DataType = 0x1050 DataTypeSampleTimeFine DataType = 0x1060 DataTypeSampleTimeCoarse DataType = 0x1070 )
Data group: Timestamp.
const ( DataTypeQuaternion DataType = 0x2010 DataTypeRotationMatrix DataType = 0x2020 DataTypeEulerAngles DataType = 0x2030 )
Data group: Orientation.
const ( DataTypeDeltaV DataType = 0x4010 DataTypeAcceleration DataType = 0x4020 DataTypeFreeAcceleration DataType = 0x4030 DataTypeAccelerationHR DataType = 0x4040 )
Data group: Acceleration.
const ( DataTypeAltitudeEllipsoid DataType = 0x5020 DataTypePositionECEF DataType = 0x5030 DataTypeLatLon DataType = 0x5040 )
Data group: Position.
Data group: GNSS.
const ( DataTypeRateOfTurn DataType = 0x8020 DataTypeDeltaQ DataType = 0x8030 DataTypeRateOfTurnHR DataType = 0x8040 )
Data group: Angular velocity.
const ( DataTypeGPSDOP DataType = 0x8830 DataTypeGPSSOL DataType = 0x8840 DataTypeGPSTimeUTC DataType = 0x8880 DataTypeGPSSVInfo DataType = 0x88a0 )
Data group: GPS.
Data group: Status.
const (
DataTypeBaroPressure DataType = 0x3010
)
Data group: Pressure.
const (
DataTypeMagneticField DataType = 0xc020
)
Data group: Magnetic.
const (
DataTypeTemperature DataType = 0x0810
)
Data group: Temperature.
const (
DataTypeVelocityXYZ DataType = 0xd010
)
Data group: Velocity.
func (DataType) HasCoordinateSystem ¶ added in v0.9.0
HasCoordinateSystem returns true for data types which support configurable coordinate system.
func (DataType) HasPrecision ¶ added in v0.9.0
HasPrecision returns true for data types which support configurable output precision.
type DeltaQ ¶ added in v0.15.0
type DeltaQ = Quaternion
DeltaQ contains the delta quaternion value of the SDI output.
type DeltaV ¶ added in v0.15.0
type DeltaV = VectorXYZ
DeltaV contains the delta velocity value of the SDI output in m/s.
type DeviceID ¶ added in v0.18.0
type DeviceID uint32
func (*DeviceID) UnmarshalBinary ¶ added in v0.18.0
type ErrorCode ¶ added in v0.9.0
type ErrorCode uint8
ErrorCode represents an Xsens error code.
const ( // ErrorCodeOK: No error. ErrorCodeOK ErrorCode = 0 // ErrorCodeNoBus: No bus communication possible. ErrorCodeNoBus ErrorCode = 1 // ErrorCodeBusNotReady: InitBus and/or SetBID are not issued. ErrorCodeBusNotReady ErrorCode = 2 // ErrorCodeInvalidPeriod: Period sent is invalid. ErrorCodeInvalidPeriod ErrorCode = 3 // ErrorCodeInvalidMessage: Message is invalid or not implemented. ErrorCodeInvalidMessage ErrorCode = 4 // ErrorCodeInitBusFail1: A slave did not respond to WaitForSetBID. ErrorCodeInitBusFail1 ErrorCode = 16 // ErrorCodeInitBusFail2: An incorrect answer received after WaitForSetBID. ErrorCodeInitBusFail2 ErrorCode = 17 // ErrorCodeInitBusFail3: After four bus-scans still undetected Motion Trackers. ErrorCodeInitBusFail3 ErrorCode = 18 // ErrorCodeSetBIDFail1: No reply to SetBID message during SetBID procedure. ErrorCodeSetBIDFail1 ErrorCode = 20 // ErrorCodeSetBIDFail2: Other than SetBIDAck received. ErrorCodeSetBIDFail2 ErrorCode = 21 // ErrorCodeMeasurementFail1: Period too short to collect all data from Motion Trackers. ErrorCodeMeasurementFail1 ErrorCode = 24 // ErrorCodeMeasurementFail2: Motion Tracker responds with other than SlaveData message. ErrorCodeMeasurementFail2 ErrorCode = 25 // ErrorCodeMeasurementFail3: Total bytes of data of Motion Trackers exceeds 255 bytes. ErrorCodeMeasurementFail3 ErrorCode = 26 // ErrorCodeMeasurementFail4: Timer overflows during measurement. ErrorCodeMeasurementFail4 ErrorCode = 27 // ErrorCodeMeasurementFail5: Timer overflows during measurement. ErrorCodeMeasurementFail5 ErrorCode = 28 // ErrorCodeMeasurementFail6: No correct response from Motion Tracker during measurement. ErrorCodeMeasurementFail6 ErrorCode = 29 // ErrorCodeTimerOverflow: Timer overflow during measurement. ErrorCodeTimerOverflow ErrorCode = 30 // ErrorCodeBaudrateInvalid: Baud rate does not comply with valid range. ErrorCodeBaudrateInvalid ErrorCode = 32 // ErrorCodeInvalidParam: An invalid parameter is supplied. ErrorCodeInvalidParam ErrorCode = 33 // ErrorCodeMeasurementFail7: TX PC Buffer is full. ErrorCodeMeasurementFail7 ErrorCode = 35 // ErrorCodeMeasurementFail8: TX PC Buffer overflow, cannot fit full message. ErrorCodeMeasurementFail8 ErrorCode = 36 // ErrorCodeDeviceError: Device generated an error, try updating the firmware. ErrorCodeDeviceError ErrorCode = 40 // ErrorCodeDataOverflow: Device generates more data than bus can handle (baud rate too low). ErrorCodeDataOverflow ErrorCode = 41 // ErrorCodeBufferOverflow: Sample buffer of the device was full during a communication outage. ErrorCodeBufferOverflow ErrorCode = 42 )
type EulerAngles ¶ added in v0.15.0
type EulerAngles = VectorXYZ
EulerAngles contains the three Euler angles in degrees that represent the orientation of the device.
type FP1220 ¶ added in v0.9.0
type FP1220 [4]byte
FP1220 is a fixed point 12.20 value.
The 12.20 fixed point output is calculated with:
int32_t fixedPointValue12p20 = round(floatingPointValue * 2^20)
The resulting 32bit integer value is transmitted in big-endian order (MSB first).
The range of a 12.20 fixed point value is [-2048.0, 2047.9999990].
func (*FP1220) FromFloat64 ¶ added in v0.15.0
type FP1632 ¶ added in v0.9.0
type FP1632 [6]byte
FP1220 is a fixed point 16.32 value.
The 16.32 fixed point output is calculated with:
int64_t fixedPointValue16p32 = round(floatPointValue * 2^32)
Of the resulting 64 bit integer only the 6 least significant bytes are transmitted.
If these are the bytes b0 to b5 (with b0 the LSB) they are transmitted in this order:
[b3, b2, b1, b0, b5, b4] [0, 1, 2, 3, 4, 5 ]
This can be interpreted as first transmitting the 32bit fractional part and then the 16 bit integer part, both parts are in big-endian order (MSB first).
The range of a 16.32 fixed point value is [-32768.0, 32767.9999999998].
func (*FP1632) FromFloat64 ¶ added in v0.15.0
type FreeAcceleration ¶ added in v0.15.0
type FreeAcceleration = VectorXYZ
FreeAcceleration contains the free acceleration vector in x, y, and z axes in m/s 2 .
type GNSSPVTData ¶ added in v0.9.0
type GNSSPVTData struct {
// ITOW is the GPS time of week.
//
// Unit: ms
ITOW uint32
// Year (UTC).
//
// Unit: y
Year uint16
// Month (UTC).
//
// Unit: m
Month uint8
// Day of the month (UTC).
//
// Unit: d
Day uint8
// Hour of the day 0..23 (UTC).
//
// Unit: h
Hour uint8
// Minute of hour 0..59 (UTC).
//
// Unit: min
Min uint8
// Seconds of minute 0..60 (UTC).
//
// Unit: s
Sec uint8
// Valid is the validity flags.
//
// bit (0) = UTC Date is valid
// bit (1) = UTC Time of Day is valid
// bit (2) = UTC Time of Day has been fully resolved (i.e. no seconds uncertainty)
Valid UTCValidity
// TAcc is the time accuracy estimate (UTC).
//
// Unit: ns
TAcc uint32
// Nano is the fraction of second -1e-9 .. 1e-9.
//
// Unit: ns
Nano int32
// FixType is the GNSS fix type.
FixType FixType
// Flags are the fix status flags
//
// bit (0) = Valid fix (within DOP and accuracy masks)
// bit (1) = Differential corrections are applied
// bit (2) = Reserved
// bit (3) = Reserved
// bit (4) = Reserved
// bit (5) = Heading of vehicle is valid
Flags uint8
// NumSV is the number of satellites used in navigation solution.
NumSV uint8
// Reserved1 is reserved for future use.
Reserved1 uint8
// Lon is the position longitude.
//
// Scale: 1e-7
// Unit: deg
Lon int32
// Lat is the position latitude.
//
// Scale: 1e-7
// Unit: deg
Lat int32
// Height above ellipsoid.
//
// Unit: mm
Height int32
// HMSL is the height above mean sea level.
//
// Unit: mm
HMSL int32
// HAcc is the horizontal accuracy estimate.
//
// Unit: mm
HAcc uint32
// VAcc is the vertical accuracy estimate.
//
// Unit: mm
VAcc uint32
// VelN is the NED north velocity.
//
// Unit: mm/s
VelN int32
// VelE is the NED east velocity.
//
// Unit: mm/s
VelE int32
// VelD is the NED down velocity.
//
// Unit: mm/s
VelD int32
// GSpeed is the 2D ground speed.
//
// Unit: mm/s
GSpeed int32
// HeadMot is the 2D heading of motion.
//
// Scale: 1e-5
// Unit: deg
HeadMot int32
// SAcc is the speed accuracy estimate.
//
// Unit: mm/s
SAcc uint32
// HeadAcc is the heading accuracy estimate (both motion and vehicle).
//
// Unit: deg
HeadAcc uint32
// HeadVeh is the 2D heading of the vehicle.
//
// Scale: 1e-5
// Unit: deg
HeadVeh uint32
// GDOP is the Geometric DOP.
//
// Scale: 0.01
GDOP uint16
// PDOP is the Position DOP.
//
// Scale: 0.01
PDOP uint16
// PDOP is the Time DOP.
//
// Scale: 0.01
TDOP uint16
// VDOP is the Vertical DOP.
//
// Scale: 0.01
VDOP uint16
// HDOP is the Horizontal DOP.
//
// Scale: 0.01
HDOP uint16
// NDOP is the Northing DOP.
//
// Scale: 0.01
NDOP uint16
// EDOP is the Easting DOP.
//
// Scale: 0.01
EDOP uint16
}
GNSSPVTData contains the current GNSS position, velocity and time data.
func (*GNSSPVTData) MarshalMTData2Packet ¶ added in v0.15.0
func (g *GNSSPVTData) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*GNSSPVTData) Time ¶ added in v0.15.0
func (g *GNSSPVTData) Time() time.Time
func (*GNSSPVTData) UnmarshalMTData2Packet ¶ added in v0.15.0
func (g *GNSSPVTData) UnmarshalMTData2Packet(packet MTData2Packet) error
type GNSSSat ¶ added in v0.9.0
type GNSSSat struct {
// GNSSID is the GNSS identifier.
//
// 0 = GPS
// 1 = SBAS
// 2 = Galileo
// 3 = BeiDou
// 4 = IMES
// 5 = QZSS
// 6 = GLONASS
GNSSID uint8
// SVID is the satellite identifier.
SVID uint8
// CNO is the carrier to noise ratio (signal strength).
//
// Unit: dBHz
CNO uint8
// Flags contains the satellite flags.
//
// bit (0..2) = signal quality indicator
// 0 = no signal
// 1 = searching signal
// 2 = signal acquired
// 3 = signal detected but unusable
// 4 = code locked and time synchronized
// 5, 6, 7 = code & carrier locked; time synchronized
// bit (3) = SV is being used for navigation
// bit (4..5) = SV health flag
// 0 = unknown
// 1 = healthy
// 2 = unhealthy
// bit (6) = differential correction data is available
// bit (7) = reserved
Flags uint8
}
type GNSSSatInfo ¶ added in v0.9.0
type GNSSSatInfo struct {
// ITOW is the GPS time of week.
//
// Unit: ms
ITOW uint32
// NumSVS is the number of satellites.
NumSVS uint8
// Res1 is reserved for future use.
Res1 uint8
// Res2 is reserved for future use.
Res2 uint8
// Res3 is reserved for future use.
Res3 uint8
}
GNSSSatInfo contains info on the currently used GNSS satellites.
func (*GNSSSatInfo) MarshalMTData2Packet ¶ added in v0.15.0
func (g *GNSSSatInfo) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*GNSSSatInfo) UnmarshalMTData2Packet ¶ added in v0.15.0
func (g *GNSSSatInfo) UnmarshalMTData2Packet(packet MTData2Packet) error
type HWVersion ¶ added in v0.20.0
type HWVersion string // MAJOR.minor
func (*HWVersion) UnmarshalBinary ¶ added in v0.20.0
type LatLon ¶ added in v0.9.0
type LatLon struct {
Lat, Lon float64
}
LatLon contains the latitude and longitude in degrees of the MTi-G position.
func (*LatLon) MarshalMTData2Packet ¶ added in v0.15.0
func (t *LatLon) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*LatLon) UnmarshalMTData2Packet ¶ added in v0.15.0
func (t *LatLon) UnmarshalMTData2Packet(packet MTData2Packet) error
type MTData2 ¶ added in v0.9.0
type MTData2 []byte
MTData2 represents an Xsens MTData2 payload.
type MTData2Packet ¶ added in v0.9.0
type MTData2Packet []byte
MTData2Packet represents an individual packet of an XSens MTData2 message.
func NewMTData2Package ¶ added in v0.15.0
func NewMTData2Package(length uint8, identifier DataIdentifier) MTData2Packet
func (MTData2Packet) Data ¶ added in v0.9.0
func (m MTData2Packet) Data() []byte
Data returns the packet data.
func (MTData2Packet) Identifier ¶ added in v0.9.0
func (m MTData2Packet) Identifier() DataIdentifier
Identifier returns the packet's data identifier.
func (MTData2Packet) SetIdentifier ¶ added in v0.15.0
func (m MTData2Packet) SetIdentifier(id DataIdentifier)
func (MTData2Packet) SetLength ¶ added in v0.15.0
func (m MTData2Packet) SetLength(length uint8)
func (MTData2Packet) String ¶ added in v0.9.0
func (m MTData2Packet) String() string
String returns a string representation of the packet.
type MagneticField ¶ added in v0.15.0
type MagneticField = VectorXYZ
MagneticField contains the magnetic field value in x, y, and z axes in arbitrary units.
Magnetic field is normalized to 1.0 during calibration.
type MeasurementData ¶ added in v0.9.0
type MeasurementData interface {
UnmarshalMTData2Packet(MTData2Packet) error
MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
}
MeasurementData is a generic interface for any measurement data produced by an Xsens device.
type Message ¶ added in v0.9.0
type Message []byte
func NewMessage ¶ added in v0.9.0
func NewMessage(mid MessageIdentifier, data []byte) Message
NewMessage creates a new Xsens message with the provided identifier and data.
The provided data can be nil or empty, for messages without any data.
func (Message) BusIdentifier ¶ added in v0.9.0
BusIdentifier of the message.
An MT will only acknowledge a message (reply) if it is addressed with a valid BID. An MT will always acknowledge a message with the same BID that has been used to address it.
Messages generated by the MT itself (i.e. not in acknowledge on a request) will always have a BID of 255 (0xFF). In practice, the only message for which this occurs is the MTData2 messages.
func (Message) Checksum ¶ added in v0.9.0
Checksum of the message.
This field is used for communication error-detection. If all message bytes excluding the preamble are summed and the lower byte value of the result equals zero, the message is valid and it may be processed. The checksum value of the message should be included in the summation.
func (Message) ErrorCode ¶ added in v0.9.0
ErrorCode returns the message's error code.
The error code is 0 (OK) for non-error messages.
func (Message) Identifier ¶ added in v0.9.0
func (m Message) Identifier() MessageIdentifier
Identifier of the message.
func (Message) IsExtended ¶ added in v0.9.0
IsExtended returns true if the message is extended.
func (Message) Preamble ¶ added in v0.9.0
Preamble of the message.
Every message starts with the preamble. This field always contains the value 250 (=0xFA).
type MessageIdentifier ¶ added in v0.9.0
type MessageIdentifier uint8
MessageIdentifier identifies the type of an Xsens message.
const ( MessageIdentifierWakeup MessageIdentifier = 0x3E MessageIdentifierWakeupAck MessageIdentifier = 0x3F MessageIdentifierReqDID MessageIdentifier = 0x00 MessageIdentifierDeviceID MessageIdentifier = 0x01 MessageIdentifierInitBus MessageIdentifier = 0x02 MessageIdentifierInitBusResults MessageIdentifier = 0x03 MessageIdentifierReqPeriod MessageIdentifier = 0x04 MessageIdentifierReqPeriodAck MessageIdentifier = 0x05 MessageIdentifierSetPeriod MessageIdentifier = 0x04 MessageIdentifierSetPeriodAck MessageIdentifier = 0x05 MessageIdentifierSetBid MessageIdentifier = 0x06 MessageIdentifierSetBidAck MessageIdentifier = 0x07 MessageIdentifierAutoStart MessageIdentifier = 0x06 MessageIdentifierAutoStartAck MessageIdentifier = 0x07 MessageIdentifierBusPower MessageIdentifier = 0x08 MessageIdentifierBusPowerAck MessageIdentifier = 0x09 MessageIdentifierReqDataLength MessageIdentifier = 0x0A MessageIdentifierDataLength MessageIdentifier = 0x0B MessageIdentifierReqConfiguration MessageIdentifier = 0x0C MessageIdentifierConfiguration MessageIdentifier = 0x0D MessageIdentifierRestoreFactoryDef MessageIdentifier = 0x0E MessageIdentifierRestoreFactoryDefAck MessageIdentifier = 0x0F MessageIdentifierGotoMeasurement MessageIdentifier = 0x10 MessageIdentifierGotoMeasurementAck MessageIdentifier = 0x11 MessageIdentifierReqFirmwareRevision MessageIdentifier = 0x12 MessageIdentifierFirmwareRevision MessageIdentifier = 0x13 MessageIdentifierReqBluetoothDisable MessageIdentifier = 0x14 MessageIdentifierReqBluetoothDisableAck MessageIdentifier = 0x15 MessageIdentifierDisableBluetooth MessageIdentifier = 0x14 MessageIdentifierDisableBluetoothAck MessageIdentifier = 0x15 MessageIdentifierReqXmOutputMode MessageIdentifier = 0x16 MessageIdentifierReqXmOutputModeAck MessageIdentifier = 0x17 MessageIdentifierSetXmOutputMode MessageIdentifier = 0x16 MessageIdentifierSetXmOutputModeAck MessageIdentifier = 0x17 MessageIdentifierReqBaudrate MessageIdentifier = 0x18 MessageIdentifierReqBaudrateAck MessageIdentifier = 0x19 MessageIdentifierSetBaudrate MessageIdentifier = 0x18 MessageIdentifierSetBaudrateAck MessageIdentifier = 0x19 MessageIdentifierReqSyncMode MessageIdentifier = 0x1A MessageIdentifierReqSyncModeAck MessageIdentifier = 0x1B MessageIdentifierSetSyncMode MessageIdentifier = 0x1A MessageIdentifierSetSyncModeAck MessageIdentifier = 0x1B MessageIdentifierReqProductCode MessageIdentifier = 0x1C MessageIdentifierProductCode MessageIdentifier = 0x1D MessageIdentifierReqHWVersion MessageIdentifier = 0x1E MessageIdentifierHWVersion MessageIdentifier = 0x1F MessageIdentifierReqProcessingFlags MessageIdentifier = 0x20 MessageIdentifierReqProcessingFlagsAck MessageIdentifier = 0x21 MessageIdentifierSetProcessingFlags MessageIdentifier = 0x20 MessageIdentifierSetProcessingFlagsAck MessageIdentifier = 0x21 MessageIdentifierReqInputTrigger MessageIdentifier = 0x26 MessageIdentifierReqInputTriggerAck MessageIdentifier = 0x27 MessageIdentifierSetInputTrigger MessageIdentifier = 0x26 MessageIdentifierSetInputTriggerAck MessageIdentifier = 0x27 MessageIdentifierReqOutputTrigger MessageIdentifier = 0x28 MessageIdentifierReqOutputTriggerAck MessageIdentifier = 0x29 MessageIdentifierSetOutputTrigger MessageIdentifier = 0x28 MessageIdentifierSetOutputTriggerAck MessageIdentifier = 0x29 MessageIdentifierSetSyncBoxMode MessageIdentifier = 0x2A MessageIdentifierSetSyncBoxModeAck MessageIdentifier = 0x2B MessageIdentifierReqSyncBoxMode MessageIdentifier = 0x2A MessageIdentifierReqSyncBoxModeAck MessageIdentifier = 0x2B MessageIdentifierSetSyncConfiguration MessageIdentifier = 0x2C MessageIdentifierSetSyncConfigurationAck MessageIdentifier = 0x2D MessageIdentifierReqSyncConfiguration MessageIdentifier = 0x2C MessageIdentifierSyncConfiguration MessageIdentifier = 0x2D MessageIdentifierDriverDisconnect MessageIdentifier = 0x2E MessageIdentifierDriverDisconnectAck MessageIdentifier = 0x2F MessageIdentifierXmPowerOff MessageIdentifier = 0x44 MessageIdentifierReqOutputConfiguration MessageIdentifier = 0xC0 MessageIdentifierReqOutputConfigurationAck MessageIdentifier = 0xC1 MessageIdentifierSetOutputConfiguration MessageIdentifier = 0xC0 MessageIdentifierSetOutputConfigurationAck MessageIdentifier = 0xC1 MessageIdentifierReqOutputMode MessageIdentifier = 0xD0 MessageIdentifierReqOutputModeAck MessageIdentifier = 0xD1 MessageIdentifierSetOutputMode MessageIdentifier = 0xD0 MessageIdentifierSetOutputModeAck MessageIdentifier = 0xD1 MessageIdentifierReqOutputSettings MessageIdentifier = 0xD2 MessageIdentifierReqOutputSettingsAck MessageIdentifier = 0xD3 MessageIdentifierSetOutputSettings MessageIdentifier = 0xD2 MessageIdentifierSetOutputSettingsAck MessageIdentifier = 0xD3 MessageIdentifierReqOutputSkipFactor MessageIdentifier = 0xD4 MessageIdentifierReqOutputSkipFactorAck MessageIdentifier = 0xD5 MessageIdentifierSetOutputSkipFactor MessageIdentifier = 0xD4 MessageIdentifierSetOutputSkipFactorAck MessageIdentifier = 0xD5 MessageIdentifierReqSyncInSettings MessageIdentifier = 0xD6 MessageIdentifierReqSyncInSettingsAck MessageIdentifier = 0xD7 MessageIdentifierSetSyncInSettings MessageIdentifier = 0xD6 MessageIdentifierSetSyncInSettingsAck MessageIdentifier = 0xD7 MessageIdentifierReqSyncOutSettings MessageIdentifier = 0xD8 MessageIdentifierReqSyncOutSettingsAck MessageIdentifier = 0xD9 MessageIdentifierSetSyncOutSettings MessageIdentifier = 0xD8 MessageIdentifierSetSyncOutSettingsAck MessageIdentifier = 0xD9 MessageIdentifierReqErrorMode MessageIdentifier = 0xDA MessageIdentifierReqErrorModeAck MessageIdentifier = 0xDB MessageIdentifierSetErrorMode MessageIdentifier = 0xDA MessageIdentifierSetErrorModeAck MessageIdentifier = 0xDB MessageIdentifierReqTransmitDelay MessageIdentifier = 0xDC MessageIdentifierReqTransmitDelayAck MessageIdentifier = 0xDD MessageIdentifierSetTransmitDelay MessageIdentifier = 0xDC MessageIdentifierSetTransmitDelayAck MessageIdentifier = 0xDD MessageIdentifierSetMfmResults MessageIdentifier = 0xDE MessageIdentifierSetMfmResultsAck MessageIdentifier = 0xDF MessageIdentifierReqObjectAlignment MessageIdentifier = 0xE0 MessageIdentifierReqObjectAlignmentAck MessageIdentifier = 0xE1 MessageIdentifierSetObjectAlignment MessageIdentifier = 0xE0 MessageIdentifierSetObjectAlignmentAck MessageIdentifier = 0xE1 MessageIdentifierReqXmErrorMode MessageIdentifier = 0x82 MessageIdentifierReqXmErrorModeAck MessageIdentifier = 0x83 MessageIdentifierSetXmErrorMode MessageIdentifier = 0x82 MessageIdentifierSetXmErrorModeAck MessageIdentifier = 0x83 MessageIdentifierReqBufferSize MessageIdentifier = 0x84 MessageIdentifierReqBufferSizeAck MessageIdentifier = 0x85 MessageIdentifierSetBufferSize MessageIdentifier = 0x84 MessageIdentifierSetBufferSizeAck MessageIdentifier = 0x85 MessageIdentifierReqHeading MessageIdentifier = 0x82 MessageIdentifierReqHeadingAck MessageIdentifier = 0x83 MessageIdentifierSetHeading MessageIdentifier = 0x82 MessageIdentifierSetHeadingAck MessageIdentifier = 0x83 MessageIdentifierReqMagneticField MessageIdentifier = 0x6A MessageIdentifierReqMagneticFieldAck MessageIdentifier = 0x6B MessageIdentifierSetMagneticField MessageIdentifier = 0x6A MessageIdentifierSetMagneticFieldAck MessageIdentifier = 0x6B MessageIdentifierReqLocationID MessageIdentifier = 0x84 MessageIdentifierReqLocationIDAck MessageIdentifier = 0x85 MessageIdentifierSetLocationID MessageIdentifier = 0x84 MessageIdentifierSetLocationIDAck MessageIdentifier = 0x85 MessageIdentifierReqExtOutputMode MessageIdentifier = 0x86 MessageIdentifierReqExtOutputModeAck MessageIdentifier = 0x87 MessageIdentifierSetExtOutputMode MessageIdentifier = 0x86 MessageIdentifierSetExtOutputModeAck MessageIdentifier = 0x87 MessageIdentifierReqBatteryLevel MessageIdentifier = 0x88 MessageIdentifierBatterylevel MessageIdentifier = 0x89 MessageIdentifierReqInitTrackMode MessageIdentifier = 0x88 MessageIdentifierReqInitTrackModeAck MessageIdentifier = 0x89 MessageIdentifierSetInitTrackMode MessageIdentifier = 0x88 MessageIdentifierSetInitTrackModeAck MessageIdentifier = 0x89 MessageIdentifierReqMasterSettings MessageIdentifier = 0x8A MessageIdentifierMasterSettings MessageIdentifier = 0x8B MessageIdentifierStoreFilterState MessageIdentifier = 0x8A MessageIdentifierStoreFilterStateAck MessageIdentifier = 0x8B MessageIdentifierSetUtcTime MessageIdentifier = 0x60 MessageIdentifierReqUtcTime MessageIdentifier = 0x60 MessageIdentifierSetUtcTimeAck MessageIdentifier = 0x61 MessageIdentifierUtcTime MessageIdentifier = 0x61 MessageIdentifierAdjustUtcTime MessageIdentifier = 0xA8 MessageIdentifierAdjustUtcTimeAck MessageIdentifier = 0xA9 MessageIdentifierReqActiveClockCorrection MessageIdentifier = 0x9C MessageIdentifierActiveClockCorrection MessageIdentifier = 0x9D MessageIdentifierStoreActiveClockCorrection MessageIdentifier = 0x9E MessageIdentifierStoreActiveClockCorrectionAck MessageIdentifier = 0x9F MessageIdentifierReqAvailableFilterProfiles MessageIdentifier = 0x62 MessageIdentifierAvailableFilterProfiles MessageIdentifier = 0x63 MessageIdentifierReqFilterProfile MessageIdentifier = 0x64 MessageIdentifierReqFilterProfileAck MessageIdentifier = 0x65 MessageIdentifierSetFilterProfile MessageIdentifier = 0x64 MessageIdentifierSetFilterProfileAck MessageIdentifier = 0x65 MessageIdentifierReqGravityMagnitude MessageIdentifier = 0x66 MessageIdentifierReqGravityMagnitudeAck MessageIdentifier = 0x67 MessageIdentifierSetGravityMagnitude MessageIdentifier = 0x66 MessageIdentifierSetGravityMagnitudeAck MessageIdentifier = 0x67 MessageIdentifierReqGpsLeverArm MessageIdentifier = 0x68 MessageIdentifierReqGpsLeverArmAck MessageIdentifier = 0x69 MessageIdentifierSetGpsLeverArm MessageIdentifier = 0x68 MessageIdentifierSetGpsLeverArmAck MessageIdentifier = 0x69 MessageIdentifierReqLatLonAlt MessageIdentifier = 0x6E MessageIdentifierReqLatLonAltAck MessageIdentifier = 0x6F MessageIdentifierSetLatLonAlt MessageIdentifier = 0x6E MessageIdentifierSetLatLonAltAck MessageIdentifier = 0x6F MessageIdentifierGotoConfig MessageIdentifier = 0x30 MessageIdentifierGotoConfigAck MessageIdentifier = 0x31 MessageIdentifierBusData MessageIdentifier = 0x32 MessageIdentifierMtData MessageIdentifier = 0x32 MessageIdentifierSetNoRotation MessageIdentifier = 0x22 MessageIdentifierSetNoRotationAck MessageIdentifier = 0x23 MessageIdentifierRunSelfTest MessageIdentifier = 0x24 MessageIdentifierSelfTestResults MessageIdentifier = 0x25 MessageIdentifierPrepareData MessageIdentifier = 0x32 MessageIdentifierReqData MessageIdentifier = 0x34 MessageIdentifierReqDataAck MessageIdentifier = 0x35 MessageIdentifierMTData2 MessageIdentifier = 0x36 MessageIdentifierReset MessageIdentifier = 0x40 MessageIdentifierResetAck MessageIdentifier = 0x41 MessageIdentifierError MessageIdentifier = 0x42 MessageIdentifierMasterIndication MessageIdentifier = 0x46 MessageIdentifierStopRecordingIndication MessageIdentifier = 0x12 MessageIdentifierFlushingIndication MessageIdentifier = 0x13 MessageIdentifierReqFilterSettings MessageIdentifier = 0xA0 MessageIdentifierReqFilterSettingsAck MessageIdentifier = 0xA1 MessageIdentifierSetFilterSettings MessageIdentifier = 0xA0 MessageIdentifierSetFilterSettingsAck MessageIdentifier = 0xA1 MessageIdentifierReqAmd MessageIdentifier = 0xA2 MessageIdentifierReqAmdAck MessageIdentifier = 0xA3 MessageIdentifierSetAmd MessageIdentifier = 0xA2 MessageIdentifierSetAmdAck MessageIdentifier = 0xA3 MessageIdentifierResetOrientation MessageIdentifier = 0xA4 MessageIdentifierResetOrientationAck MessageIdentifier = 0xA5 MessageIdentifierReqGpsStatus MessageIdentifier = 0xA6 MessageIdentifierGpsStatus MessageIdentifier = 0xA7 MessageIdentifierWriteDeviceID MessageIdentifier = 0xB0 MessageIdentifierWriteDeviceIDAck MessageIdentifier = 0xB1 MessageIdentifierWriteSecurityKey MessageIdentifier = 0xB2 MessageIdentifierWriteSecurityKeyAck MessageIdentifier = 0xB3 MessageIdentifierProtectFlash MessageIdentifier = 0xB4 MessageIdentifierProtectFlashAck MessageIdentifier = 0xB5 MessageIdentifierReqSecurityCheck MessageIdentifier = 0xB6 MessageIdentifierSecurityCheck MessageIdentifier = 0xB7 MessageIdentifierScanChannels MessageIdentifier = 0xB0 MessageIdentifierScanChannelsAck MessageIdentifier = 0xB1 MessageIdentifierEnableMaster MessageIdentifier = 0xB2 MessageIdentifierEnableMasterAck MessageIdentifier = 0xB3 MessageIdentifierDisableMaster MessageIdentifier = 0xB4 MessageIdentifierDisableMasterAck MessageIdentifier = 0xB5 MessageIdentifierReqRadioChannel MessageIdentifier = 0xB6 MessageIdentifierReqRadioChannelAck MessageIdentifier = 0xB7 MessageIdentifierSetClientPriority MessageIdentifier = 0xB8 MessageIdentifierSetClientPriorityAck MessageIdentifier = 0xB9 MessageIdentifierReqClientPriority MessageIdentifier = 0xB8 MessageIdentifierReqClientPriorityAck MessageIdentifier = 0xB9 MessageIdentifierSetWirelessConfig MessageIdentifier = 0xBA MessageIdentifierSetWirelessConfigAck MessageIdentifier = 0xBB MessageIdentifierReqWirelessConfig MessageIdentifier = 0xBA MessageIdentifierReqWirelessConfigAck MessageIdentifier = 0xBB MessageIdentifierUpdateBias MessageIdentifier = 0xBC MessageIdentifierUpdateBiasAck MessageIdentifier = 0xBD MessageIdentifierToggleIoPins MessageIdentifier = 0xBE MessageIdentifierToggleIoPinsAck MessageIdentifier = 0xBF MessageIdentifierSetTransportMode MessageIdentifier = 0xC2 MessageIdentifierSetTransportModeAck MessageIdentifier = 0xC3 MessageIdentifierReqTransportMode MessageIdentifier = 0xC2 MessageIdentifierReqTransportModeAck MessageIdentifier = 0xC3 MessageIdentifierAcceptMtw MessageIdentifier = 0xC4 MessageIdentifierAcceptMtwAck MessageIdentifier = 0xC5 MessageIdentifierRejectMtw MessageIdentifier = 0xC6 MessageIdentifierRejectMtwAck MessageIdentifier = 0xC7 MessageIdentifierInfoRequest MessageIdentifier = 0xC8 MessageIdentifierInfoRequestAck MessageIdentifier = 0xC9 MessageIdentifierReqFrameRates MessageIdentifier = 0xCA MessageIdentifierReqFrameRatesAck MessageIdentifier = 0xCB MessageIdentifierStartRecording MessageIdentifier = 0xCC MessageIdentifierStartRecordingAck MessageIdentifier = 0xCD MessageIdentifierStopRecording MessageIdentifier = 0xCE MessageIdentifierStopRecordingAck MessageIdentifier = 0xCF MessageIdentifierInfoBatteryLevel MessageIdentifier = 0x49 MessageIdentifierInfoTemperature MessageIdentifier = 0x4A MessageIdentifierGotoOperational MessageIdentifier = 0xC0 MessageIdentifierGotoOperationalAck MessageIdentifier = 0xC1 MessageIdentifierReqEmts MessageIdentifier = 0x90 MessageIdentifierEmtsData MessageIdentifier = 0x91 MessageIdentifierRestoreEmts MessageIdentifier = 0x94 MessageIdentifierRestoreEmtsAck MessageIdentifier = 0x95 MessageIdentifierStoreEmts MessageIdentifier = 0x96 MessageIdentifierStoreEmtsAck MessageIdentifier = 0x97 MessageIdentifierGotoTransparentMode MessageIdentifier = 0x50 MessageIdentifierGotoTransparentModeAck MessageIdentifier = 0x51 MessageIdentifierSetCANConfig MessageIdentifier = 0xE6 MessageIdentifierSetCANConfigAck MessageIdentifier = 0xE7 MessageIdentifierReqCANConfig MessageIdentifier = 0xE6 MessageIdentifierReqCANConfigAck MessageIdentifier = 0xE7 MessageIdentifierSetCANOutputConfig MessageIdentifier = 0xE8 MessageIdentifierSetCANOutputConfigAck MessageIdentifier = 0xE9 MessageIdentifierReqCANOutputConfig MessageIdentifier = 0xE8 MessageIdentifierReqCANOutputConfigAck MessageIdentifier = 0xE9 )
func (MessageIdentifier) Ack ¶ added in v0.9.0
func (mid MessageIdentifier) Ack() MessageIdentifier
Ack returns the message identifier's corresponding ack.
func (MessageIdentifier) IsAck ¶ added in v0.9.0
func (mid MessageIdentifier) IsAck() bool
IsAck returns true if the message identifier is an ack.
func (MessageIdentifier) String ¶ added in v0.9.0
func (i MessageIdentifier) String() string
type OutputConfiguration ¶ added in v0.9.0
type OutputConfiguration []OutputConfigurationSetting
OutputConfiguration is measurement data output configuration.
The data is a list of maximum 32 data identifiers combined with a desired output frequency.
For data that is sent with every MTData2 message (Timestamp, Status), the Output OutputFrequency will be ignored and will be set to 0xFFFF.
func (*OutputConfiguration) Marshal ¶ added in v0.9.0
func (o *OutputConfiguration) Marshal() ([]byte, error)
Marshal returns the wire representation of the output configuration.
func (*OutputConfiguration) MarshalText ¶ added in v0.9.0
func (o *OutputConfiguration) MarshalText() (string, error)
MarshalText returns a text representation of the output configuration.
func (*OutputConfiguration) Unmarshal ¶ added in v0.9.0
func (o *OutputConfiguration) Unmarshal(data []byte) error
Unmarshal sets *o from a wire representation of the output configuration.
type OutputConfigurationSetting ¶ added in v0.9.0
type OutputConfigurationSetting struct {
// DataIdentifier is the data identifier of the data.
DataIdentifier
// OutputFrequency is the output frequency of the data.
//
// Selecting an Output OutputFrequency of either 0x0000 or 0xFFFF, makes the device select the
// maximum frequency for the given data identifier. The device reports the resulting effective
// frequencies in its response message.
OutputFrequency
}
OutputConfigurationSetting is the output configuration for a single measurement data type.
type OutputFrequency ¶ added in v0.9.0
type OutputFrequency uint16
OutputFrequency represents the output frequency of a specific Xsens measurement data type.
const MaxOutputFrequency OutputFrequency = 0xffff
MaxOutputFrequency is the sentinel value used for data types that should be included in every message, if possible.
func (OutputFrequency) String ¶ added in v0.9.0
func (f OutputFrequency) String() string
String returns a string representation of the output frequency.
type PacketCounter ¶ added in v0.9.0
type PacketCounter uint16
PacketCounter contains the packet counter.
This counter is incremented with every generated MTData2 message.
func (*PacketCounter) MarshalMTData2Packet ¶ added in v0.15.0
func (p *PacketCounter) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*PacketCounter) String ¶ added in v0.9.0
func (p *PacketCounter) String() string
String returns a string representation of the packet counter.
func (*PacketCounter) UnmarshalMTData2Packet ¶ added in v0.15.0
func (p *PacketCounter) UnmarshalMTData2Packet(packet MTData2Packet) error
type PositionECEF ¶ added in v0.15.0
type PositionECEF = VectorXYZ
PositionECEF contains the position of the MTi-G in the Earth-Centered, Earth-Fixed (ECEF) coordinate system in meters.
Note that position in ECEF cannot be represented in Fixed Point values because of the limited range of fixed point representations. Use double or float representation instead.
type Precision ¶ added in v0.9.0
type Precision uint8
Precision is an Xsens data output precision.
const ( // PrecisionFloat32 uses single-precision IEEE 32-bit floating point numbers. PrecisionFloat32 Precision = 0x0 // PrecisionFP1220 uses fixed point 12.20 32-bit numbers. PrecisionFP1220 Precision = 0x1 // PrecisionFP1632 uses fixed point 16.32 48-bit numbers. PrecisionFP1632 Precision = 0x2 // PrecisionFloat64 uses double-precision IEEE 64-bit floating point numbers. PrecisionFloat64 Precision = 0x3 )
type ProductCode ¶ added in v0.20.0
type ProductCode string
func (*ProductCode) UnmarshalBinary ¶ added in v0.20.0
func (d *ProductCode) UnmarshalBinary(data []byte) error
type Quaternion ¶ added in v0.9.0
type Quaternion struct {
Q0, Q1, Q2, Q3 float64
}
Quaternion contains a quaternion with q0, q1, q2 and q3-components.
func (*Quaternion) MarshalMTData2Packet ¶ added in v0.15.0
func (t *Quaternion) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*Quaternion) UnmarshalMTData2Packet ¶ added in v0.15.0
func (t *Quaternion) UnmarshalMTData2Packet(packet MTData2Packet) error
type RateOfTurn ¶ added in v0.15.0
type RateOfTurn = VectorXYZ
RateOfTurn contains the calibrated rate of turn vector in x, y, and z axes in rad/s.
type RateOfTurnHR ¶ added in v0.15.0
type RateOfTurnHR = VectorXYZ
RateOfTurnHR contains the high-resolution calibrated rate of turn vector in x, y, and z axes in rad/s.
For the MTi 1-series, with the exception of the MTi-7, the output data rate is 1000 Hz based on the internal clock of the IMU which is not aligned with other data; data has not been processed in the SDI algorithm. It has been calibrated with the Xsens calibration parameters (except for g-sensitivity).
For the MTi-7, the output data is 800 Hz based on the internal clock of the IMUs which are not aligned with other data; data has not been processed in the SDI algorithm. It has been calibrated with the Xsens calibration parameters (except for g- sensitivity).
For the MTi 100-series and MTi-G-710, the output data is 1000 Hz, synchronized with the internal clock of the MTi 100-series (10 ppm; 1 ppm with GNSS ClockSync). The data has been processed in the SDI algorithm. Note that RateOfTurnHR is not grouped with messages coming out at the same time.
type RotationMatrix ¶ added in v0.9.0
type RotationMatrix struct {
A, B, C, D, E, F, G, H, I float64
}
RotationMatrix contains the rotation matrix (DCM) that represents the orientation of the MT.
func (*RotationMatrix) MarshalMTData2Packet ¶ added in v0.15.0
func (t *RotationMatrix) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*RotationMatrix) UnmarshalMTData2Packet ¶ added in v0.15.0
func (t *RotationMatrix) UnmarshalMTData2Packet(packet MTData2Packet) error
type SampleTimeCoarse ¶ added in v0.9.0
type SampleTimeCoarse uint32
SampleTimeCoarse contains the sample time of an output expressed in seconds.
When there is no GNSS-fix in the MTi-G-710, this value is arbitrary for GNSS messages.
func (*SampleTimeCoarse) MarshalMTData2Packet ¶ added in v0.15.0
func (s *SampleTimeCoarse) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*SampleTimeCoarse) String ¶ added in v0.9.0
func (s *SampleTimeCoarse) String() string
String returns a string representation of the sample time.
func (*SampleTimeCoarse) UnmarshalMTData2Packet ¶ added in v0.15.0
func (s *SampleTimeCoarse) UnmarshalMTData2Packet(packet MTData2Packet) error
type SampleTimeFine ¶ added in v0.9.0
type SampleTimeFine uint32
SampleTimeFine contains the sample time of an output expressed in 10kHz ticks.
When there is no GNSS-fix in the MTi-G-710, this value is arbitrary for GNSS messages.
func (*SampleTimeFine) MarshalMTData2Packet ¶ added in v0.15.0
func (s *SampleTimeFine) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*SampleTimeFine) String ¶ added in v0.9.0
func (s *SampleTimeFine) String() string
String returns a string representation of the sample time.
func (*SampleTimeFine) UnmarshalMTData2Packet ¶ added in v0.15.0
func (s *SampleTimeFine) UnmarshalMTData2Packet(packet MTData2Packet) error
type Scalar ¶ added in v0.9.0
type Scalar float64
Scalar contains a single scalar value.
func (*Scalar) MarshalMTData2Packet ¶ added in v0.15.0
func (s *Scalar) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*Scalar) UnmarshalMTData2Packet ¶ added in v0.15.0
func (s *Scalar) UnmarshalMTData2Packet(packet MTData2Packet) error
type StatusByte ¶ added in v0.9.0
type StatusByte uint8
StatusByte contains the 8bit status byte which is equal to bits 0-7 of an MTData2 StatusWord packet.
func (*StatusByte) MarshalMTData2Packet ¶ added in v0.15.0
func (t *StatusByte) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*StatusByte) String ¶ added in v0.9.0
func (t *StatusByte) String() string
func (*StatusByte) UnmarshalMTData2Packet ¶ added in v0.15.0
func (t *StatusByte) UnmarshalMTData2Packet(packet MTData2Packet) error
type StatusWord ¶ added in v0.9.0
type StatusWord uint32
StatusWord contains the 32bit status word.
0: Selftest
This flag indicates if the MT passed theself-test according to eMTS. For an up-to-date result of the self-test, use the command RunSelftest.
1: Filter Valid
This flag indicates if input into the orientation filter is reliable and / or complete. If for example the measurement range of internal sensors is exceeded, orientation output cannot be reliably estimated and the filter flag will drop to 0.
For the MTi-G, the filter flag will also become invalid if the GPS status remains invalid for an extended period.
2: GNSS fix
This flag indicates if the GNSS unit has a proper fix. The flag is only available in MTi-G units.
3-4: NoRotationUpdate Status
This flag indicates the status of the no rotation update procedure in the filter after the SetNoRotation message has been sent.
11: Running with no rotation assumption 10: Rotation detected, no gyro bias estimation (sticky) 00: Estimation complete, no errors
5 Representative Motion
(RepMo) Indicates if the MTi is in In-run Compass Calibration Representative Mode
6-7: Reserved Reserved for future use
8-19: Clip flags
Indicates out of range values on sensors.
8: Clipflag Acc X 9: Clipflag Acc Y 10: Clipflag Acc Z 11: Clipflag Gyr X 12: Clipflag Gyr Y 13: Clipflag Gyr Z 14: Clipflag Mag X 15: Clipflag Mag Y 16: Clipflag Mag Z 17-18: Reserved Reserved for future use 19: Clipping Indication (indicates that one or more sensors are out of range)
20: Reserved Reserved for future use
21: SyncIn Marker
When a SyncIn is detected, this bit will rise to 1.
22: SyncOut Marker
When SyncOut is active this bit will rise to 1.
23-25: Filter Mode
Indicates Filter Mode, currently only available for the MTi-G-710 and MTi-7:
000: Without GNSS (filter profile is in VRU mode) 001: Coasting mode (GNSS has been lost <60 sec ago) 011: With GNSS (default mode of MTi-G-710)
26-31: Reserved
Reserved for future use.
func (*StatusWord) MarshalMTData2Packet ¶ added in v0.15.0
func (t *StatusWord) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*StatusWord) String ¶ added in v0.9.0
func (t *StatusWord) String() string
String returns a string representation of the status word.
func (*StatusWord) UnmarshalMTData2Packet ¶ added in v0.15.0
func (t *StatusWord) UnmarshalMTData2Packet(packet MTData2Packet) error
type Temperature ¶ added in v0.15.0
type Temperature = Scalar
Temperature contains the internal temperature of the sensor in degrees Celsius.
type UTCTime ¶ added in v0.9.0
type UTCTime struct {
Ns uint32
Year uint16
Month, Day, Hour, Minute, Second uint8
Valid UTCValidity
}
UTCTime contains the timestamp expressed as the UTC time.
func (*UTCTime) MarshalMTData2Packet ¶ added in v0.15.0
func (u *UTCTime) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*UTCTime) String ¶ added in v0.9.0
String returns the UTC time on RFC3339 (including nanoseconds) format.
func (*UTCTime) UnmarshalMTData2Packet ¶ added in v0.15.0
func (u *UTCTime) UnmarshalMTData2Packet(packet MTData2Packet) error
func (*UTCTime) UnmarshalTime ¶ added in v0.15.0
type UTCValidity ¶ added in v0.15.0
type UTCValidity uint8
UTCValidity represents the validity of an Xsens UTC timestamp.
func (UTCValidity) IsDateValid ¶ added in v0.15.0
func (u UTCValidity) IsDateValid() bool
func (UTCValidity) IsTimeOfDayFullyResolved ¶ added in v0.15.0
func (u UTCValidity) IsTimeOfDayFullyResolved() bool
func (UTCValidity) IsTimeOfDayValid ¶ added in v0.15.0
func (u UTCValidity) IsTimeOfDayValid() bool
type VectorXYZ ¶ added in v0.9.0
type VectorXYZ struct {
X, Y, Z float64
}
VectorXYZ contains a vector with x, y and z-components.
func (*VectorXYZ) MarshalMTData2Packet ¶ added in v0.15.0
func (t *VectorXYZ) MarshalMTData2Packet(id DataIdentifier) (MTData2Packet, error)
func (*VectorXYZ) UnmarshalMTData2Packet ¶ added in v0.15.0
func (t *VectorXYZ) UnmarshalMTData2Packet(packet MTData2Packet) error
type VelocityXYZ ¶ added in v0.15.0
type VelocityXYZ = VectorXYZ
VelocityXYZ contains the X, Y and Z components of the MTi-G velocity in m/s.
Source Files
¶
- canbaudrateid.go
- canbaudrateid_string.go
- canconfig.go
- candataidentifier.go
- candataidentifier_string.go
- canoutputconfiguration.go
- client.go
- coordinatesystem.go
- coordinatesystem_string.go
- dataidentifier.go
- datatype.go
- datatype_string.go
- doc.go
- errorcode.go
- errorcode_string.go
- fixedpoint.go
- fixtype.go
- fixtype_string.go
- informationmessages.go
- measurementdata.go
- message.go
- messageidentifier.go
- messageidentifier_string.go
- mtdata2.go
- outputconfiguration.go
- precision.go
- precision_string.go
- scanmessages.go
- serial.go
- utcvalidity.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
xsens
command
|
|
|
examples
|
|
|
read
command
|
|
|
mockserial
Package mockserial is a generated GoMock package.
|
Package mockserial is a generated GoMock package. |
|
Package xsensemulator provides primitives for emulating Xsens devices.
|
Package xsensemulator provides primitives for emulating Xsens devices. |