diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index eb1deb6fc..8e8a456b2 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,155 @@
# MSCL Change Log
All notable changes to this project will be documented in this file.
+-------------------------------------------------------------------------
+1.20.1 - 2015-10-29
+- added histogramEnable to FatigueOptions config.
+- added supportsHistogramEnableConfig to NodeFeatures.
+
+-------------------------------------------------------------------------
+1.20.0 - 2015-10-29
+- added fatigueMode to FatigueOptions config (replaces distributedAngleMode boolean).
+- changed rawMode to debugMode in FatigueOptions.
+- changed supportsFatigueRawModeConfig to supportsFatigueDebugModeConfig.
+- added supportsFatigueModeConfig (replaces supportsFatigueDistributedAngleMode).
+- added fatigueModes function to NodeFeatures for getting a list of supported fatigue modes.
+
+-------------------------------------------------------------------------
+1.19.2 - 2015-10-28
+- changed back to std::regex...again.
+
+-------------------------------------------------------------------------
+1.19.1 - 2015-10-27
+- fix for specific config issue enums not actually being returned.
+
+-------------------------------------------------------------------------
+1.19.0 - 2015-10-27
+- added support for WirelessNode quickPing() command for performing a "Short Ping".
+ - this uses the new ASPP Short Ping if the Base Station supports it.
+- changed from std::regex to boost::regex as the current Ubuntu LTS (14.04) doesn't support it.
+- exposed InertialTypes::channelFieldToStr to SWIG.
+- exposed InertialTypes::channelQualifierToStr to SWIG.
+- exposed InertialTypes::channelName to SWIG.
+
+-------------------------------------------------------------------------
+1.18.3 - 2015-10-27
+- added more specific config issue enums.
+- fix for Gauge Factor config issue incorrectly sending a Hardware Gain issue enum.
+
+-------------------------------------------------------------------------
+1.18.2 - 2015-10-26
+- fix for ActivitySense options not being written in the applyConfig function.
+
+-------------------------------------------------------------------------
+1.18.1 - 2015-10-22
+- added support for the SG-Link-Micro node.
+
+-------------------------------------------------------------------------
+1.18.0 - 2015-10-21
+- added support for the Fatigue distributed angle mode configuration.
+
+-------------------------------------------------------------------------
+1.17.1 - 2015-10-21
+- added support for WirelessNode regionCode() function.
+- removed optional frequency parameter from WirelessNode constructor.
+
+-------------------------------------------------------------------------
+1.17.0 - 2015-10-21
+- added support for Gauge Factor configuration for supported nodes.
+
+-------------------------------------------------------------------------
+1.16.0 - 2015-10-20
+- finalized support for ActivitySense feature.
+
+-------------------------------------------------------------------------
+1.15.1 - 2015-10-20
+- added support for SHM-Link2-cust1 model.
+- starting to add support for ActivitySense feature (not yet working, invalid eeproms).
+
+-------------------------------------------------------------------------
+1.15.0 - 2015-10-19
+- added InertialNode::getAntennaOffset().
+- added InertialNode::setAntennaOffset().
+
+-------------------------------------------------------------------------
+1.14.0 - 2015-10-16
+- added InertialNode::getSensorToVehicleOffset().
+- added InertialNode::setSensorToVehicleOffset().
+- added start of InertialNodeFeatures class (doesn't provide anything right now).
+
+-------------------------------------------------------------------------
+1.13.0 - 2015-10-15
+- added InertialNode::getSensorToVehicleTransformation().
+- added InertialNode::setSensorToVehicleTransformation().
+
+-------------------------------------------------------------------------
+1.12.2 - 2015-10-15
+- removing support for cal coefficients from the SHM-Link 2.
+
+-------------------------------------------------------------------------
+1.12.1 - 2015-10-15
+- updated SHM-Link 2 features to not support limited duration (sweeps).
+
+-------------------------------------------------------------------------
+1.12.0 - 2015-10-15
+- added NodeFeatures::supportsLimitedDuration for checking which Nodes only support unlimited sampling (no sweeps).
+- don't allow a value other than true to be set for unlimited duration if Node doesn't support disabling it.
+- don't allow reading or writing the number of sweeps if the node only supports unlimited sampling.
+- NodeFeatures minSweeps and maxSweeps functions return 0 if the node only supports unlimited sampling.
+- added sleep and up to 5 attempted pings after performing the BaseStation cycle power command.
+- added sleep after performing the BaseStation reset radio command.
+- added sleep and up to 5 attempted pings after performing the WirelessNode cycle power command.
+- added sleep after performing the WirelessNode reset radio command.
+- writing a disabled value of 0xFFFF to the channel value for analog base stations if set to 0xFF.
+
+-------------------------------------------------------------------------
+1.11.4 - 2015-10-14
+- updated to changes made to auto balance 2 packet.
+- changed WirelessNode::autoBalance command to take a float percentage range.
+- changed AutoBalanceResult to have percent achieved instead of the channel sample value.
+- removed resolution from all of the channels as the new autobalance made it unnecessary.
+
+-------------------------------------------------------------------------
+1.11.3 - 2015-10-13
+- updated auto balance 2 command id.
+- fix for cycle power on the base station failing if haven't determined protocol version.
+- resetting the radio or cycling power when writing base eeproms (depending on firmware version).
+- cycling the power on nodes when committing eeproms (instead of resetting radio).
+
+-------------------------------------------------------------------------
+1.11.2 - 2015-10-13
+- made AutoBalanceResult functions const.
+
+-------------------------------------------------------------------------
+1.11.1 - 2015-10-13
+- fix for WirelessNode::autobalance not returning the AutoBalanceResult.
+
+-------------------------------------------------------------------------
+1.11.0 - 2015-10-13
+- support for old and new auto balance commands.
+- old auto balance command now performs a hardware offset eeprom read.
+- old auto balance command now performs a read single sensor to get the channel value.
+- moved AutoCalResult to its own file.
+- moved AutoBalanceResult to its own file.
+
+-------------------------------------------------------------------------
+1.10.1 - 2015-10-12
+- changed WirelessNode's autobalance function to take a ChannelMask instead of a channel number.
+- added method to get the resolution from each WirelessChannel object.
+- adding start of the AutoBalance_v2 command (not fully functional).
+
+-------------------------------------------------------------------------
+1.10.0 - 2015-10-09
+- added supportsLostBeaconTimeout() to the NodeFeatures class.
+
+-------------------------------------------------------------------------
+1.9.2 - 2015-10-06
+- fix for mV/V-Link having incorrect model number.
+
+-------------------------------------------------------------------------
+1.9.1 - 2015-10-05
+- added support for Wireless Nodes and BaseStations supporting new transmit powers.
+
-------------------------------------------------------------------------
1.9.0 - 2015-10-02
- added support for the mV/V-Link Wireless Node.
@@ -1002,7 +1151,7 @@ All notable changes to this project will be documented in this file.
-------------------------------------------------------------------------
0.4.0 2013-12-17
-- Switched from boost::any to my own customer any class (similar to boost::spirit::hold_any) to improve performance [internal].
+- Switched from boost::any to my own custom any class (similar to boost::spirit::hold_any) to improve performance [internal].
- Beginning of support for the SyncSamplingNetwork for creating and starting a Synchronized Sampling network.
- Support for GetDeviceInfo and GetDeviceDescriptorSets for Inertial nodes [internal].
- Added InertialNode.info() to get information about the InertialNode.
diff --git a/MSCL/Jamfile b/MSCL/Jamfile
index bb5a272b4..26ee5f87a 100644
--- a/MSCL/Jamfile
+++ b/MSCL/Jamfile
@@ -38,6 +38,7 @@ alias msclSrcs
[ glob source/mscl/MicroStrain/*.cpp ]
[ glob source/mscl/MicroStrain/Inertial/*.cpp ]
[ glob source/mscl/MicroStrain/Inertial/Commands/*.cpp ]
+ [ glob source/mscl/MicroStrain/Inertial/Features/*.cpp ]
[ glob source/mscl/MicroStrain/Inertial/Packets/*.cpp ]
[ glob source/mscl/MicroStrain/Wireless/*.cpp ]
[ glob source/mscl/MicroStrain/Wireless/Commands/*.cpp ]
diff --git a/MSCL/MSCL.vcxproj b/MSCL/MSCL.vcxproj
index 29cb909e9..cae2c0fa1 100644
--- a/MSCL/MSCL.vcxproj
+++ b/MSCL/MSCL.vcxproj
@@ -655,6 +655,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -672,6 +686,7 @@
+
@@ -680,7 +695,10 @@
+
+
+
@@ -690,8 +708,10 @@
+
+
@@ -699,6 +719,7 @@
+
@@ -735,6 +756,7 @@
+
@@ -800,6 +822,7 @@
+
@@ -847,6 +870,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -864,6 +901,7 @@
+
@@ -872,7 +910,10 @@
+
+
+
@@ -882,8 +923,10 @@
+
+
@@ -891,6 +934,7 @@
+
@@ -927,6 +971,7 @@
+
@@ -991,6 +1036,7 @@
+
diff --git a/MSCL/MSCL.vcxproj.filters b/MSCL/MSCL.vcxproj.filters
index ad6a54011..5722d2b17 100644
--- a/MSCL/MSCL.vcxproj.filters
+++ b/MSCL/MSCL.vcxproj.filters
@@ -43,6 +43,9 @@
{cecc2ab0-4168-4af7-b457-e8c1e4555354}
+
+ {7096baca-9884-49f7-87b9-4807409caabc}
+
@@ -581,6 +584,75 @@
MicroStrain\Wireless\Features\Nodes
+
+ MicroStrain\Wireless\Commands
+
+
+ MicroStrain\Wireless\Commands
+
+
+ MicroStrain\Wireless\Commands
+
+
+ MicroStrain\Wireless\Commands
+
+
+ Utils
+
+
+ MicroStrain\Inertial
+
+
+ MicroStrain\Inertial
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Wireless\Configuration
+
+
+ MicroStrain\Wireless\Features\Nodes
+
+
+ MicroStrain\Wireless\Commands
+
@@ -1091,6 +1163,75 @@
MicroStrain\Wireless\Features\Nodes
+
+ MicroStrain\Wireless\Commands
+
+
+ MicroStrain\Wireless\Commands
+
+
+ MicroStrain\Wireless\Commands
+
+
+ MicroStrain\Wireless\Commands
+
+
+ Utils
+
+
+ MicroStrain\Inertial
+
+
+ MicroStrain\Inertial
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Inertial\Features
+
+
+ MicroStrain\Wireless\Configuration
+
+
+ MicroStrain\Wireless\Features\Nodes
+
+
+ MicroStrain\Wireless\Commands
+
diff --git a/MSCL/source/mscl/LibVersion.h b/MSCL/source/mscl/LibVersion.h
index 311ea7ccb..527877ffe 100644
--- a/MSCL/source/mscl/LibVersion.h
+++ b/MSCL/source/mscl/LibVersion.h
@@ -12,8 +12,8 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#ifndef SWIG
//update with each release
#define MSCL_MAJOR 1
-#define MSCL_MINOR 9
-#define MSCL_PATCH 0
+#define MSCL_MINOR 20
+#define MSCL_PATCH 1
#endif
namespace mscl
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.cpp
index 05fb52c65..c1db39e6a 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.cpp
@@ -91,7 +91,7 @@ namespace mscl
return GenericInertialCommand::Response::match_data(field);
}
- bool ContinuousDataStream::Response::parseData(const GenericInertialCommandResponse& response) const
+ bool ContinuousDataStream::Response::parseResponse(const GenericInertialCommandResponse& response) const
{
return Inertial_Commands::parseData_ContinuousDataStream(response);
}
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.h
index cd99ecb52..9ccd778e0 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/ContinuousDataStream.h
@@ -86,7 +86,7 @@ namespace mscl
// true if the field matches the expected data, false if it does not.
virtual bool match_data(const InertialDataField& field) override;
- //Function: parseData
+ //Function: parseResponse
// Parses a successfully matched response for the ContinuousDataStream command.
//
//Parameters:
@@ -94,7 +94,7 @@ namespace mscl
//
//Returns:
// true if the data stream is enabled, false if it is disabled.
- bool parseData(const GenericInertialCommandResponse& response) const;
+ bool parseResponse(const GenericInertialCommandResponse& response) const;
};
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.cpp
index f9dc9275e..68c9a63cb 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.cpp
@@ -8,6 +8,8 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#include "Inertial_Commands.h"
#include "mscl/Utils.h"
#include "mscl/Exceptions.h"
+#include "mscl/MicroStrain/Inertial/EulerAngles.h"
+#include "mscl/MicroStrain/Inertial/PositionOffset.h"
namespace mscl
{
@@ -23,7 +25,7 @@ namespace mscl
GenericInertialCommand::Response(collector, true, true, "Get Estimation Filter Data Rate Base")
{}
- uint16 GetEstFilterDataRateBase::Response::parseData(const GenericInertialCommandResponse& response) const
+ uint16 GetEstFilterDataRateBase::Response::parseResponse(const GenericInertialCommandResponse& response) const
{
return Inertial_Commands::parseData_DataRateBase(response);
}
@@ -82,9 +84,135 @@ namespace mscl
GenericInertialCommand::Response(collector, true, dataResponse, "Estimation Filter Message Format")
{}
- InertialChannels EstFilterMessageFormat::Response::parseData(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const
+ InertialChannels EstFilterMessageFormat::Response::parseResponse(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const
{
return Inertial_Commands::parseData_MessageFormat(response, fieldDataByte(), sampleRateBase);
}
//==========================================================================================
+
+ //==========================================================================================
+ //Sensor to Vehicle Frame Transformation
+ ByteStream SensorToVehicFrameTrans::buildCommand_get()
+ {
+ //container to hold the command's field data
+ ByteStream fieldData;
+
+ //add the command selector byte
+ fieldData.append_uint8(static_cast(Inertial_Commands::cmd_getCurrent));
+
+ //build and return the command bytes
+ return GenericInertialCommand::buildCommand(CMD_ID, fieldData.data());
+ }
+
+ ByteStream SensorToVehicFrameTrans::buildCommand_set(const EulerAngles& angles)
+ {
+ //container to hold the command's field data
+ ByteStream fieldData;
+
+ //add the command selector byte
+ fieldData.append_uint8(static_cast(Inertial_Commands::cmd_setCurrent));
+
+ //add the roll, pitch, yaw data
+ fieldData.append_float(angles.roll());
+ fieldData.append_float(angles.pitch());
+ fieldData.append_float(angles.yaw());
+
+ //build and return the command bytes
+ return GenericInertialCommand::buildCommand(CMD_ID, fieldData.data());
+ }
+
+ SensorToVehicFrameTrans::Response::Response(std::weak_ptr collector, bool dataResponse):
+ GenericInertialCommand::Response(collector, true, dataResponse, "Sensor to Vehicle Frame Transformation")
+ {
+ }
+
+ EulerAngles SensorToVehicFrameTrans::Response::parseResponse(const GenericInertialCommandResponse& response) const
+ {
+ return Inertial_Commands::parseData_EulerAngles(response);
+ }
+ //==========================================================================================
+
+ //==========================================================================================
+ //Sensor to Vehicle Frame Offset
+ ByteStream SensorToVehicFrameOffset::buildCommand_get()
+ {
+ //container to hold the command's field data
+ ByteStream fieldData;
+
+ //add the command selector byte
+ fieldData.append_uint8(static_cast(Inertial_Commands::cmd_getCurrent));
+
+ //build and return the command bytes
+ return GenericInertialCommand::buildCommand(CMD_ID, fieldData.data());
+ }
+
+ ByteStream SensorToVehicFrameOffset::buildCommand_set(const PositionOffset& offset)
+ {
+ //container to hold the command's field data
+ ByteStream fieldData;
+
+ //add the command selector byte
+ fieldData.append_uint8(static_cast(Inertial_Commands::cmd_setCurrent));
+
+ //add the x, y, z data
+ fieldData.append_float(offset.x());
+ fieldData.append_float(offset.y());
+ fieldData.append_float(offset.z());
+
+ //build and return the command bytes
+ return GenericInertialCommand::buildCommand(CMD_ID, fieldData.data());
+ }
+
+ SensorToVehicFrameOffset::Response::Response(std::weak_ptr collector, bool dataResponse):
+ GenericInertialCommand::Response(collector, true, dataResponse, "Sensor to Vehicle Frame Offset")
+ {
+ }
+
+ PositionOffset SensorToVehicFrameOffset::Response::parseResponse(const GenericInertialCommandResponse& response) const
+ {
+ return Inertial_Commands::parseData_PositionOffset(response);
+ }
+ //==========================================================================================
+
+ //==========================================================================================
+ //Antenna Offset
+ ByteStream AntennaOffset::buildCommand_get()
+ {
+ //container to hold the command's field data
+ ByteStream fieldData;
+
+ //add the command selector byte
+ fieldData.append_uint8(static_cast(Inertial_Commands::cmd_getCurrent));
+
+ //build and return the command bytes
+ return GenericInertialCommand::buildCommand(CMD_ID, fieldData.data());
+ }
+
+ ByteStream AntennaOffset::buildCommand_set(const PositionOffset& offset)
+ {
+ //container to hold the command's field data
+ ByteStream fieldData;
+
+ //add the command selector byte
+ fieldData.append_uint8(static_cast(Inertial_Commands::cmd_setCurrent));
+
+ //add the x, y, z data
+ fieldData.append_float(offset.x());
+ fieldData.append_float(offset.y());
+ fieldData.append_float(offset.z());
+
+ //build and return the command bytes
+ return GenericInertialCommand::buildCommand(CMD_ID, fieldData.data());
+ }
+
+ AntennaOffset::Response::Response(std::weak_ptr collector, bool dataResponse):
+ GenericInertialCommand::Response(collector, true, dataResponse, "Antenna Offset")
+ {
+ }
+
+ PositionOffset AntennaOffset::Response::parseResponse(const GenericInertialCommandResponse& response) const
+ {
+ return Inertial_Commands::parseData_PositionOffset(response);
+ }
+ //==========================================================================================
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.h
index f064a522c..6194dc08d 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/EstFilter_Commands.h
@@ -12,6 +12,10 @@ namespace mscl
{
//Title: EstFilter_Commands
+ //forward declarations
+ class EulerAngles;
+ class PositionOffset;
+
//Class: GetEstFilterDataRateBase
// Contains the logic for the "Get Estimation Filter Data Rate Base" command
class GetEstFilterDataRateBase
@@ -55,7 +59,7 @@ namespace mscl
// Creates the Response object
Response(std::weak_ptr collector);
- //Function: parseData
+ //Function: parseResponse
// Parses the response, getting the data rate base result
//
//Parameters:
@@ -63,7 +67,7 @@ namespace mscl
//
//Returns:
// The data rate base result
- uint16 parseData(const GenericInertialCommandResponse& response) const;
+ uint16 parseResponse(const GenericInertialCommandResponse& response) const;
};
};
@@ -111,7 +115,121 @@ namespace mscl
public:
Response(std::weak_ptr collector, bool dataResponse);
- InertialChannels parseData(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const;
+ InertialChannels parseResponse(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const;
+ };
+ };
+
+ //Class: SensorToVehicFrameTrans
+ // Contains the logic for the "Sensor to Vehicle Frame Transformation" command
+ class SensorToVehicFrameTrans
+ {
+ public:
+ //Constants: Packet Bytes
+ // CMD_ID - CMD_EF_SENS_VEHIC_FRAME_TRANS - The for this command
+ // FIELD_DATA_BYTE - 0x81 - The Data Field Descriptor byte
+ static const InertialTypes::Command CMD_ID = InertialTypes::CMD_EF_SENS_VEHIC_FRAME_TRANS;
+ static const uint8 FIELD_DATA_BYTE = 0x81;
+
+ private:
+ SensorToVehicFrameTrans(); //disabled default constructor
+
+ public:
+ //Function: buildCommand_get
+ // Builds the bytes for the "get" command.
+ static ByteStream buildCommand_get();
+
+ //Function: buildCommand_set
+ // Builds the bytes for the "set" command.
+ //
+ //Parameters:
+ // angles- The containing the roll, pitch, and yaw (in radians).
+ static ByteStream buildCommand_set(const EulerAngles& angles);
+
+ class Response: public GenericInertialCommand::Response
+ {
+ protected:
+ virtual InertialTypes::Command commandId() const { return CMD_ID; }
+ virtual uint8 fieldDataByte() const { return FIELD_DATA_BYTE; }
+
+ public:
+ Response(std::weak_ptr collector, bool dataResponse);
+ EulerAngles parseResponse(const GenericInertialCommandResponse& response) const;
+ };
+ };
+
+ //Class: SensorToVehicFrameOffset
+ // Contains the logic for the "Sensor to Vehicle Frame Offset" command
+ class SensorToVehicFrameOffset
+ {
+ public:
+ //Constants: Packet Bytes
+ // CMD_ID - CMD_EF_SENS_VEHIC_FRAME_OFFSET - The for this command
+ // FIELD_DATA_BYTE - 0x82 - The Data Field Descriptor byte
+ static const InertialTypes::Command CMD_ID = InertialTypes::CMD_EF_SENS_VEHIC_FRAME_OFFSET;
+ static const uint8 FIELD_DATA_BYTE = 0x82;
+
+ private:
+ SensorToVehicFrameOffset(); //disabled default constructor
+
+ public:
+ //Function: buildCommand_get
+ // Builds the bytes for the "get" command.
+ static ByteStream buildCommand_get();
+
+ //Function: buildCommand_set
+ // Builds the bytes for the "set" command.
+ //
+ //Parameters:
+ // offset - The in meters.
+ static ByteStream buildCommand_set(const PositionOffset& offset);
+
+ class Response: public GenericInertialCommand::Response
+ {
+ protected:
+ virtual InertialTypes::Command commandId() const { return CMD_ID; }
+ virtual uint8 fieldDataByte() const { return FIELD_DATA_BYTE; }
+
+ public:
+ Response(std::weak_ptr collector, bool dataResponse);
+ PositionOffset parseResponse(const GenericInertialCommandResponse& response) const;
+ };
+ };
+
+ //Class: AntennaOffset
+ // Contains the logic for the "Antenna Offset" command
+ class AntennaOffset
+ {
+ public:
+ //Constants: Packet Bytes
+ // CMD_ID - CMD_EF_ANTENNA_OFFSET - The for this command
+ // FIELD_DATA_BYTE - 0x83 - The Data Field Descriptor byte
+ static const InertialTypes::Command CMD_ID = InertialTypes::CMD_EF_ANTENNA_OFFSET;
+ static const uint8 FIELD_DATA_BYTE = 0x83;
+
+ private:
+ AntennaOffset(); //disabled default constructor
+
+ public:
+ //Function: buildCommand_get
+ // Builds the bytes for the "get" command.
+ static ByteStream buildCommand_get();
+
+ //Function: buildCommand_set
+ // Builds the bytes for the "set" command.
+ //
+ //Parameters:
+ // offset - The in meters.
+ static ByteStream buildCommand_set(const PositionOffset& offset);
+
+ class Response: public GenericInertialCommand::Response
+ {
+ protected:
+ virtual InertialTypes::Command commandId() const { return CMD_ID; }
+ virtual uint8 fieldDataByte() const { return FIELD_DATA_BYTE; }
+
+ public:
+ Response(std::weak_ptr collector, bool dataResponse);
+ PositionOffset parseResponse(const GenericInertialCommandResponse& response) const;
};
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.cpp
index 0b5727881..aeb8e2486 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.cpp
@@ -22,7 +22,7 @@ namespace mscl
GenericInertialCommand::Response(collector, true, true, "Get GPS Data Rate Base")
{}
- uint16 GetGpsDataRateBase::Response::parseData(const GenericInertialCommandResponse& response) const
+ uint16 GetGpsDataRateBase::Response::parseResponse(const GenericInertialCommandResponse& response) const
{
return Inertial_Commands::parseData_DataRateBase(response);
}
@@ -80,7 +80,7 @@ namespace mscl
GenericInertialCommand::Response(collector, true, dataResponse, "GPS Message Format")
{}
- InertialChannels GpsMessageFormat::Response::parseData(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const
+ InertialChannels GpsMessageFormat::Response::parseResponse(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const
{
return Inertial_Commands::parseData_MessageFormat(response, fieldDataByte(), sampleRateBase);
}
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.h
index a063b86a9..c987b5e33 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GPS_Commands.h
@@ -55,7 +55,7 @@ namespace mscl
// Creates the Response object
Response(std::weak_ptr collector);
- //Function: parseData
+ //Function: parseResponse
// Parses the response, getting the data rate base result
//
//Parameters:
@@ -63,7 +63,7 @@ namespace mscl
//
//Returns:
// The data rate base result
- uint16 parseData(const GenericInertialCommandResponse& response) const;
+ uint16 parseResponse(const GenericInertialCommandResponse& response) const;
};
};
@@ -111,7 +111,7 @@ namespace mscl
public:
Response(std::weak_ptr collector, bool dataResponse);
- InertialChannels parseData(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const;
+ InertialChannels parseResponse(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const;
};
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.cpp
index 1e287e862..453b9f57a 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.cpp
@@ -47,7 +47,7 @@ namespace mscl
return GenericInertialCommand::Response::match_data(field);
}
- std::vector GetDeviceDescriptorSets::Response::parseData(const GenericInertialCommandResponse& response) const
+ std::vector GetDeviceDescriptorSets::Response::parseResponse(const GenericInertialCommandResponse& response) const
{
std::vector result;
Inertial_Commands::parseData_GetDeviceDescriptorSets(response, result);
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.h
index 0230c4fcd..a632f7ae3 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceDescriptorSets.h
@@ -55,7 +55,7 @@ namespace mscl
// true if the field matches the expected data, false if it does not.
virtual bool match_data(const InertialDataField& field) override;
- //Function: parseData
+ //Function: parseResponse
// Parses a successfully matched response for the GetDeviceDescriptorSets command.
//
//Parameters:
@@ -63,7 +63,7 @@ namespace mscl
//
//Returns:
// The descriptor sets parsed from the response.
- std::vector parseData(const GenericInertialCommandResponse& response) const;
+ std::vector parseResponse(const GenericInertialCommandResponse& response) const;
};
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.cpp
index 7dbf1ccd0..0cfbff57f 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.cpp
@@ -47,7 +47,7 @@ namespace mscl
return GenericInertialCommand::Response::match_data(field);
}
- InertialDeviceInfo GetDeviceInfo::Response::parseData(const GenericInertialCommandResponse& response) const
+ InertialDeviceInfo GetDeviceInfo::Response::parseResponse(const GenericInertialCommandResponse& response) const
{
InertialDeviceInfo result;
Inertial_Commands::parseData_GetDeviceInfo(response, result);
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.h
index f66e1748a..5d771ff85 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GetDeviceInfo.h
@@ -91,7 +91,7 @@ namespace mscl
// true if the field matches the expected data, false if it does not.
virtual bool match_data(const InertialDataField& field) override;
- //Function: parseData
+ //Function: parseResponse
// Parses a successfully matched response for the GetDeviceInfo command.
//
//Parameters:
@@ -99,7 +99,7 @@ namespace mscl
//
//Returns:
// The GetDeviceInfoResponse parsed from the response.
- InertialDeviceInfo parseData(const GenericInertialCommandResponse& response) const;
+ InertialDeviceInfo parseResponse(const GenericInertialCommandResponse& response) const;
};
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.cpp
index fad5b7313..6719e632e 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.cpp
@@ -115,4 +115,34 @@ namespace mscl
//return true if enabled, false if disabled
return (response.data().read_uint8(1) == 1); //Note: position 0 is the device selector, which can be ignored here.
}
+
+ EulerAngles Inertial_Commands::parseData_EulerAngles(const GenericInertialCommandResponse& response)
+ {
+ //use a DataBuffer to make reading nicer
+ DataBuffer db(response.data());
+
+ //read the euler angles and store in the result
+ float roll = db.read_float();
+ float pitch = db.read_float();
+ float yaw = db.read_float();
+
+ EulerAngles result(roll, pitch, yaw);
+
+ return result;
+ }
+
+ PositionOffset Inertial_Commands::parseData_PositionOffset(const GenericInertialCommandResponse& response)
+ {
+ //use a DataBuffer to make reading nicer
+ DataBuffer db(response.data());
+
+ //read the euler angles and store in the result
+ float x = db.read_float();
+ float y = db.read_float();
+ float z = db.read_float();
+
+ PositionOffset result(x, y, z);
+
+ return result;
+ }
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.h
index 29104f39d..37130a186 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Inertial_Commands.h
@@ -6,8 +6,10 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#pragma once
#include "GenericInertialCommand.h"
+#include "mscl/MicroStrain/Inertial/EulerAngles.h"
#include "mscl/MicroStrain/Inertial/InertialChannel.h"
#include "mscl/MicroStrain/Inertial/InertialTypes.h"
+#include "mscl/MicroStrain/Inertial/PositionOffset.h"
#include "GetDeviceInfo.h"
namespace mscl
@@ -92,5 +94,25 @@ namespace mscl
//Returns:
// true if the data stream is enabled, false if it is disabled.
static bool parseData_ContinuousDataStream(const GenericInertialCommandResponse& response);
+
+ //Function: parseData_EulerAngles
+ // Parses the data from a command response containing just 3 Euler Angles (roll, pitch, yaw).
+ //
+ //Parameters:
+ // response - The that contains the data to be parsed
+ //
+ //Returns:
+ // The containing the result that is parsed.
+ static EulerAngles parseData_EulerAngles(const GenericInertialCommandResponse& response);
+
+ //Function: parseData_PositionOffset
+ // Parses the data from a command response containing just 3 Position Offset values (x, y, z).
+ //
+ //Parameters:
+ // response - The that contains the data to be parsed
+ //
+ //Returns:
+ // The containing the result that is parsed.
+ static PositionOffset parseData_PositionOffset(const GenericInertialCommandResponse& response);
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.cpp
index 398b57e5d..69c0eb8fb 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.cpp
@@ -24,7 +24,7 @@ namespace mscl
GenericInertialCommand::Response(collector, true, true, "Get Sensor Data Rate Base")
{}
- uint16 GetSensorDataRateBase::Response::parseData(const GenericInertialCommandResponse& response) const
+ uint16 GetSensorDataRateBase::Response::parseResponse(const GenericInertialCommandResponse& response) const
{
return Inertial_Commands::parseData_DataRateBase(response);
}
@@ -83,7 +83,7 @@ namespace mscl
GenericInertialCommand::Response(collector, true, dataResponse, "Sensor Message Format")
{}
- InertialChannels SensorMessageFormat::Response::parseData(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const
+ InertialChannels SensorMessageFormat::Response::parseResponse(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const
{
return Inertial_Commands::parseData_MessageFormat(response, fieldDataByte(), sampleRateBase);
}
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.h
index ff73438c9..eb6a889f2 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/Sensor_Commands.h
@@ -55,7 +55,7 @@ namespace mscl
// Creates the Response object
Response(std::weak_ptr collector);
- //Function: parseData
+ //Function: parseResponse
// Parses the response, getting the data rate base result
//
//Parameters:
@@ -63,7 +63,7 @@ namespace mscl
//
//Returns:
// The data rate base result
- uint16 parseData(const GenericInertialCommandResponse& response) const;
+ uint16 parseResponse(const GenericInertialCommandResponse& response) const;
};
};
@@ -112,7 +112,7 @@ namespace mscl
public:
Response(std::weak_ptr collector, bool dataResponse);
- InertialChannels parseData(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const;
+ InertialChannels parseResponse(const GenericInertialCommandResponse& response, uint16 sampleRateBase) const;
};
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp
index 1ef9038fc..fd45b2f14 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp
@@ -45,7 +45,7 @@ namespace mscl
GenericInertialCommand::Response(collector, true, dataResponse, "Communication Mode")
{}
- uint8 CommunicationMode::Response::parseData(const GenericInertialCommandResponse& response) const
+ uint8 CommunicationMode::Response::parseResponse(const GenericInertialCommandResponse& response) const
{
return Inertial_Commands::parseData_CommunicationMode(response);
}
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h
index effd54b6c..fe17ee68e 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h
@@ -58,7 +58,7 @@ namespace mscl
public:
Response(std::weak_ptr collector, bool dataResponse);
- uint8 parseData(const GenericInertialCommandResponse& response) const;
+ uint8 parseResponse(const GenericInertialCommandResponse& response) const;
};
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.cpp b/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.cpp
new file mode 100644
index 000000000..06bbcb42f
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.cpp
@@ -0,0 +1,40 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+
+#include "EulerAngles.h"
+
+namespace mscl
+{
+ EulerAngles::EulerAngles():
+ m_roll(0.0f),
+ m_pitch(0.0f),
+ m_yaw(0.0f)
+ {
+ }
+
+ EulerAngles::EulerAngles(float roll, float pitch, float yaw):
+ m_roll(roll),
+ m_pitch(pitch),
+ m_yaw(yaw)
+ {
+ }
+
+ float EulerAngles::roll() const
+ {
+ return m_roll;
+ }
+
+ float EulerAngles::pitch() const
+ {
+ return m_pitch;
+ }
+
+ float EulerAngles::yaw() const
+ {
+ return m_yaw;
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.h b/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.h
new file mode 100644
index 000000000..dfc88c222
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.h
@@ -0,0 +1,56 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+//PUBLIC_HEADER
+#pragma once
+
+namespace mscl
+{
+ //API Class: EulerAngles
+ // Represents generic Euler Angles (roll, pitch, yaw).
+ class EulerAngles
+ {
+ private:
+ //Variable: m_roll;
+ // The roll value.
+ float m_roll;
+
+ //Variable: m_pitch
+ // The pitch value.
+ float m_pitch;
+
+ //Variable: m_yaw
+ // The yaw value.
+ float m_yaw;
+
+ public:
+ EulerAngles();
+
+ //API Constructor: EulerAngles
+ // Creates an EulerAngles object.
+ EulerAngles(float roll, float pitch, float yaw);
+
+ //API Function: roll
+ // Gets the roll angle.
+ //
+ //Returns:
+ // The roll Euler Angle.
+ float roll() const;
+
+ //API Function: pitch
+ // Gets the pitch angle.
+ //
+ //Returns:
+ // The pitch Euler Angle.
+ float pitch() const;
+
+ //API Function: yaw
+ // Gets the yaw angle.
+ //
+ //Returns:
+ // The yaw Euler Angle.
+ float yaw() const;
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures.cpp
new file mode 100644
index 000000000..569f6b48b
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures.cpp
@@ -0,0 +1,77 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+
+#include
+#include
+
+#include "InertialNodeFeatures.h"
+#include "InertialNodeFeatures_3dm.h"
+#include "InertialNodeFeatures_3dm_gx2.h"
+#include "InertialNodeFeatures_3dm_dh3.h"
+#include "InertialNodeFeatures_3dm_gx3_15.h"
+#include "InertialNodeFeatures_3dm_gx3_25.h"
+#include "InertialNodeFeatures_3dm_gx3_35.h"
+#include "InertialNodeFeatures_3dm_gx3_45.h"
+#include "InertialNodeFeatures_3dm_gx4_15.h"
+#include "InertialNodeFeatures_3dm_gx4_25.h"
+#include "InertialNodeFeatures_3dm_gx4_45.h"
+#include "InertialNodeFeatures_3dm_rq1_45.h"
+#include "InertialNodeFeatures_fasA.h"
+
+namespace mscl
+{
+ InertialNodeFeatures::InertialNodeFeatures(const InertialNodeInfo& info):
+ m_nodeInfo(info)
+ {
+ }
+
+ std::unique_ptr InertialNodeFeatures::create(const InertialNodeInfo& info)
+ {
+ switch(info.model())
+ {
+ case InertialModels::node_3dm:
+ return std::unique_ptr(new InertialNodeFeatures_3dm(info));
+
+ case InertialModels::node_fasA:
+ return std::unique_ptr(new InertialNodeFeatures_fasA(info));
+
+ case InertialModels::node_3dm_gx2:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx2(info));
+
+ case InertialModels::node_3dm_dh3:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_dh3(info));
+
+ case InertialModels::node_3dm_gx3_15:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx3_15(info));
+
+ case InertialModels::node_3dm_gx3_25:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx3_25(info));
+
+ case InertialModels::node_3dm_gx3_35:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx3_35(info));
+
+ case InertialModels::node_3dm_gx3_45:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx3_45(info));
+
+ case InertialModels::node_3dm_gx4_15:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx4_15(info));
+
+ case InertialModels::node_3dm_gx4_25:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx4_25(info));
+
+ case InertialModels::node_3dm_gx4_45:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_gx4_45(info));
+
+ case InertialModels::node_3dm_rq1_45:
+ return std::unique_ptr(new InertialNodeFeatures_3dm_rq1_45(info));
+
+ default:
+ //we don't know anything about this node, throw an exception
+ throw Error_NotSupported("The Inertial Node model (" + Utils::toStr(info.model()) + ", " + info.modelName() + " ) is not supported by MSCL.");
+ }
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures.h
new file mode 100644
index 000000000..bb8259419
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures.h
@@ -0,0 +1,55 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+//PUBLIC_HEADER
+#pragma once
+
+#include
+
+#include "mscl/MicroStrain/Inertial/InertialNodeInfo.h"
+
+namespace mscl
+{
+ //API Class: InertialNodeFeatures
+ // Contains information on which features are supported by an .
+ class InertialNodeFeatures
+ {
+ private:
+ InertialNodeFeatures(); //disabled default constructor
+ InertialNodeFeatures(const InertialNodeFeatures&); //disabled copy constructor
+ InertialNodeFeatures& operator=(const InertialNodeFeatures&); //disable assignment operator
+
+ public:
+ virtual ~InertialNodeFeatures() {};
+
+ protected:
+ //Constructor: InertialNodeFeatures
+ // Creates a InertialNodeFeatures object.
+ //
+ //Parameters:
+ // info - An object representing standard information of the .
+ InertialNodeFeatures(const InertialNodeInfo& info);
+
+ //Variable: m_nodeInfo
+ // The object containing basic information retreived from eeprom about the .
+ InertialNodeInfo m_nodeInfo;
+
+ public:
+#ifndef SWIG
+ //Function: create
+ // Builds and returns a InertialNodeFeatures pointer based on the given parameters.
+ //
+ //Parameters:
+ // info - An object representing standard information of the device.
+ //
+ //Returns:
+ // An InertialNodeFeatures unique_ptr.
+ //
+ //Exceptions:
+ // - : The Node model is not supported by MSCL.
+ static std::unique_ptr create(const InertialNodeInfo& info);
+#endif
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm.cpp
new file mode 100644
index 000000000..be92cd846
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm::InertialNodeFeatures_3dm(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm.h
new file mode 100644
index 000000000..f8c0d659c
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm
+ // Contains information on features for the 3DM Node. Inherits from .
+ class InertialNodeFeatures_3dm: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm() {};
+
+ //Constructor: InertialNodeFeatures_3dm
+ // Creates a InertialNodeFeatures_3dm object.
+ InertialNodeFeatures_3dm(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_dh3.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_dh3.cpp
new file mode 100644
index 000000000..9add0b958
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_dh3.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_dh3.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_dh3::InertialNodeFeatures_3dm_dh3(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_dh3.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_dh3.h
new file mode 100644
index 000000000..66347dd83
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_dh3.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_dh3
+ // Contains information on features for the 3DM-DH3 Node. Inherits from .
+ class InertialNodeFeatures_3dm_dh3: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_dh3() {};
+
+ //Constructor: InertialNodeFeatures_3dm_dh3
+ // Creates a InertialNodeFeatures_3dm_dh3 object.
+ InertialNodeFeatures_3dm_dh3(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx2.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx2.cpp
new file mode 100644
index 000000000..f0c944c2f
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx2.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx2.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx2::InertialNodeFeatures_3dm_gx2(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx2.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx2.h
new file mode 100644
index 000000000..e5c965372
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx2.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx2
+ // Contains information on features for the 3DM-GX2 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx2: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx2() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx2
+ // Creates a InertialNodeFeatures_3dm_gx2 object.
+ InertialNodeFeatures_3dm_gx2(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_15.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_15.cpp
new file mode 100644
index 000000000..580fd1619
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_15.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx3_15.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx3_15::InertialNodeFeatures_3dm_gx3_15(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_15.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_15.h
new file mode 100644
index 000000000..791c91366
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_15.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx3_15
+ // Contains information on features for the 3DM-GX3-15 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx3_15: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx3_15() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx3_15
+ // Creates a InertialNodeFeatures_3dm_gx3_15 object.
+ InertialNodeFeatures_3dm_gx3_15(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_25.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_25.cpp
new file mode 100644
index 000000000..49b19ac81
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_25.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx3_25.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx3_25::InertialNodeFeatures_3dm_gx3_25(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_25.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_25.h
new file mode 100644
index 000000000..6c26e3aae
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_25.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx3_25
+ // Contains information on features for the 3DM-GX3-25 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx3_25: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx3_25() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx3_25
+ // Creates a InertialNodeFeatures_3dm_gx3_25 object.
+ InertialNodeFeatures_3dm_gx3_25(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_35.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_35.cpp
new file mode 100644
index 000000000..fabb2c1aa
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_35.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx3_35.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx3_35::InertialNodeFeatures_3dm_gx3_35(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_35.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_35.h
new file mode 100644
index 000000000..d7b8ab45c
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_35.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx3_35
+ // Contains information on features for the 3DM-GX3-35 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx3_35: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx3_35() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx3_35
+ // Creates a InertialNodeFeatures_3dm_gx3_35 object.
+ InertialNodeFeatures_3dm_gx3_35(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_45.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_45.cpp
new file mode 100644
index 000000000..5d393e945
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_45.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx3_45.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx3_45::InertialNodeFeatures_3dm_gx3_45(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_45.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_45.h
new file mode 100644
index 000000000..e7124bf89
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx3_45.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx3_45
+ // Contains information on features for the 3DM-GX3-45 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx3_45: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx3_45() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx3_45
+ // Creates a InertialNodeFeatures_3dm_gx3_45 object.
+ InertialNodeFeatures_3dm_gx3_45(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_15.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_15.cpp
new file mode 100644
index 000000000..0fcef6402
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_15.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx4_15.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx4_15::InertialNodeFeatures_3dm_gx4_15(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_15.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_15.h
new file mode 100644
index 000000000..66c78fb91
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_15.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx4_15
+ // Contains information on features for the 3DM-GX4-15 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx4_15: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx4_15() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx4_15
+ // Creates a InertialNodeFeatures_3dm_gx4_15 object.
+ InertialNodeFeatures_3dm_gx4_15(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_25.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_25.cpp
new file mode 100644
index 000000000..50aaa9c13
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_25.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx4_25.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx4_25::InertialNodeFeatures_3dm_gx4_25(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_25.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_25.h
new file mode 100644
index 000000000..7d0b13903
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_25.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx4_25
+ // Contains information on features for the 3DM-GX4-25 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx4_25: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx4_25() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx4_25
+ // Creates a InertialNodeFeatures_3dm_gx4_25 object.
+ InertialNodeFeatures_3dm_gx4_25(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_45.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_45.cpp
new file mode 100644
index 000000000..204b81e0c
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_45.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_gx4_45.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_gx4_45::InertialNodeFeatures_3dm_gx4_45(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_45.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_45.h
new file mode 100644
index 000000000..a75a2bdef
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_gx4_45.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_gx4_45
+ // Contains information on features for the 3DM-GX4-45 Node. Inherits from .
+ class InertialNodeFeatures_3dm_gx4_45: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_gx4_45() {};
+
+ //Constructor: InertialNodeFeatures_3dm_gx4_45
+ // Creates a InertialNodeFeatures_3dm_gx4_45 object.
+ InertialNodeFeatures_3dm_gx4_45(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_rq1_45.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_rq1_45.cpp
new file mode 100644
index 000000000..e02929dbd
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_rq1_45.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_3dm_rq1_45.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_3dm_rq1_45::InertialNodeFeatures_3dm_rq1_45(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_rq1_45.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_rq1_45.h
new file mode 100644
index 000000000..19d3d0e14
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_3dm_rq1_45.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_3dm_rq1_45
+ // Contains information on features for the 3DM-RQ1-45 Node. Inherits from .
+ class InertialNodeFeatures_3dm_rq1_45: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_3dm_rq1_45() {};
+
+ //Constructor: InertialNodeFeatures_3dm_rq1_45
+ // Creates a InertialNodeFeatures_3dm_rq1_45 object.
+ InertialNodeFeatures_3dm_rq1_45(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_fasA.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_fasA.cpp
new file mode 100644
index 000000000..bbe188c13
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_fasA.cpp
@@ -0,0 +1,15 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "InertialNodeFeatures_fasA.h"
+
+namespace mscl
+{
+ InertialNodeFeatures_fasA::InertialNodeFeatures_fasA(const InertialNodeInfo& info):
+ InertialNodeFeatures(info)
+ {
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_fasA.h b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_fasA.h
new file mode 100644
index 000000000..a4db18242
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Features/InertialNodeFeatures_fasA.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "InertialNodeFeatures.h"
+
+namespace mscl
+{
+ //Class: InertialNodeFeatures_fasA
+ // Contains information on features for the FAS-A Node. Inherits from .
+ class InertialNodeFeatures_fasA: public InertialNodeFeatures
+ {
+ public:
+ virtual ~InertialNodeFeatures_fasA() {};
+
+ //Constructor: InertialNodeFeatures_fasA
+ // Creates a InertialNodeFeatures_fasA object.
+ InertialNodeFeatures_fasA(const InertialNodeInfo& info);
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp
index e065b4501..eb7b5cd9c 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp
@@ -9,6 +9,7 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#include "mscl/Types.h"
#include "mscl/Communication/SerialConnection.h"
#include "mscl/MicroStrain/Inertial/Commands/Inertial_Commands.h"
+#include "Features/InertialNodeFeatures.h"
#include "Packets/InertialPacket.h"
#include "InertialParser.h"
#include "InertialNode_Impl.h"
@@ -28,8 +29,15 @@ namespace mscl
{
}
- //====================================================================================================================================================
- //The following functions just get pushes through the InertialNode_Impl class containing the implementation of all these functions
+ const InertialNodeInfo& InertialNode::info()
+ {
+ return m_impl->info();
+ }
+
+ const InertialNodeFeatures& InertialNode::features()
+ {
+ return m_impl->features();
+ }
InertialDataPacket InertialNode::getNextDataPacket(uint32 timeout)
{
@@ -74,11 +82,6 @@ namespace mscl
m_impl->commandsTimeout(timeout);
}
- const InertialNodeInfo& InertialNode::info()
- {
- return m_impl->info();
- }
-
std::string InertialNode::name()
{
return deviceName(info().serialNumber());
@@ -129,5 +132,33 @@ namespace mscl
m_impl->enableDataStream(category, enable);
}
- //====================================================================================================================================================
+ EulerAngles InertialNode::getSensorToVehicleTransformation()
+ {
+ return m_impl->getSensorToVehicleTransformation();
+ }
+
+ void InertialNode::setSensorToVehicleTransformation(const EulerAngles& angles)
+ {
+ m_impl->setSensorToVehicleTransformation(angles);
+ }
+
+ PositionOffset InertialNode::getSensorToVehicleOffset()
+ {
+ return m_impl->getSensorToVehicleOffset();
+ }
+
+ void InertialNode::setSensorToVehicleOffset(const PositionOffset& offset)
+ {
+ m_impl->setSensorToVehicleOffset(offset);
+ }
+
+ PositionOffset InertialNode::getAntennaOffset()
+ {
+ return m_impl->getAntennaOffset();
+ }
+
+ void InertialNode::setAntennaOffset(const PositionOffset& offset)
+ {
+ m_impl->setAntennaOffset(offset);
+ }
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h
index 0ece773d5..9fe1bc218 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h
@@ -12,10 +12,14 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#include "Commands/InertialCmdResponse.h"
#include "Packets/InertialDataPacket.h"
#include "mscl/Communication/Connection.h"
+#include "mscl/MicroStrain/Inertial/PositionOffset.h"
+#include "mscl/MicroStrain/Inertial/EulerAngles.h"
namespace mscl
{
+ //forward declarations
class InertialNode_Impl;
+ class InertialNodeFeatures;
//API Class: InertialNode
// A class representing a MicroStrain Inertial Node
@@ -48,6 +52,31 @@ namespace mscl
std::shared_ptr m_impl;
public:
+ //API Function: info
+ // Gets 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 for this Node.
+ //
+ //Exceptions:
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : Information failed to be loaded for this Node.
+ const InertialNodeInfo& info();
+
+ //API Function: features
+ // Gets a reference to the for this device.
+ // Note: This will be invalid when the InertialNode is destroyed.
+ //
+ //Exceptions:
+ // - : The model is not supported by MSCL.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : Information failed to be loaded for this Node.
+ const InertialNodeFeatures& features();
+
//API Function: deviceName
// Static function for creating the universal sensor name that should be used for SensorCloud.
//
@@ -125,19 +154,6 @@ namespace mscl
// timeout - The timeout (in milliseconds) to set for Inertial commands.
void commandsTimeout(uint64 timeout);
- //API Function: info
- // Gets 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 for this Node.
- //
- //Exceptions:
- // - : There was no response to the command. The command timed out.
- // - : The command has failed. Check the error code for more details.
- // - : Information failed to be loaded for this Node.
- const InertialNodeInfo& info();
-
//API Function: 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 .
@@ -264,6 +280,86 @@ namespace mscl
// - : The command has failed. Check the error code for more details.
// - : A connection error has occurred with the InertialNode.
void enableDataStream(InertialTypes::InertialCategory category, bool enable = true);
+
+ //API Function: 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 object containing the roll, pitch, and yaw result (in radians).
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ EulerAngles getSensorToVehicleTransformation();
+
+ //API Function: setSensorToVehicleTransformation
+ // 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 object containing the roll, pitch, and yaw (in radians) to set.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ void setSensorToVehicleTransformation(const EulerAngles& angles);
+
+ //API Function: getSensorToVehicleOffset
+ // Gets the sensor to vehicle frame offset, expressed in the sensor frame.
+ //
+ //Returns:
+ // The object containing the x, y, and z position (in meters) result.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ PositionOffset getSensorToVehicleOffset();
+
+ //API Function: setSensorToVehicleOffset
+ // Sets the sensor to vehicle frame offset, expressed in the sensor frame.
+ //
+ //Parameters:
+ // offset - The object containing the x, y, and z position (in meters) to set.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ void setSensorToVehicleOffset(const PositionOffset& offset);
+
+ //API Function: getAntennaOffset
+ // Gets the antenna offset, expressed in the sensor frame.
+ //
+ //Returns:
+ // The object containing the x, y, and z position (in meters) result.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ PositionOffset getAntennaOffset();
+
+ //API Function: setAntennaOffset
+ // Sets the antenna offset, expressed in the sensor frame.
+ //
+ //Parameters:
+ // offset - The object containing the x, y, and z position (in meters) to set.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ void setAntennaOffset(const PositionOffset& offset);
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.cpp b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.cpp
index 1b995edf8..da2e619ad 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.cpp
+++ b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.cpp
@@ -16,6 +16,7 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#include "Commands/ContinuousDataStream.h"
#include "Commands/Inertial_SetToIdle.h"
#include "Commands/Resume.h"
+#include "Features/InertialNodeFeatures.h"
namespace mscl
{
@@ -33,7 +34,7 @@ namespace mscl
m_parser.reset(new InertialParser(&m_packetCollector, m_responseCollector));
//register the parse function with the connection
- m_connection.registerParser(std::bind(&InertialNode_Impl::parseData, this, std::placeholders::_1));
+ m_connection.registerParser(std::bind(&InertialNode_Impl::parseResponse, this, std::placeholders::_1));
}
InertialNode_Impl::~InertialNode_Impl()
@@ -47,6 +48,36 @@ namespace mscl
return m_lastCommTime;
}
+ const InertialNodeInfo& InertialNode_Impl::info()
+ {
+ //if we haven't initialized the InertialNodeInfo
+ if(!m_nodeInfo)
+ {
+ //send the GetDeviceInfo command
+ InertialDeviceInfo deviceInfo = getDeviceInfo();
+
+ //send the GetDeviceDescriptorSets command
+ std::vector sets = getDescriptorSets();
+
+ //create an InertialNodeInfo object
+ m_nodeInfo.reset(new InertialNodeInfo(deviceInfo, sets));
+ }
+
+ return (*m_nodeInfo);
+ }
+
+ const InertialNodeFeatures& InertialNode_Impl::features()
+ {
+ //if the features variable hasn't been set yet
+ if(m_features == NULL)
+ {
+ //set the features variable by creating a new NodeFeatures pointer
+ m_features = InertialNodeFeatures::create(info());
+ }
+
+ return *(m_features.get());
+ }
+
const SampleRates& InertialNode_Impl::supportedSampleRates(InertialTypes::InertialCategory category)
{
SampleRates* rates = NULL;
@@ -91,7 +122,7 @@ namespace mscl
return *rates;
}
- void InertialNode_Impl::parseData(DataBuffer& data)
+ void InertialNode_Impl::parseResponse(DataBuffer& data)
{
//send the readBuffer to the parser to parse all the bytes
m_parser->parse(data);
@@ -100,24 +131,6 @@ namespace mscl
data.shiftExtraToStart();
}
- const InertialNodeInfo& InertialNode_Impl::info()
- {
- //if we haven't initialized the InertialNodeInfo
- if(!m_nodeInfo)
- {
- //send the GetDeviceInfo command
- InertialDeviceInfo deviceInfo = getDeviceInfo();
-
- //send the GetDeviceDescriptorSets command
- std::vector sets = getDescriptorSets();
-
- //create an InertialNodeInfo object
- m_nodeInfo.reset(new InertialNodeInfo(deviceInfo, sets));
- }
-
- return (*m_nodeInfo);
- }
-
void InertialNode_Impl::getNextDataPacket(InertialDataPacket& packet, uint32 timeout)//timeout = 0
{
//check if a connection error has occurred
@@ -219,7 +232,7 @@ namespace mscl
GetDeviceInfo::Response r(m_responseCollector);
//send the command, wait for the response, and parse the result
- return r.parseData(doInertialCmd(r, GetDeviceInfo::buildCommand(), GetDeviceInfo::CMD_ID, false));
+ return r.parseResponse(doInertialCmd(r, GetDeviceInfo::buildCommand(), GetDeviceInfo::CMD_ID, false));
}
std::vector InertialNode_Impl::getDescriptorSets()
@@ -228,7 +241,7 @@ namespace mscl
GetDeviceDescriptorSets::Response r(m_responseCollector);
//send the command, wait for the response, and parse the result
- return r.parseData(doInertialCmd(r, GetDeviceDescriptorSets::buildCommand(), GetDeviceDescriptorSets::CMD_ID, false));
+ return r.parseResponse(doInertialCmd(r, GetDeviceDescriptorSets::buildCommand(), GetDeviceDescriptorSets::CMD_ID, false));
}
uint16 InertialNode_Impl::getDataRateBase(InertialTypes::InertialCategory category)
@@ -244,7 +257,7 @@ namespace mscl
GetSensorDataRateBase::Response r(m_responseCollector);
//send the command, wait for the response, and parse the result
- m_sensorRateBase = r.parseData(doInertialCmd(r, GetSensorDataRateBase::buildCommand(), GetSensorDataRateBase::CMD_ID));
+ m_sensorRateBase = r.parseResponse(doInertialCmd(r, GetSensorDataRateBase::buildCommand(), GetSensorDataRateBase::CMD_ID));
}
return m_sensorRateBase;
@@ -259,7 +272,7 @@ namespace mscl
GetGpsDataRateBase::Response r(m_responseCollector);
//send the command, wait for the response, and parse the result
- m_gpsRateBase = r.parseData(doInertialCmd(r, GetGpsDataRateBase::buildCommand(), GetGpsDataRateBase::CMD_ID));
+ m_gpsRateBase = r.parseResponse(doInertialCmd(r, GetGpsDataRateBase::buildCommand(), GetGpsDataRateBase::CMD_ID));
}
return m_gpsRateBase;
@@ -275,7 +288,7 @@ namespace mscl
GetEstFilterDataRateBase::Response r(m_responseCollector);
//send the command, wait for the response, and parse the result
- m_estfilterRateBase = r.parseData(doInertialCmd(r, GetEstFilterDataRateBase::buildCommand(), GetEstFilterDataRateBase::CMD_ID));
+ m_estfilterRateBase = r.parseResponse(doInertialCmd(r, GetEstFilterDataRateBase::buildCommand(), GetEstFilterDataRateBase::CMD_ID));
}
return m_estfilterRateBase;
@@ -296,7 +309,7 @@ namespace mscl
SensorMessageFormat::Response r(m_responseCollector, true);
//send the command, wait for the response, and parse the result
- return r.parseData(doInertialCmd(r, SensorMessageFormat::buildCommand_get(), SensorMessageFormat::CMD_ID), sampleRateBase);
+ return r.parseResponse(doInertialCmd(r, SensorMessageFormat::buildCommand_get(), SensorMessageFormat::CMD_ID), sampleRateBase);
}
case InertialTypes::CATEGORY_GPS:
@@ -305,7 +318,7 @@ namespace mscl
GpsMessageFormat::Response r(m_responseCollector, true);
//send the command, wait for the response, and parse the result
- return r.parseData(doInertialCmd(r, GpsMessageFormat::buildCommand_get(), GpsMessageFormat::CMD_ID), sampleRateBase);
+ return r.parseResponse(doInertialCmd(r, GpsMessageFormat::buildCommand_get(), GpsMessageFormat::CMD_ID), sampleRateBase);
}
case InertialTypes::CATEGORY_ESTFILTER:
@@ -315,7 +328,7 @@ namespace mscl
EstFilterMessageFormat::Response r(m_responseCollector, true);
//send the command, wait for the response, and parse the result
- return r.parseData(doInertialCmd(r, EstFilterMessageFormat::buildCommand_get(), EstFilterMessageFormat::CMD_ID), sampleRateBase);
+ return r.parseResponse(doInertialCmd(r, EstFilterMessageFormat::buildCommand_get(), EstFilterMessageFormat::CMD_ID), sampleRateBase);
}
}
}
@@ -366,7 +379,7 @@ namespace mscl
CommunicationMode::Response r(m_responseCollector, true);
//send the command, wait for the response, and parse the result
- return r.parseData(doInertialCmd(r, CommunicationMode::buildCommand_get(), CommunicationMode::CMD_ID));
+ return r.parseResponse(doInertialCmd(r, CommunicationMode::buildCommand_get(), CommunicationMode::CMD_ID));
}
void InertialNode_Impl::setCommunicationMode(uint8 communicationMode)
@@ -389,5 +402,47 @@ namespace mscl
//send the command and wait for the response
doInertialCmd(r, ContinuousDataStream::buildCommand_set(category, enable), ContinuousDataStream::CMD_ID);
}
+
+ EulerAngles InertialNode_Impl::getSensorToVehicleTransformation()
+ {
+ SensorToVehicFrameTrans::Response r(m_responseCollector, true);
+
+ return r.parseResponse(doInertialCmd(r, SensorToVehicFrameTrans::buildCommand_get(), SensorToVehicFrameTrans::CMD_ID));
+ }
+
+ void InertialNode_Impl::setSensorToVehicleTransformation(const EulerAngles& angles)
+ {
+ SensorToVehicFrameTrans::Response r(m_responseCollector, false);
+
+ doInertialCmd(r, SensorToVehicFrameTrans::buildCommand_set(angles), SensorToVehicFrameTrans::CMD_ID);
+ }
+
+ PositionOffset InertialNode_Impl::getSensorToVehicleOffset()
+ {
+ SensorToVehicFrameOffset::Response r(m_responseCollector, true);
+
+ return r.parseResponse(doInertialCmd(r, SensorToVehicFrameOffset::buildCommand_get(), SensorToVehicFrameOffset::CMD_ID));
+ }
+
+ void InertialNode_Impl::setSensorToVehicleOffset(const PositionOffset& offset)
+ {
+ SensorToVehicFrameOffset::Response r(m_responseCollector, false);
+
+ doInertialCmd(r, SensorToVehicFrameOffset::buildCommand_set(offset), SensorToVehicFrameOffset::CMD_ID);
+ }
+
+ PositionOffset InertialNode_Impl::getAntennaOffset()
+ {
+ AntennaOffset::Response r(m_responseCollector, true);
+
+ return r.parseResponse(doInertialCmd(r, AntennaOffset::buildCommand_get(), AntennaOffset::CMD_ID));
+ }
+
+ void InertialNode_Impl::setAntennaOffset(const PositionOffset& offset)
+ {
+ AntennaOffset::Response r(m_responseCollector, false);
+
+ doInertialCmd(r, AntennaOffset::buildCommand_set(offset), AntennaOffset::CMD_ID);
+ }
//============================================================================
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.h b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.h
index 318116460..fcf5e7e53 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode_Impl.h
@@ -16,12 +16,16 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#include "Packets/InertialPacketCollector.h"
#include "mscl/Communication/Connection.h"
#include "mscl/MicroStrain/ResponseCollector.h"
+#include "mscl/MicroStrain/Inertial/EulerAngles.h"
+#include "mscl/MicroStrain/Inertial/PositionOffset.h"
#include "mscl/Timestamp.h"
namespace mscl
{
- class InertialParser; //forward declaration
- class InertialNodeInfo; //forward declaration
+ //forward declarations
+ class InertialParser;
+ class InertialNodeInfo;
+ class InertialNodeFeatures;
//Class: InertialNode_Impl
// Contains the implementation for an .
@@ -102,13 +106,17 @@ namespace mscl
// A representing the last time communication was achieved with the InertialNode.
Timestamp m_lastCommTime;
+ //Variable: m_features
+ // The containing the features for this device.
+ std::unique_ptr m_features;
+
private:
- //Function: parseData
+ //Function: parseResponse
// Callback function that parses any bytes that are in the read buffer to find packets or command responses
//
//Parameters:
// data - The containing all the data to be parsed
- void parseData(DataBuffer& data);
+ void parseResponse(DataBuffer& data);
//Function: doInertialCmd
// Performs a generic Inertial Command, sending the command bytes and waiting for the response.
@@ -128,6 +136,29 @@ namespace mscl
virtual GenericInertialCommandResponse doInertialCmd(GenericInertialCommand::Response& response, const ByteStream& command, InertialTypes::Command commandId, bool verifySupported=true);
public:
+ //Function: info
+ // Gets the 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 for this Node.
+ //
+ //Exceptions:
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : Information failed to be loaded for this Node.
+ const InertialNodeInfo& info();
+
+ //Function: features
+ // Gets a reference to the for this device.
+ //
+ //Exceptions:
+ // - : The model is not supported by MSCL.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : Information failed to be loaded for this Node.
+ virtual const InertialNodeFeatures& features();
+
//Function: lastCommunicationTime
// Gets the for the last time we communicated with the InertialNode.
const Timestamp& lastCommunicationTime() const;
@@ -183,19 +214,6 @@ namespace mscl
// timeout - The timeout (in milliseconds) to set for Inertial commands.
void commandsTimeout(uint64 timeout);
- //Function: info
- // Gets the 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 for this Node.
- //
- //Exceptions:
- // - : There was no response to the command. The command timed out.
- // - : The command has failed. Check the error code for more details.
- // - : Information failed to be loaded for this Node.
- const InertialNodeInfo& info();
-
private:
//Function: getDeviceInfo
// Gets information about the InertialNode.
@@ -338,5 +356,74 @@ namespace mscl
// - : The command, or , is not supported by this Node.
// - : The command has failed.
void enableDataStream(InertialTypes::InertialCategory category, bool enable);
+
+ //Function: getSensorToVehicleTransformation
+ // Gets the sensor to vehicle frame transformation matrix using roll, pitch, and yaw Euler angles (in radians).
+ //
+ //Exceptions:
+ // - : The command or is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ EulerAngles getSensorToVehicleTransformation();
+
+ //Function: setSensorToVehicleTransformation
+ // Sets the sensor to vehicle frame transformation matrix using roll, pitch, and yaw Euler angles (in radians).
+ //
+ //Parameters:
+ // angles - The object containing the roll, pitch, and yaw to set.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ void setSensorToVehicleTransformation(const EulerAngles& angles);
+
+ //Function: getSensorToVehicleOffset
+ // Gets the sensor to vehicle frame offset, expressed in the sensor frame.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ PositionOffset getSensorToVehicleOffset();
+
+ //Function: setSensorToVehicleTransformation
+ // Sets the sensor to vehicle frame offset, expressed in the sensor frame.
+ //
+ //Parameters:
+ // offset - The object containing the x, y, and z position (in meters) to set.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ void setSensorToVehicleOffset(const PositionOffset& offset);
+
+ //Function: getAntennaOffset
+ // Gets the antenna offset, expressed in the sensor frame.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ PositionOffset getAntennaOffset();
+
+ //Function: setAntennaOffset
+ // Sets the antenna offset, expressed in the sensor frame.
+ //
+ //Parameters:
+ // offset - The object containing the x, y, and z position (in meters) to set.
+ //
+ //Exceptions:
+ // - : The command is not supported by this Node.
+ // - : There was no response to the command. The command timed out.
+ // - : The command has failed. Check the error code for more details.
+ // - : A connection error has occurred with the InertialNode.
+ void setAntennaOffset(const PositionOffset& offset);
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/InertialTypes.h b/MSCL/source/mscl/MicroStrain/Inertial/InertialTypes.h
index c99de9582..e732fc240 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/InertialTypes.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/InertialTypes.h
@@ -431,7 +431,23 @@ struct InertialTypes
// A typedef for a , pair.
typedef std::pair ChannelId;
- //Function: channelFieldToStr
+ //Function: channelFieldToCategory
+ // Gets the for a .
+ //
+ //Parameters:
+ // channelId - The to get the category for.
+ //
+ //Returns:
+ // The for the given channel ID.
+ static InertialCategory channelFieldToCategory(InertialTypes::ChannelField channelField);
+
+ struct ChannelIdHash
+ {
+ size_t operator()(InertialTypes::ChannelId channelId) const;
+ };
+#endif
+
+ //API Function: channelFieldToStr
// Gets a string representation of a .
//
//Parameters:
@@ -441,7 +457,7 @@ struct InertialTypes
// A string representation of the given .
static std::string channelFieldToStr(ChannelField field);
- //Function: channelQualifierToStr
+ //API Function: channelQualifierToStr
// Gets a string representation of a .
//
//Parameters:
@@ -451,7 +467,7 @@ struct InertialTypes
// A string representation of the given .
static std::string channelQualifierToStr(ChannelQualifier qualifier);
- //Function: channelName
+ //API Function: channelName
// Gets the name of the specified .
// This is the universal channel name that should be used for uploading to SensorCloud.
//
@@ -466,22 +482,6 @@ struct InertialTypes
// - : Unknown channel.
static std::string channelName(ChannelField field, ChannelQualifier qualifier);
- //Function: channelFieldToCategory
- // Gets the for a .
- //
- //Parameters:
- // channelId - The to get the category for.
- //
- //Returns:
- // The for the given channel ID.
- static InertialCategory channelFieldToCategory(InertialTypes::ChannelField channelField);
-
- struct ChannelIdHash
- {
- size_t operator()(InertialTypes::ChannelId channelId) const;
- };
-#endif
-
private:
//Const: CHANNEL_NAMES
// An unordered_map mapping each to its respective name (universal SensorCloud name).
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Packets/InertialPacket.h b/MSCL/source/mscl/MicroStrain/Inertial/Packets/InertialPacket.h
index ed18c9c64..7f7c08a07 100644
--- a/MSCL/source/mscl/MicroStrain/Inertial/Packets/InertialPacket.h
+++ b/MSCL/source/mscl/MicroStrain/Inertial/Packets/InertialPacket.h
@@ -28,14 +28,14 @@ namespace mscl
//=====================================================================================================
enum MipAckNack
{
- MIP_ACK_NACK_ERROR_NONE = 0,
+ MIP_ACK_NACK_ERROR_NONE = 0,
- MIP_ACK_NACK_ERROR_UNKNOWN_COMMAND = 1,
- MIP_ACK_NACK_ERROR_CHECKSUM_INVALID = 2,
- MIP_ACK_NACK_ERROR_PARAMETER_INVALID = 3,
- MIP_ACK_NACK_ERROR_COMMAND_FAILED = 4,
- MIP_ACK_NACK_ERROR_COMMAND_TIMEOUT = 5,
- MIP_ACK_NACK_ERROR_UNKNOWN_DESCRIPTOR_SET = 6
+ MIP_ACK_NACK_ERROR_UNKNOWN_COMMAND = 1,
+ MIP_ACK_NACK_ERROR_CHECKSUM_INVALID = 2,
+ MIP_ACK_NACK_ERROR_PARAMETER_INVALID = 3,
+ MIP_ACK_NACK_ERROR_COMMAND_FAILED = 4,
+ MIP_ACK_NACK_ERROR_COMMAND_TIMEOUT = 5,
+ MIP_ACK_NACK_ERROR_UNKNOWN_DESCRIPTOR_SET = 6
};
public:
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/PositionOffset.cpp b/MSCL/source/mscl/MicroStrain/Inertial/PositionOffset.cpp
new file mode 100644
index 000000000..e6b037242
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/PositionOffset.cpp
@@ -0,0 +1,40 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+
+#include "PositionOffset.h"
+
+namespace mscl
+{
+ PositionOffset::PositionOffset():
+ m_x(0.0f),
+ m_y(0.0f),
+ m_z(0.0f)
+ {
+ }
+
+ PositionOffset::PositionOffset(float x, float y, float z):
+ m_x(x),
+ m_y(y),
+ m_z(z)
+ {
+ }
+
+ float PositionOffset::x() const
+ {
+ return m_x;
+ }
+
+ float PositionOffset::y() const
+ {
+ return m_y;
+ }
+
+ float PositionOffset::z() const
+ {
+ return m_z;
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Inertial/PositionOffset.h b/MSCL/source/mscl/MicroStrain/Inertial/PositionOffset.h
new file mode 100644
index 000000000..2a2704840
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Inertial/PositionOffset.h
@@ -0,0 +1,56 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+//PUBLIC_HEADER
+#pragma once
+
+namespace mscl
+{
+ //API Class: PositionOffset
+ // Represents a position offset (x, y, z).
+ class PositionOffset
+ {
+ private:
+ //Variable: m_x;
+ // The x value.
+ float m_x;
+
+ //Variable: m_y
+ // The y value.
+ float m_y;
+
+ //Variable: m_z
+ // The z value.
+ float m_z;
+
+ public:
+ PositionOffset();
+
+ //API Constructor: PositionOffset
+ // Creates a PositionOffset object.
+ PositionOffset(float x, float y, float z);
+
+ //API Function: x
+ // Gets the x position offset.
+ //
+ //Returns:
+ // The x position offset.
+ float x() const;
+
+ //API Function: y
+ // Gets the y position offset.
+ //
+ //Returns:
+ // The y position offset.
+ float y() const;
+
+ //API Function: z
+ // Gets the z position offset.
+ //
+ //Returns:
+ // The z position offset.
+ float z() const;
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.cpp b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.cpp
index f11fa197a..344079bcb 100644
--- a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.cpp
+++ b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.cpp
@@ -329,13 +329,18 @@ namespace mscl
return m_impl->node_erase(nodeAddress);
}
- void BaseStation::node_autoBalance(NodeAddress nodeAddress, uint8 channelNumber, uint16 targetVal)
+ bool BaseStation::node_autoBalance(const WirelessProtocol& protocol, NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result)
{
- m_impl->node_autoBalance(nodeAddress, channelNumber, targetVal);
+ return m_impl->node_autoBalance(protocol, nodeAddress, channelNumber, targetPercent, result);
}
bool BaseStation::node_autocal(NodeAddress nodeAddress, WirelessModels::NodeModel model, const Version& fwVersion, AutoCalResult& result)
{
return m_impl->node_autocal(nodeAddress, model, fwVersion, result);
}
+
+ bool BaseStation::node_readSingleSensor(NodeAddress nodeAddress, uint8 channelNumber, uint16& result)
+ {
+ return m_impl->node_readSingleSensor(nodeAddress, channelNumber, result);
+ }
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.h b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.h
index 2ec11e18e..734a9a664 100644
--- a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.h
+++ b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation.h
@@ -22,6 +22,7 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
namespace mscl
{
//forward declarations
+ class AutoBalanceResult;
class AutoCalResult;
class BaseStation_Impl;
class BaseStationFeatures;
@@ -605,16 +606,16 @@ namespace mscl
const Timestamp& node_lastCommunicationTime(NodeAddress nodeAddress) const;
//Function: node_shortPing
- // Pings a specific node
+ // Pings a specific node.
//
//Parameters:
- // nodeAddress - the node address of the node to ping
+ // nodeAddress - the node address of the node to ping.
//
//Returns:
- // true if successfully pinged the node, false otherwise
+ // true if successfully pinged the node, false otherwise.
//
//Exceptions:
- // - : A connection error has occurred with the BaseStation
+ // - : A connection error has occurred with the BaseStation.
bool node_shortPing(NodeAddress nodeAddress);
//Function: node_ping
@@ -765,13 +766,18 @@ namespace mscl
// Sends the AutoBalance command to a Node.
//
//Parameters:
+ // protocol - The for the Node.
// nodeAddress - The node address of the Node to send the command to.
// channelNumber - The channel number (ch1 = 1, ch8 = 8) to balance.
- // targetVal - The target value to balance to.
+ // targetPercent - The target percentage (0 - 100) to balance to.
+ // result - The of the command.
+ //
+ //Returns:
+ // true if the command succeeded, false if it failed.
//
//Exceptions:
// - : A connection error has occurred with the BaseStation.
- void node_autoBalance(NodeAddress nodeAddress, uint8 channelNumber, uint16 targetVal);
+ bool node_autoBalance(const WirelessProtocol& protocol, NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result);
//Function: node_autocal
// Performs automatic calibration for a Wireless Node.
@@ -788,6 +794,21 @@ namespace mscl
//Exceptions:
// - : A connection error has occurred with the BaseStation.
bool node_autocal(NodeAddress nodeAddress, WirelessModels::NodeModel model, const Version& fwVersion, AutoCalResult& result);
+
+ //Function: node_readSingleSensor
+ // Reads the bits value for a single channel on a Wireless Node.
+ //
+ //Parameters:
+ // nodeAddress - The node address of the Node to send the command to.
+ // channelNumber - The channel number (ch1 = 1, ch8 = 8) to read.
+ // result - Holds the bits value result from the channel on the Node.
+ //
+ //Returns:
+ // true if the Read Single Sensor command was successful, false otherwise.
+ //
+ //Exceptions:
+ // - : A connection error has occurred with the BaseStation.
+ bool node_readSingleSensor(NodeAddress nodeAddress, uint8 channelNumber, uint16& result);
#endif
};
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.cpp b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.cpp
index 7ceed4087..61a667a2b 100644
--- a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.cpp
+++ b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.cpp
@@ -12,6 +12,7 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#include "Configuration/BaseStationConfig.h"
#include "Features/BaseStationFeatures.h"
#include "mscl/MicroStrain/ResponsePattern.h"
+#include "mscl/ScopeHelper.h"
#include "mscl/Utils.h"
#include "mscl/Version.h"
#include "BaseStationInfo.h"
@@ -32,20 +33,24 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
//Node commands
#include "Commands/ArmForDatalogging.h"
#include "Commands/AutoBalance.h"
+#include "Commands/AutoBalance_v2.h"
#include "Commands/AutoCal.h"
-#include "Commands/ShortPing.h"
+#include "Commands/AutoCalResult.h"
+#include "Commands/Erase.h"
#include "Commands/LongPing.h"
+#include "Commands/PageDownload.h"
#include "Commands/ReadEeprom.h"
#include "Commands/ReadEeprom_v2.h"
-#include "Commands/WriteEeprom.h"
-#include "Commands/WriteEeprom_v2.h"
-#include "Commands/PageDownload.h"
-#include "Commands/StartNonSyncSampling.h"
-#include "Commands/StartSyncSampling.h"
+#include "Commands/ReadSingleSensor.h"
#include "Commands/SetToIdle.h"
+#include "Commands/ShortPing.h"
+#include "Commands/ShortPing_v2.h"
#include "Commands/Sleep.h"
+#include "Commands/StartNonSyncSampling.h"
+#include "Commands/StartSyncSampling.h"
#include "Commands/TriggerArmedDatalogging.h"
-#include "Commands/Erase.h"
+#include "Commands/WriteEeprom.h"
+#include "Commands/WriteEeprom_v2.h"
namespace mscl
{
@@ -78,6 +83,10 @@ namespace mscl
Version fwVersion;
uint8 origRetries = m_eeprom->getNumRetries();
+
+ //when this goes out of scope, the number of retries will be changed back to what it was before
+ ScopeHelper writebackRetries(std::bind(&BaseStationEeprom::setNumRetries, m_eeprom.get(), origRetries));
+
m_eeprom->setNumRetries(0);
bool success = false;
@@ -122,20 +131,8 @@ namespace mscl
}
while(!success && (retryCount++ < origRetries));
- //reset the eeprom retry counter back to what it was
- m_eeprom->setNumRetries(origRetries);
-
- //the BaseStation min fw version to support protocol 1.1
- static const Version FW_PROTOCOL_1_1(4, 0);
-
- if(fwVersion >= FW_PROTOCOL_1_1)
- {
- return WirelessProtocol::v1_1();
- }
- else
- {
- return WirelessProtocol::v1_0();
- }
+ //get the protocol to use for the base station's fw version
+ return WirelessProtocol::chooseBaseStationProtocol(fwVersion);
}
BaseStationEepromHelper& BaseStation_Impl::eeHelper() const
@@ -734,6 +731,54 @@ namespace mscl
return false;
}
+ bool BaseStation_Impl::node_shortPing_v1(NodeAddress nodeAddress)
+ {
+ //create the response for the short ping command
+ ShortPing::Response response(m_responseCollector);
+
+ //send the short ping command to the base station
+ m_connection.write(ShortPing::buildCommand(nodeAddress));
+
+ //wait for the response
+ response.wait(m_nodeCommandsTimeout);
+
+ if(response.success())
+ {
+ //update basestation last comm time
+ m_lastCommTime.setTimeNow();
+
+ //update node last comm time
+ m_nodesLastCommTime[nodeAddress].setTimeNow();
+ }
+
+ //return the result of the response
+ return response.success();
+ }
+
+ bool BaseStation_Impl::node_shortPing_v2(NodeAddress nodeAddress)
+ {
+ //create the response for the short ping command
+ ShortPing_v2::Response response(nodeAddress, m_responseCollector);
+
+ //send the short ping command to the base station
+ m_connection.write(ShortPing_v2::buildCommand(nodeAddress));
+
+ //wait for the response
+ response.wait(m_nodeCommandsTimeout);
+
+ if(response.success())
+ {
+ //update basestation last comm time
+ m_lastCommTime.setTimeNow();
+
+ //update node last comm time
+ m_nodesLastCommTime[nodeAddress].setTimeNow();
+ }
+
+ //return the result of the response
+ return response.success();
+ }
+
bool BaseStation_Impl::node_readEeprom_v1(NodeAddress nodeAddress, uint16 eepromAddress, uint16& eepromValue)
{
bool success = false;
@@ -870,6 +915,57 @@ namespace mscl
return success;
}
+ bool BaseStation_Impl::node_autoBalance_v1(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result)
+ {
+ //determine the target value to send to the autobalance command (max bits is always 4096 for this command)
+ uint16 targetVal = static_cast(4096 * targetPercent / 100.0f);
+
+ //build the command to send
+ ByteStream command = AutoBalance::buildCommand(nodeAddress, channelNumber, targetVal);
+
+ //send the command to the base station
+ m_connection.write(command);
+
+ //this command doesn't have a response (no info), so set the error code to legacy
+ result.m_errorCode = WirelessTypes::autobalance_legacyNone;
+
+ //don't know the actual status, have to assume success
+ return true;
+ }
+
+ bool BaseStation_Impl::node_autoBalance_v2(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result)
+ {
+ bool success = false;
+
+ //create the response for the AutoBalance_v2 command
+ AutoBalance_v2::Response response(nodeAddress, channelNumber, targetPercent, m_responseCollector);
+
+ //build the command to send
+ ByteStream command = AutoBalance_v2::buildCommand(nodeAddress, channelNumber, targetPercent);
+
+ //send the command to the base station
+ m_connection.write(command);
+
+ //wait for the response
+ response.wait(m_nodeCommandsTimeout);
+
+ //return the result of the response
+ success = response.success();
+
+ if(success)
+ {
+ //update basestation last comm time
+ m_lastCommTime.setTimeNow();
+
+ //update node last comm time
+ m_nodesLastCommTime[nodeAddress].setTimeNow();
+ }
+
+ result = response.result();
+
+ return success;
+ }
+
Value BaseStation_Impl::readEeprom(const EepromLocation& location) const
{
return m_eeprom->readEeprom(location);
@@ -897,6 +993,13 @@ namespace mscl
//store the original timeout that is currently set
uint64 originalTimeout = baseCommandsTimeout();
+ //when this goes out of scope, it will write back the original timeout (need cast for overloaded ambiguity)
+ ScopeHelper writebackTimeout(std::bind(static_cast(&BaseStation_Impl::baseCommandsTimeout), this, originalTimeout));
+
+ //force determining of the protocol if it hasn't been already
+ //Note: this is so that we can set the timeout short and write eeprom without worrying about reading
+ protocol();
+
try
{
//this command doesn't have a response, change to a quick timeout
@@ -910,8 +1013,16 @@ namespace mscl
//an exception will be thrown due to no response, just continue on
}
- //set the timeout back to what it was
- baseCommandsTimeout(originalTimeout);
+ Utils::threadSleep(100);
+
+ //attempt to ping the node a few times to see if its back online
+ bool pingSuccess = false;
+ uint8 retries = 0;
+ while(!pingSuccess && retries <= 5)
+ {
+ pingSuccess = ping();
+ retries++;
+ }
}
void BaseStation_Impl::resetRadio()
@@ -920,6 +1031,8 @@ namespace mscl
//write a 0x02 to the CYCLE_POWER eeprom location on the base station
writeEeprom(BaseStationEepromMap::CYCLE_POWER, Value::UINT16(RESET_RADIO));
+
+ Utils::threadSleep(100);
}
void BaseStation_Impl::changeFrequency(WirelessTypes::Frequency frequency)
@@ -946,6 +1059,16 @@ namespace mscl
void BaseStation_Impl::applyConfig(const BaseStationConfig& config)
{
config.apply(features(), eeHelper());
+
+ //if we can just reset the radio to commit the changes
+ if(features().supportsEepromCommitViaRadioReset())
+ {
+ resetRadio();
+ }
+ else
+ {
+ cyclePower();
+ }
}
WirelessTypes::TransmitPower BaseStation_Impl::getTransmitPower() const
@@ -997,30 +1120,6 @@ namespace mscl
return m_nodesLastCommTime[nodeAddress];
}
- bool BaseStation_Impl::node_shortPing(NodeAddress nodeAddress)
- {
- //create the response for the short ping command
- ShortPing::Response response(m_responseCollector);
-
- //send the short ping command to the base station
- m_connection.write(ShortPing::buildCommand(nodeAddress));
-
- //wait up to 50 milliseconds for the response
- response.wait(50);
-
- if(response.success())
- {
- //update basestation last comm time
- m_lastCommTime.setTimeNow();
-
- //update node last comm time
- m_nodesLastCommTime[nodeAddress].setTimeNow();
- }
-
- //return the result of the response
- return response.success();
- }
-
PingResponse BaseStation_Impl::node_ping(NodeAddress nodeAddress)
{
//create the response for the LongPing command with the node address
@@ -1081,6 +1180,12 @@ namespace mscl
return status;
}
+ bool BaseStation_Impl::node_shortPing(NodeAddress nodeAddress)
+ {
+ //this just depends on the protocol of the Base Station, not the Node
+ return protocol().m_shortPing(this, nodeAddress);
+ }
+
bool BaseStation_Impl::node_readEeprom(const WirelessProtocol& nodeProtocol, NodeAddress nodeAddress, uint16 eepromAddress, uint16& eepromValue)
{
return nodeProtocol.m_readNodeEeprom(this, nodeAddress, eepromAddress, eepromValue);
@@ -1196,15 +1301,9 @@ namespace mscl
return response.success();
}
- void BaseStation_Impl::node_autoBalance(NodeAddress nodeAddress, uint8 channelNumber, uint16 targetVal)
+ bool BaseStation_Impl::node_autoBalance(const WirelessProtocol& nodeProtocol, NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result)
{
- //build the command to send
- ByteStream command = AutoBalance::buildCommand(nodeAddress, channelNumber, targetVal);
-
- //send the command to the base station
- m_connection.write(command);
-
- //no response for this command
+ return nodeProtocol.m_autoBalance(this, nodeAddress, channelNumber, targetPercent, result);
}
bool BaseStation_Impl::node_autocal(NodeAddress nodeAddress, WirelessModels::NodeModel model, const Version& fwVersion, AutoCalResult& result)
@@ -1217,6 +1316,7 @@ namespace mscl
switch(model)
{
case WirelessModels::node_shmLink2:
+ case WirelessModels::node_shmLink2_cust1:
default:
cmd = AutoCal::buildCommand_shmLink(nodeAddress);
break;
@@ -1256,4 +1356,30 @@ namespace mscl
return response.success();
}
+
+ bool BaseStation_Impl::node_readSingleSensor(NodeAddress nodeAddress, uint8 channelNumber, uint16& result)
+ {
+ //create the response for the Erase command
+ ReadSingleSensor::Response response(m_responseCollector);
+
+ //send the erase command to the base station
+ m_connection.write(ReadSingleSensor::buildCommand(nodeAddress, channelNumber));
+
+ //wait for the response or timeout
+ response.wait(m_nodeCommandsTimeout);
+
+ if(response.success())
+ {
+ result = response.sensorValue();
+
+ //update basestation last comm time
+ m_lastCommTime.setTimeNow();
+
+ //update node last comm time
+ m_nodesLastCommTime[nodeAddress].setTimeNow();
+ }
+
+ //return the result of the response
+ return response.success();
+ }
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.h b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.h
index 3bb418edb..76ec08eb9 100644
--- a/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.h
+++ b/MSCL/source/mscl/MicroStrain/Wireless/BaseStation_Impl.h
@@ -9,6 +9,7 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
#include "WirelessParser.h"
#include "WirelessModels.h"
+#include "Commands/AutoBalance_v2.h"
#include "Commands/BaseStation_BeaconStatus.h"
#include "Commands/LongPing.h"
#include "Commands/SetToIdleStatus.h"
@@ -23,12 +24,13 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
namespace mscl
{
//forward declarations
+ class AutoBalanceResult;
+ class AutoCalResult;
class BaseStation;
class BaseStationFeatures;
class BaseStationConfig;
- class AutoCalResult;
- class WirelessProtocol;
class ResponsePattern;
+ class WirelessProtocol;
//Class: BaseStation_Impl
// Contains the implementation for a object.
@@ -768,6 +770,32 @@ namespace mscl
// - : A connection error has occurred with the BaseStation
bool node_pageDownload_v1(NodeAddress nodeAddress, uint16 pageIndex, ByteStream& data);
+ //Function: node_shortPing_v1
+ // Performs Version 1 of the Node Short Ping command.
+ //
+ //Parameters:
+ // nodeAddress - The node address of the Node to short ping.
+ //
+ //Returns:
+ // true if the short ping command succeeded, false otherwise.
+ //
+ //Exceptions:
+ // - : A connection error has occurred with the BaseStation.
+ bool node_shortPing_v1(NodeAddress nodeAddress);
+
+ //Function: node_shortPing_v2
+ // Performs Version 2 of the Node Short Ping command.
+ //
+ //Parameters:
+ // nodeAddress - The node address of the Node to short ping.
+ //
+ //Returns:
+ // true if the short ping command succeeded, false otherwise.
+ //
+ //Exceptions:
+ // - : A connection error has occurred with the BaseStation.
+ bool node_shortPing_v2(NodeAddress nodeAddress);
+
//Function: node_readEeprom_v1
// Performs Version 1 of the Node Read Eeprom command.
//
@@ -830,26 +858,45 @@ namespace mscl
// - : A connection error has occurred with the BaseStation
bool node_writeEeprom_v2(NodeAddress nodeAddress, uint16 eepromAddress, uint16 value);
- public:
- //Function: node_lastCommunicationTime
- // Gets the for the last time MSCL communicated with the given node address.
+ //Function: node_autoBalance_v1
+ // Performs Version 1 of the Node AutoBalance command.
//
//Parameters:
- // nodeAddress - The node address of the Node to check for.
- const Timestamp& node_lastCommunicationTime(NodeAddress nodeAddress);
+ // nodeAddress - The node address of the Node to send the command to.
+ // channelNumber - The channel number (ch1 = 1, ch8 = 8) to balance.
+ // targetPercent - The target percentage (0 - 100) to balance to.
+ // result - The of the command (empty in the case of v1).
+ //
+ //Returns:
+ // true if the command succeeded, false if it failed.
+ //
+ //Exceptions:
+ // - : A connection error has occurred with the BaseStation.
+ bool node_autoBalance_v1(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result);
- //Function: node_shortPing
- // Pings a specific node
+ //Function: node_autoBalance_v2
+ // Performs Version 2 of the Node AutoBalance command.
//
//Parameters:
- // nodeAddress - the node address of the node to ping
+ // nodeAddress - The node address of the Node to send the command to.
+ // channelNumber - The channel number (ch1 = 1, ch8 = 8) to balance.
+ // targetPercent - The target percentage (0 - 100) to balance to.
+ // result - The of the command.
//
//Returns:
- // true if successfully pinged the node, false otherwise
+ // true if the command succeeded, false if it failed.
//
//Exceptions:
// - : A connection error has occurred with the BaseStation.
- bool node_shortPing(NodeAddress nodeAddress);
+ bool node_autoBalance_v2(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result);
+
+ public:
+ //Function: node_lastCommunicationTime
+ // Gets the for the last time MSCL communicated with the given node address.
+ //
+ //Parameters:
+ // nodeAddress - The node address of the Node to check for.
+ const Timestamp& node_lastCommunicationTime(NodeAddress nodeAddress);
//Function: node_ping
// Pings the specified Node.
@@ -892,6 +939,19 @@ namespace mscl
// - : A connection error has occurred with the BaseStation.
virtual SetToIdleStatus node_setToIdle(NodeAddress nodeAddress, const BaseStation& base);
+ //Function: node_shortPing
+ // Pings a specific node.
+ //
+ //Parameters:
+ // nodeAddress - the node address of the node to ping.
+ //
+ //Returns:
+ // true if successfully pinged the node, false otherwise
+ //
+ //Exceptions:
+ // - : A connection error has occurred with the BaseStation.
+ bool node_shortPing(NodeAddress nodeAddress);
+
//Function: node_readEeprom
// Reads a value from EEPROM on the specified Node.
//
@@ -1003,13 +1063,18 @@ namespace mscl
// Sends the AutoBalance command to a Node.
//
//Parameters:
+ // nodeProtocol - The for the Node.
// nodeAddress - The node address of the Node to send the command to.
// channelNumber - The channel number (ch1 = 1, ch8 = 8) to balance.
- // targetVal - The target value to balance to.
+ // targetPercent - The target percentage (0 - 100) to balance to.
+ // result - The of the command.
+ //
+ //Returns:
+ // true if the command succeeded, false if it failed.
//
//Exceptions:
// - : A connection error has occurred with the BaseStation.
- virtual void node_autoBalance(NodeAddress nodeAddress, uint8 channelNumber, uint16 targetVal);
+ virtual bool node_autoBalance(const WirelessProtocol& nodeProtocol, NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, AutoBalanceResult& result);
//Function: node_autocal
// Performs automatic calibration for a Wireless Node.
@@ -1026,5 +1091,20 @@ namespace mscl
//Exceptions:
// - : A connection error has occurred with the BaseStation.
bool node_autocal(NodeAddress nodeAddress, WirelessModels::NodeModel model, const Version& fwVersion, AutoCalResult& result);
+
+ //Function: node_readSingleSensor
+ // Reads the bits value for a single channel on a Wireless Node.
+ //
+ //Parameters:
+ // nodeAddress - The node address of the Node to send the command to.
+ // channelNumber - The channel number (ch1 = 1, ch8 = 8) to read.
+ // result - Holds the bits value result from the channel on the Node.
+ //
+ //Returns:
+ // true if the Read Single Sensor command was successful, false otherwise.
+ //
+ //Exceptions:
+ // - : A connection error has occurred with the BaseStation.
+ bool node_readSingleSensor(NodeAddress nodeAddress, uint8 channelNumber, uint16& result);
};
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance.h b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance.h
index e28808a40..78996d8c0 100644
--- a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance.h
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance.h
@@ -27,7 +27,7 @@ namespace mscl
//Parameters:
// nodeAddress - The address of the Node to build the command for.
// channelNumber - The channel number to balance (ch1 = 1, ch8 = 8).
- // targetValue - The target sensor output value in bits.
+ // targetValue - The target sensor output value in bits (0-4096).
//
//Returns:
// A containing the command packet.
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalanceResult.cpp b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalanceResult.cpp
new file mode 100644
index 000000000..68f4ae5dd
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalanceResult.cpp
@@ -0,0 +1,32 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "AutoBalanceResult.h"
+
+namespace mscl
+{
+ AutoBalanceResult::AutoBalanceResult():
+ m_errorCode(WirelessTypes::autobalance_notComplete),
+ m_percentAchieved(0),
+ m_hardwareOffset(0)
+ {
+ }
+
+ WirelessTypes::AutoBalanceErrorFlag AutoBalanceResult::errorCode() const
+ {
+ return m_errorCode;
+ }
+
+ float AutoBalanceResult::percentAchieved() const
+ {
+ return m_percentAchieved;
+ }
+
+ uint16 AutoBalanceResult::hardwareOffset() const
+ {
+ return m_hardwareOffset;
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalanceResult.h b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalanceResult.h
new file mode 100644
index 000000000..8418d7c2a
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalanceResult.h
@@ -0,0 +1,63 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+//PUBLIC_HEADER
+#pragma once
+
+#include "mscl/MicroStrain/ByteStream.h"
+#include "mscl/MicroStrain/ResponsePattern.h"
+#include "mscl/MicroStrain/Wireless/WirelessTypes.h"
+#include "mscl/Types.h"
+
+namespace mscl
+{
+ //API Class: AutoBalanceResult
+ // Represents the result from an AutoBalance command.
+ class AutoBalanceResult
+ {
+ friend class AutoBalance_v2;
+ friend class BaseStation_Impl;
+ friend class WirelessNode_Impl;
+
+ protected:
+ //Variable: m_errorCode
+ // The error code from the response.
+ WirelessTypes::AutoBalanceErrorFlag m_errorCode;
+
+ //Variable: m_percentAchieved
+ // The percentage (0 - 100) achieved from the response.
+ float m_percentAchieved;
+
+ //Variable: m_hardwareOffset
+ // The new hardware offset from the response.
+ uint16 m_hardwareOffset;
+
+ public:
+ //API Default Constructor: AutoBalanceResult
+ // Creates an empty AutoBalanceResult object.
+ AutoBalanceResult();
+
+ //API Function: errorCode
+ // Gets the from the response.
+ //
+ //Returns:
+ // The from the autobalance response.
+ WirelessTypes::AutoBalanceErrorFlag errorCode() const;
+
+ //API Function: percentAchieved
+ // Gets the percentage that the channel was balanced to from the response.
+ //
+ //Returns:
+ // The new sampled channel value after the autobalance.
+ float percentAchieved() const;
+
+ //API Function: hardwareOffset
+ // Get the new hardware offset from the response.
+ //
+ //Returns:
+ // The new hardware offset value after the autobalance.
+ uint16 hardwareOffset() const;
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance_v2.cpp b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance_v2.cpp
new file mode 100644
index 000000000..135ad187e
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance_v2.cpp
@@ -0,0 +1,93 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "AutoBalance_v2.h"
+#include "mscl/MicroStrain/Wireless/Packets/WirelessPacket.h"
+
+namespace mscl
+{
+ ByteStream AutoBalance_v2::buildCommand(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent)
+ {
+ //build the command ByteStream
+ ByteStream cmd;
+ cmd.append_uint8(0xAA); //Start of Packet
+ cmd.append_uint8(0x05); //Delivery Stop Flag
+ cmd.append_uint8(0x00); //App Data Type
+ cmd.append_uint16(nodeAddress); //Node address
+ cmd.append_uint8(0x07); //Payload Length
+ cmd.append_uint16(0x0065); //Command Id
+ cmd.append_uint8(channelNumber); //Channel Number
+ cmd.append_float(targetPercent); //Target Balance Value
+
+ //calculate the checksum of bytes 2-13
+ uint16 checksum = cmd.calculateSimpleChecksum(1, 12);
+
+ cmd.append_uint16(checksum); //Checksum
+
+ return cmd;
+ }
+
+ AutoBalance_v2::Response::Response(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, std::weak_ptr collector):
+ ResponsePattern(collector),
+ m_nodeAddress(nodeAddress),
+ m_channelNumber(channelNumber),
+ m_targetPercent(targetPercent)
+ {
+ }
+
+ bool AutoBalance_v2::Response::match(const WirelessPacket& packet)
+ {
+ WirelessPacket::Payload payload = packet.payload();
+
+ //check the main bytes of the packet
+ if(packet.deliveryStopFlags().toByte() != 0x07 || //delivery stop flag
+ packet.type() != WirelessPacket::packetType_nodeSuccessReply || //app data type
+ packet.nodeAddress() != m_nodeAddress || //node address
+ payload.size() != 0x10 || //payload length
+ payload.read_uint16(0) != 0x0065 || //command id
+ payload.read_uint8(2) != m_channelNumber || //channel number (echo)
+ payload.read_float(3) != m_targetPercent //target percent (echo)
+ )
+ {
+ //failed to match some of the bytes
+ return false;
+ }
+
+ //if we made it here, the packet matches the response pattern
+
+ //error code
+ m_result.m_errorCode = static_cast(payload.read_uint8(7));
+
+ //sampled value
+ m_result.m_percentAchieved = payload.read_float(8);
+
+ //hardware offset
+ m_result.m_hardwareOffset = static_cast(payload.read_uint32(12));
+
+ switch(m_result.m_errorCode)
+ {
+ case WirelessTypes::autobalance_success:
+ case WirelessTypes::autobalance_maybeInvalid:
+ m_success = true;
+
+ default:
+ m_success = false;
+ }
+
+ //we have fully matched the response
+ m_fullyMatched = true;
+
+ //notify that the response was matched
+ m_matchCondition.notify();
+
+ return true;
+ }
+
+ const AutoBalanceResult& AutoBalance_v2::Response::result() const
+ {
+ return m_result;
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance_v2.h b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance_v2.h
new file mode 100644
index 000000000..2cafe5915
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoBalance_v2.h
@@ -0,0 +1,86 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#pragma once
+
+#include "mscl/MicroStrain/ByteStream.h"
+#include "mscl/MicroStrain/ResponsePattern.h"
+#include "mscl/MicroStrain/Wireless/WirelessTypes.h"
+#include "mscl/Types.h"
+#include "AutoBalanceResult.h"
+
+namespace mscl
+{
+ //Class: AutoBalance_v2
+ // Contains logic for the Auto Balance Node command (Version 2).
+ class AutoBalance_v2
+ {
+ private:
+ AutoBalance_v2(); //default constructor disabled
+ AutoBalance_v2(const AutoBalance_v2&); //copy constructor disabled
+ AutoBalance_v2& operator=(const AutoBalance_v2&); //assignment operator disabled
+
+ public:
+ //Function: buildCommand
+ // Builds the AutoBalance_v2 command packet.
+ //
+ //Parameters:
+ // nodeAddress - The address of the Node to build the command for.
+ // channelNumber - The channel number to balance (ch1 = 1, ch8 = 8).
+ // targetPercent - The target percentage to balance to (0 - 100).
+ //
+ //Returns:
+ // A containing the command packet.
+ static ByteStream buildCommand(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent);
+
+ //Class: Response
+ // Handles the response to the LongPing Node command
+ class Response: public ResponsePattern
+ {
+ public:
+ //Constructor: Response
+ // Creates a LongPing Response object
+ //
+ //Parameters:
+ // nodeAddress - the node address to check for in the response.
+ // channelNumber - The channel number to check for in the response.
+ // targetPercent - The target percentage (0-100) to check for in the response.
+ // collector - The used to register and unregister the response.
+ Response(NodeAddress nodeAddress, uint8 channelNumber, float targetPercent, std::weak_ptr collector);
+
+ private:
+ //Variable: m_nodeAddress
+ // The node address to look for in the response.
+ NodeAddress m_nodeAddress;
+
+ //Variable: m_channelNumber
+ // The channel number to look for in the response.
+ uint8 m_channelNumber;
+
+ //Variable: m_targetPercent
+ // The target percentage to look for in the response.
+ float m_targetPercent;
+
+ //Variable: m_result
+ // The containing info about the autobalance response.
+ AutoBalanceResult m_result;
+
+ public:
+ //Function: match
+ // Checks if the passed in matches the expected response pattern's bytes
+ //
+ //Parameters:
+ // packet - The in which to try to find the pattern
+ //
+ //Returns:
+ // true if the packet matches a response pattern, false otherwise
+ virtual bool match(const WirelessPacket& packet) override;
+
+ //Function: result
+ // Gets the of the command.
+ const AutoBalanceResult& result() const;
+ };
+ };
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.cpp b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.cpp
index 684b952af..6c80cbe08 100644
--- a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.cpp
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.cpp
@@ -12,95 +12,6 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
namespace mscl
{
- AutoCalResult::AutoCalResult():
- m_completionFlag(WirelessTypes::autocal_notComplete)
- {
- }
-
- WirelessTypes::AutoCalCompletionFlag AutoCalResult::completionFlag() const
- {
- return m_completionFlag;
- }
-
- //=====================================================
- //AutoCalResult_shmLink
- //=====================================================
- AutoCalResult_shmLink::AutoCalResult_shmLink():
- AutoCalResult(),
- m_errorFlagCh1(WirelessTypes::autocalError_none),
- m_errorFlagCh2(WirelessTypes::autocalError_none),
- m_errorFlagCh3(WirelessTypes::autocalError_none),
- m_offsetCh1(0.0f),
- m_offsetCh2(0.0f),
- m_offsetCh3(0.0f),
- m_temperature(0.0f)
- {
- }
-
- WirelessTypes::AutoCalErrorFlag AutoCalResult_shmLink::errorFlagCh1() const
- {
- return m_errorFlagCh1;
- }
-
- WirelessTypes::AutoCalErrorFlag AutoCalResult_shmLink::errorFlagCh2() const
- {
- return m_errorFlagCh2;
- }
-
- WirelessTypes::AutoCalErrorFlag AutoCalResult_shmLink::errorFlagCh3() const
- {
- return m_errorFlagCh3;
- }
-
- float AutoCalResult_shmLink::offsetCh1() const
- {
- return m_offsetCh1;
- }
-
- float AutoCalResult_shmLink::offsetCh2() const
- {
- return m_offsetCh2;
- }
-
- float AutoCalResult_shmLink::offsetCh3() const
- {
- return m_offsetCh3;
- }
-
- float AutoCalResult_shmLink::temperature() const
- {
- return m_temperature;
- }
-
- void AutoCalResult_shmLink::parse(const Bytes& autoCalInfo)
- {
- if(autoCalInfo.size() < 19)
- {
- assert(false);
- return;
- }
-
- typedef WirelessTypes WT;
-
- DataBuffer data(autoCalInfo);
-
- //Ch1 error flag and offset
- m_errorFlagCh1 = static_cast(data.read_uint8());
- m_offsetCh1 = data.read_float();
-
- //Ch2 error flag and offset
- m_errorFlagCh2 = static_cast(data.read_uint8());
- m_offsetCh2 = data.read_float();
-
- //Ch3 error flag and offset
- m_errorFlagCh3 = static_cast(data.read_uint8());
- m_offsetCh3 = data.read_float();
-
- //temperature at time of cal
- m_temperature = data.read_float();
- }
-
-
//=====================================================
//AutoCal
//=====================================================
@@ -189,6 +100,7 @@ namespace mscl
switch(m_model)
{
case WirelessModels::node_shmLink2:
+ case WirelessModels::node_shmLink2_cust1:
{
if(!match_shmLink(packet))
{
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.h b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.h
index 544c604aa..b06278b94 100644
--- a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.h
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCal.h
@@ -3,7 +3,6 @@ Copyright(c) 2015 LORD Corporation. All rights reserved.
MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
*******************************************************************************/
-//PUBLIC_HEADER
#pragma once
#include "mscl/Types.h"
@@ -15,111 +14,8 @@ MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
namespace mscl
{
- //API Title: AutoCal
-
class WirelessPacket;
- //API Class: AutoCalResult
- // Abstract base class for AutoCal result classes.
- class AutoCalResult
- {
- friend class BaseStation_Impl;
-
- public:
- AutoCalResult();
- virtual ~AutoCalResult() {};
-
- //API Function: completionFlag
- // Gets the of the AutoCal operation result.
- WirelessTypes::AutoCalCompletionFlag completionFlag() const;
-
- protected:
- //Function: parse
- // Parses the auto cal info bytes sent in the successful response packet.
- //
- //Parameters:
- // autoCalInfo - The bytes from a successful auto cal command.
- virtual void parse(const Bytes& autoCalInfo) = 0;
-
- //Variable: m_completionFlag
- // The of the AutoCal operation.
- WirelessTypes::AutoCalCompletionFlag m_completionFlag;
- };
-
- //API Class: AutoCalResult_shmLink
- // Holds the result information from an autoCal_shmLink command.
- class AutoCalResult_shmLink : public AutoCalResult
- {
- private:
- //Variable: m_errorFlagCh1
- // The for the channel 1 strain sensor.
- WirelessTypes::AutoCalErrorFlag m_errorFlagCh1;
-
- //Variable: m_errorFlagCh2
- // The for the channel 2 strain sensor.
- WirelessTypes::AutoCalErrorFlag m_errorFlagCh2;
-
- //Variable: m_errorFlagCh3
- // The for the channel 3 strain sensor.
- WirelessTypes::AutoCalErrorFlag m_errorFlagCh3;
-
- //Variable: m_offsetCh1
- // The offset applied for the channel 1 strain sensor.
- float m_offsetCh1;
-
- //Variable: m_offsetCh2
- // The offset applied for the channel 2 strain sensor.
- float m_offsetCh2;
-
- //Variable: m_offsetCh3
- // The offset applied for the channel 3 strain sensor.
- float m_offsetCh3;
-
- //Variable: m_temperature
- // The temperature at the time of calibration.
- float m_temperature;
-
- public:
- AutoCalResult_shmLink();
- virtual ~AutoCalResult_shmLink() {};
-
- //API Function: errorFlagCh1
- // Gets the for the channel 1 strain sensor.
- WirelessTypes::AutoCalErrorFlag errorFlagCh1() const;
-
- //API Function: errorFlagCh2
- // Gets the for the channel 2 strain sensor.
- WirelessTypes::AutoCalErrorFlag errorFlagCh2() const;
-
- //API Function: errorFlagCh3
- // Gets the for the channel 3 strain sensor.
- WirelessTypes::AutoCalErrorFlag errorFlagCh3() const;
-
- //API Function: offsetCh1
- // Gets the offset applied for the channel 1 strain sensor.
- float offsetCh1() const;
-
- //API Function: offsetCh2
- // Gets the offset applied for the channel 2 strain sensor.
- float offsetCh2() const;
-
- //API Function: offsetCh3
- // Gets the offset applied for the channel 3 strain sensor.
- float offsetCh3() const;
-
- //API Function: temperature
- // Gets the temperature (in °C) at the time of the calibration.
- float temperature() const;
-
- protected:
- //Function: parse
- // Parses the auto cal info bytes for the shm-link.
- virtual void parse(const Bytes& autoCalInfo) final;
- };
-
-
-
-#ifndef SWIG
//Class: AutoCal
// Contains logic for the AutoCal Node command.
class AutoCal
@@ -245,6 +141,4 @@ namespace mscl
bool match_shmLink(const WirelessPacket& packet);
};
};
-#endif
-
}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCalResult.cpp b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCalResult.cpp
new file mode 100644
index 000000000..b847959b6
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCalResult.cpp
@@ -0,0 +1,98 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+#include "stdafx.h"
+#include "AutoCalResult.h"
+
+namespace mscl
+{
+ AutoCalResult::AutoCalResult():
+ m_completionFlag(WirelessTypes::autocal_notComplete)
+ {
+ }
+
+ WirelessTypes::AutoCalCompletionFlag AutoCalResult::completionFlag() const
+ {
+ return m_completionFlag;
+ }
+
+ //=====================================================
+ //AutoCalResult_shmLink
+ //=====================================================
+ AutoCalResult_shmLink::AutoCalResult_shmLink():
+ AutoCalResult(),
+ m_errorFlagCh1(WirelessTypes::autocalError_none),
+ m_errorFlagCh2(WirelessTypes::autocalError_none),
+ m_errorFlagCh3(WirelessTypes::autocalError_none),
+ m_offsetCh1(0.0f),
+ m_offsetCh2(0.0f),
+ m_offsetCh3(0.0f),
+ m_temperature(0.0f)
+ {
+ }
+
+ WirelessTypes::AutoCalErrorFlag AutoCalResult_shmLink::errorFlagCh1() const
+ {
+ return m_errorFlagCh1;
+ }
+
+ WirelessTypes::AutoCalErrorFlag AutoCalResult_shmLink::errorFlagCh2() const
+ {
+ return m_errorFlagCh2;
+ }
+
+ WirelessTypes::AutoCalErrorFlag AutoCalResult_shmLink::errorFlagCh3() const
+ {
+ return m_errorFlagCh3;
+ }
+
+ float AutoCalResult_shmLink::offsetCh1() const
+ {
+ return m_offsetCh1;
+ }
+
+ float AutoCalResult_shmLink::offsetCh2() const
+ {
+ return m_offsetCh2;
+ }
+
+ float AutoCalResult_shmLink::offsetCh3() const
+ {
+ return m_offsetCh3;
+ }
+
+ float AutoCalResult_shmLink::temperature() const
+ {
+ return m_temperature;
+ }
+
+ void AutoCalResult_shmLink::parse(const Bytes& autoCalInfo)
+ {
+ if(autoCalInfo.size() < 19)
+ {
+ assert(false);
+ return;
+ }
+
+ typedef WirelessTypes WT;
+
+ DataBuffer data(autoCalInfo);
+
+ //Ch1 error flag and offset
+ m_errorFlagCh1 = static_cast(data.read_uint8());
+ m_offsetCh1 = data.read_float();
+
+ //Ch2 error flag and offset
+ m_errorFlagCh2 = static_cast(data.read_uint8());
+ m_offsetCh2 = data.read_float();
+
+ //Ch3 error flag and offset
+ m_errorFlagCh3 = static_cast(data.read_uint8());
+ m_offsetCh3 = data.read_float();
+
+ //temperature at time of cal
+ m_temperature = data.read_float();
+ }
+}
\ No newline at end of file
diff --git a/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCalResult.h b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCalResult.h
new file mode 100644
index 000000000..628739bec
--- /dev/null
+++ b/MSCL/source/mscl/MicroStrain/Wireless/Commands/AutoCalResult.h
@@ -0,0 +1,117 @@
+/*******************************************************************************
+Copyright(c) 2015 LORD Corporation. All rights reserved.
+
+MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
+*******************************************************************************/
+//PUBLIC_HEADER
+#pragma once
+
+#include "mscl/Types.h"
+#include "mscl/Version.h"
+#include "mscl/MicroStrain/ByteStream.h"
+#include "mscl/MicroStrain/ResponsePattern.h"
+#include "mscl/MicroStrain/Wireless/WirelessModels.h"
+#include "mscl/MicroStrain/Wireless/WirelessTypes.h"
+
+namespace mscl
+{
+ class WirelessPacket;
+
+ //API Class: AutoCalResult
+ // Abstract base class for AutoCal result classes.
+ class AutoCalResult
+ {
+ friend class BaseStation_Impl;
+
+ public:
+ AutoCalResult();
+ virtual ~AutoCalResult() {};
+
+ //API Function: completionFlag
+ // Gets the of the AutoCal operation result.
+ WirelessTypes::AutoCalCompletionFlag completionFlag() const;
+
+ protected:
+ //Function: parse
+ // Parses the auto cal info bytes sent in the successful response packet.
+ //
+ //Parameters:
+ // autoCalInfo - The bytes from a successful auto cal command.
+ virtual void parse(const Bytes& autoCalInfo) = 0;
+
+ //Variable: m_completionFlag
+ // The of the AutoCal operation.
+ WirelessTypes::AutoCalCompletionFlag m_completionFlag;
+ };
+
+ //API Class: AutoCalResult_shmLink
+ // Holds the result information from an autoCal_shmLink command.
+ class AutoCalResult_shmLink : public AutoCalResult
+ {
+ private:
+ //Variable: m_errorFlagCh1
+ // The for the channel 1 strain sensor.
+ WirelessTypes::AutoCalErrorFlag m_errorFlagCh1;
+
+ //Variable: m_errorFlagCh2
+ // The for the channel 2 strain sensor.
+ WirelessTypes::AutoCalErrorFlag m_errorFlagCh2;
+
+ //Variable: m_errorFlagCh3
+ // The for the channel 3 strain sensor.
+ WirelessTypes::AutoCalErrorFlag m_errorFlagCh3;
+
+ //Variable: m_offsetCh1
+ // The offset applied for the channel 1 strain sensor.
+ float m_offsetCh1;
+
+ //Variable: m_offsetCh2
+ // The offset applied for the channel 2 strain sensor.
+ float m_offsetCh2;
+
+ //Variable: m_offsetCh3
+ // The offset applied for the channel 3 strain sensor.
+ float m_offsetCh3;
+
+ //Variable: m_temperature
+ // The temperature at the time of calibration.
+ float m_temperature;
+
+ public:
+ AutoCalResult_shmLink();
+ virtual ~AutoCalResult_shmLink() {};
+
+ //API Function: errorFlagCh1
+ // Gets the for the channel 1 strain sensor.
+ WirelessTypes::AutoCalErrorFlag errorFlagCh1() const;
+
+ //API Function: errorFlagCh2
+ // Gets the