InertialNode_Impl
InertialNode_Impl

Contains the implementation for an InertialNode.

Constants
COMMANDS_DEFAULT_TIMEOUT

The default timeout for Inertial commands (100 milliseconds)

Functions
InertialNode_Impl
explicit InertialNode_Impl(
Connection connection
)

Creates an InertialNode_Impl object.

Parameters
connection

The Connection object used for communication.

~InertialNode
~InertialNode_Impl()

Destroys the InertialNode object

Variables
m_connection
Connection m_connection

The Connection object used for communication

m_packetCollector
InertialPacketCollector m_packetCollector

The Inertial packet collector used to store interial data packets

m_responseCollector
std::shared_ptr<ResponseCollector> m_responseCollector

The response collector used to find and store wireless command responses

m_parser
std::unique_ptr<InertialParser> m_parser

The Inertial parser in charge of parsing all incoming data to this device

m_nodeCommandsTimeout

The timeout to use for Inertial commands

m_nodeInfo
std::unique_ptr<InertialNodeInfo> m_nodeInfo

The InertialNodeInfo object that gives access to information of the Inertial Node

m_sensorRateBase
uint16 m_sensorRateBase

The Sensor sample rate base (if any).

m_gpsRateBase
uint16 m_gpsRateBase

The GPS sample rate base (if any).

m_sensorRateBase

The Estimation Filter sample rate base (if any).

m_sensorSampleRates
SampleRates m_sensorSampleRates

Contains the sample rates for the Sensor group.

m_gpsSampleRates
SampleRates m_gpsSampleRates

Contains the sample rates for the GPS group.

m_estfilterSampleRates
SampleRates m_estfilterSampleRates

Contains the sample rates for the Estimation Filter group.

m_lastCommTime
Timestamp m_lastCommTime

A Timestamp representing the last time communication was achieved with the InertialNode.

m_features
std::unique_ptr<InertialNodeFeatures> m_features

The InertialNodeFeatures containing the features for this device.

Functions
parseResponse
void parseResponse(
DataBuffer &data
)

Callback function that parses any bytes that are in the read buffer to find packets or command responses

Parameters
data

The DataBuffer containing all the data to be parsed

doInertialCmd
virtual GenericInertialCommandResponse doInertialCmd(
GenericInertialCommand::Response &response,
const ByteStream &command,
InertialTypes::Command commandId,
bool verifySupported true
)

Performs a generic Inertial Command, sending the command bytes and waiting for the response.

Parameters
response
GenericInertialCommand::Response&

A <GenericInertialCommand::Response> that will be used to wait and contain all the command/result information.

command
const ByteStream&

The ByteStream containing the bytes to send for the command.

commandId

The InertialTypes::Command for this command, used in initially checking whether the Inertial Node supports the command.

verifySupported
bool

Whether to verify if the command is supported before performing the command (default of true).

Returns

The GenericInertialCommandResponse that contains the actual data from the response

Exceptions
info
const InertialNodeInfo& info()

Gets the InertialNodeInfo for this Node.  The first time this function is called, it will send multiple commands to the device to get all required information.

Returns

A reference to the InertialNodeInfo for this Node.

Exceptions
features
virtual const InertialNodeFeatures& features()

Gets a reference to the InertialNodeFeatures for this device.

Exceptions
lastCommunicationTime
const Timestamp& lastCommunicationTime() const

Gets the Timestamp for the last time we communicated with the InertialNode.

supportedSampleRates
const SampleRates& supportedSampleRates(
InertialTypes::InertialCategory category
)

Gets a list of the supported sample rates for an InertialTypes::InertialCategory.

Parameters
category

The InertialTypes::InertialCategory to get the sample rate list for.

Returns

A SampleRates list containing all the supported sample rates for the provided channel.

Exceptions
getDataPackets
void getDataPackets(
std::vector<InertialDataPacket&packets,
uint32 timeout 0,
uint32 maxPackets 0
)

Gets up to the requested amount of data packets that have been collected.

Parameters
packets
std::vector<InertialDataPacket>&

A vector of InertialDataPacket to hold the result.

timeout
uint32

the timeout, in milliseconds, to wait for the data if necessary (default of 0)

maxPackets
uint32

The maximum number of packets to return. If this is 0 (default), all packets will be returned.

Exceptions
totalPackets
uint32 totalPackets()

Gets the total number of data packets that are currently in the buffer.

Returns

The total number of data packets that are currently in the buffer.

timeout
void timeout(
uint64 timeout
)

Sets the timeout to use when waiting for responses from Inertial commands.

Parameters
timeout
uint64

The timeout (in milliseconds) to set for Inertial commands.

timeout
uint64 timeout()

Gets the timeout to use when waiting for responses from Inertial commands.

Returns

The timeout (in milliseconds) used for Inertial commands.

getDeviceInfo
virtual InertialDeviceInfo getDeviceInfo()

Gets information about the InertialNode.  Sends the "Get Device Information" command to the device.

Returns

A InertialDeviceInfo object that holds the response of the "Get Device Information" command.

Exceptions
getDescriptorSets
virtual std::vector<uint16> getDescriptorSets()

