102 const Eigen::Vector3f& b);
114 const Eigen::Vector3f& b);
126 const Eigen::Vector3f& b);
190 bool setCrc(
bool waitResponse =
true);
222 template <
typename T>
309 const std::chrono::milliseconds maxTimeout;
314 const char*
const sampleCommand)
316 uint8_t initByte = 0;
Driver for STM32F4 low level USART/UART peripheral.
void writeString(const char *buffer)
Write a string to the serial, comprising the '\0' character.
void clearQueue()
Clears the rxQueue.
virtual bool readBlocking(void *buffer, size_t nBytes, std::chrono::nanoseconds timeout=std::chrono::nanoseconds::zero())
Blocking read operation to read nBytes until the data transfer is complete or the timeout is reached.
uint8_t checkErrorVN(const char *message)
Check if the message received from the sensor contains an error.
uint16_t calculateChecksum16(const uint8_t *message, int length)
Calculate the 16bit array on the given array.
bool getBinaryOutput(T &binaryData, const char *const sampleCommand)
Utility function used to retrieve the binary output from the sensor.
bool saveConfiguration()
Write the current register settings into non-volatile memory. Once the settings are stored in non-vol...
bool setCrc(bool waitResponse=true)
Sets the user selected crc method.
bool setMagnetometerCompensation(const Eigen::Matrix3f &c, const Eigen::Vector3f &b)
Set custom compensation parameters for the magnetometer.
bool startHSIEstimator(uint8_t convergeRate)
Start the real-time hard/soft iron calibration. The algorithm will continue until stopHSIEstimator() ...
VNCommonSerial(USART &usart, int baudrate, const char *sensorName, CRCOptions crc, const std::chrono::milliseconds timeout)
Constructor.
static const uint8_t recvStringMaxDimension
Maximum size of the receiving string.
bool verifyModelNumber(const char *expectedModelNumber)
Verify the model number of the sensor.
bool stopHSIEstimator()
Real-time hard/soft iron calibration algorithm is turned off.
bool disableAsyncMessages(bool waitResponse)
Disables the async messages that the sensor is default configured to send at 40Hz on startup.
static const int DEFAULT_BAUDRATE
Default baudrate value for the usart communication.
bool closeAndReset()
Method to reset the sensor to default values and to close the connection. Used if you need to close a...
std::array< char, recvStringMaxDimension > recvString
Buffer used to store the string received from the sensor.
bool restoreFactorySettings()
Restore the VN module’s factory default settings and reset the module.
bool recvStringCommand(char *command, int maxLength)
Receives a command from the sensor but swaps the first with a \0 to close the message.
uint8_t recvStringLength
Actual strlen() of the recvString.
bool setGyroscopeCompensation(const Eigen::Matrix3f &c, const Eigen::Vector3f &b)
Set custom compensation parameters for the gyroscope.
bool configUserSerialPort()
Configures the user defined serial communication.
void configDefaultSerialPort()
Configures the default serial communication.
bool verifyChecksum(char *command, int maxLength)
Method to verify the crc validity of a command.
bool sendStringCommand(std::string command)
Sends the command to the sensor with the correct checksum added so '*' symbol is not needed at the en...
std::string getHSIEstimatorValues()
bool writeRegister(const std::string &command)
Utility function used to set a register on the sensor. This function relies on sendStringCommand: DO ...
USART & usart
Serial interface that is needed to communicate with the sensor via ASCII codes.
bool setAccelerometerCompensation(const Eigen::Matrix3f &c, const Eigen::Vector3f &b)
Set custom compensation parameters for the accelerometer.
uint8_t calculateChecksum8(const uint8_t *message, int length)
Calculate the 8bit checksum on the given array.
This file includes all the types the logdecoder script will decode.