InertialNode
InertialNode

A class representing a MicroStrain Inertial Node

See Also

WirelessNode

InertialNode
explicit InertialNode(
Connection connection
)

Creates an InertialNode object.

Parameters
connection

The Connection object used for communication.

Exceptions
info
const InertialNodeInfo& info()

Gets InertialNodeInfo for this Node.  The first time this function is called, it will send multiple commands to the device to get all required information.  Note: This will be invalid when the InertialNode is destroyed.

Returns

A reference to the InertialNodeInfo for this Node.

Exceptions
features
const InertialNodeFeatures& features()

Gets a reference to the InertialNodeFeatures for this device.  Note: This will be invalid when the InertialNode is destroyed.

Exceptions
deviceName
static std::string deviceName(
const std::string &serial
)

Static function for creating the universal sensor name that should be used for SensorCloud.

Parameters
serial
const std::string&

The serial number of the inertial node. This should be identical to calling the <serialNumber> function on an InertialNodeInfo object (see InertialNode::info).

Returns

The universal sensor name.

lastCommunicationTime
const Timestamp& lastCommunicationTime() const

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

Returns

A Timestamp representing the last time MSCL communicated with the Node. This will be a Timestamp of 0 if never communicated with.

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
InertialDataPackets getDataPackets(
uint32 timeout 0,
uint32 maxPackets 0
)

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

Parameters
timeout
uint32

The timeout, in milliseconds, to wait for 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.

Returns

A vector of InertialDataPackets containing all the data packets that are available up to the requested number of packets.

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.

name
std::string name()

Gets the name of the InertialNode. This is the universal sensor name that should be used for uploading to SensorCloud.  This is the same as calling InertialNode::deviceName.

Returns

The universal sensor name.

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 issued, then the device is placed in default mode.

Exceptions
getDataRateBase
uint16 getDataRateBase(
InertialTypes::InertialCategory category
)

Gets the Data decimation base for the data rate calculations of the specified <InertialType>.

Parameters
type

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

Returns

The decimation base for the data rate calculations.

Exceptions
getActiveChannelFields
InertialChannels getActiveChannelFields(
InertialTypes::InertialCategory category
)

Gets the current active channel fields for the specified InertialTypes::InertialCategory.

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
setActiveChannelFields
void setActiveChannelFields(
InertialTypes::InertialCategory category,
const InertialChannels &channels
)

Sets the current active channel fields for the specified InertialTypes::InertialCategory.  Note that this function does not add to the existing message format (active channels), 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
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
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 true
)

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.  Note: If the auto-initialization feature is disabled, the initial attitude or heading must be set in order to enter the run state after a reset.

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.  Node: This command can only be issues in the "INIT" state and should be used with a good estimate of the vehicle 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.  Node: This command can only be issues in the "INIT" state and should be used with a good estimate of heading. The device will use this value in conjunction with the output of the accelerometers to determine the initial attitude estimate.

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.  These angles define the rotation from the sensor body from to the fixed vehicle frame.

Returns

The EulerAngles object containing the roll, pitch, and yaw result (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).  These angles define the rotation from the sensor body from to the fixed vehicle frame.

Parameters
angles

The EulerAngles object containing the roll, pitch, and yaw (in radians) to set.

Exceptions
getSensorToVehicleOffset
PositionOffset getSensorToVehicleOffset()

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

Returns

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

Exceptions
setSensorToVehicleOffset
void setSensorToVehicleOffset(
const PositionOffset &offset
)

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.

Returns

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

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