Gets the supported descriptor sets for this node, representing which commands and data sets are available.  Sends the "Get Device Descriptor Sets" command to the device.

Returns

The supported descriptors retrieved from the "Get Device Descriptor Sets" command.

Exceptions
ping
bool ping()

Pings the node to check for communication.  Sends the "Ping" command to the device.

Returns

true if successfully pinged the node, false if failed.

Exceptions
setToIdle
void setToIdle()

Suspends streaming (if enabled) or wakes the device from sleep (if sleeping), putting the device in an idle mode.  After this command is used, the resume command may be used to put the Node back into the mode it was previously in before setToIdle was called.

Exceptions
resume
void resume()

Places the Node back in the mode it was in before issuing the setToIdle command.  If the setToIdle command was not issues, then the device is placed in default mode.

Exceptions
getDataRateBase
virtual uint16 getDataRateBase(
InertialTypes::InertialCategory category
)

Gets the Data decimation base for the data rate calculations of the specified InertialTypes::InertialCategory.

Parameters
category

The InertialTypes::InertialCategory to get the Data decimation base for.

Returns

The decimation base for the data rate calculations.

Exceptions
getMessageFormat
virtual InertialChannels getMessageFormat(
InertialTypes::InertialCategory category
)

Gets the current message format of the specified InertialTypes::InertialCategory's data packet.

Parameters
category

The InertialTypes::InertialCategory to get the current message format for.

Returns

An InertialChannels object containing the channels that make up the data message format for the specified InertialTypes::InertialCategory

Exceptions
setMessageFormat
virtual void setMessageFormat(
InertialTypes::InertialCategory category,
const InertialChannels &channels
)

Sets the current message format of the specified InertialTypes::InertialCategory's data packet.  Note that this function does not add to the existing message format, but overwrites it entirely.

Parameters
category

The InertialTypes::InertialCategory to set the message format for.

channels
const InertialChannels&

The InertialChannels object containing the channels to set the message format to. Passing an empty InertialChannels object will effectively disable all channels.

Exceptions
getCommunicationMode
virtual uint8 getCommunicationMode()

Gets the current communication mode that the node is in.

Returns

The communication mode the node is in. This is an advanced command, and therefore the communication modes for your device should be researched to determine what each communication mode is.

Exceptions
setCommunicationMode
virtual void setCommunicationMode(
uint8 communicationMode
)

Sets the communication mode for the node.  Note: The node info will be reset when doing this and therefore will require being fetched again the next time it is requested.

Parameters
communicationMode
uint8

The communication mode to set. This is an advanced command, and therefore the communication modes for your device should be researched to determine what each communication mode is.

Exceptions
enableDataStream
void enableDataStream(
InertialTypes::InertialCategory category,
bool enable
)

Enables or disables continuous data streaming for the node.

Parameters
category

The InertialTypes::InertialCategory to enable/disable streaming for.

enable
bool

Whether to enable (true) or disable (false) continuous streaming (Default of true).

Exceptions
resetFilter
void resetFilter()

Resets the filter to the initialize state.

Exceptions
getAutoInitialization
bool getAutoInitialization()

Gets the state of the automatic initialization upon device startup.

Returns

true if auto-initialization is enabled, false if it is disabled.

Exceptions
setAutoInitialization
void setAutoInitialization(
bool enable
)

Sets the state of the automatic initialization upon device startup.

Parameters
enable
bool

Whether to enable (true) or disable(false) auto-initialization.

Exceptions
setInitialAttitude
void setInitialAttitude(
const EulerAngles &attitude
)

Sets the initial attitude.

Parameters
attitude

The EulerAngles (in radians) representing the sensor body frame with respect to the local NED frame.

Exceptions
setInitialHeading
void setInitialHeading(
float heading
)

Sets the initial heading.

Parameters
heading
float

The heading to set (in radians).

Exceptions
getSensorToVehicleTransformation
EulerAngles getSensorToVehicleTransformation()

Gets the sensor to vehicle frame transformation matrix using roll, pitch, and yaw Euler angles (in radians).

Exceptions
setSensorToVehicleTransformation
void setSensorToVehicleTransformation(
const EulerAngles &angles
)

Sets the sensor to vehicle frame transformation matrix using roll, pitch, and yaw Euler angles (in radians).

Parameters
angles

The EulerAngles object containing the roll, pitch, and yaw to set.

Exceptions
getSensorToVehicleOffset
PositionOffset getSensorToVehicleOffset()

Gets the sensor to vehicle frame offset, expressed in the sensor frame.

Exceptions
setSensorToVehicleTransformation

Sets the sensor to vehicle frame offset, expressed in the sensor frame.

Parameters
offset

The PositionOffset object containing the x, y, and z position (in meters) to set.

Exceptions
getAntennaOffset
PositionOffset getAntennaOffset()

Gets the antenna offset, expressed in the sensor frame.

Exceptions
setAntennaOffset
void setAntennaOffset(
const PositionOffset &offset
)

Sets the antenna offset, expressed in the sensor frame.

Parameters
offset

The PositionOffset object containing the x, y, and z position (in meters) to set.

Exceptions