LibMultiSense
LibMultiSense Documentation
crl::multisense::imu::Config Class Reference

Class used to store a specific IMU configuration. More...

#include <MultiSenseTypes.hh>

Public Attributes

std::string name
 The name of a specific IMU source corresponding to crl::multisense::imu::Info::name. More...
 
bool enabled
 A boolean flag indicating whether the given IMU source is currently enabled. More...
 
uint32_t rateTableIndex
 The index into the rate table for a given IMU source specified in crl::multisense::imu::Info::rates. More...
 
uint32_t rangeTableIndex
 The index into the range table for a given IMU source specified in crl::multisense::imu::Info::ranges. More...
 

Detailed Description

Class used to store a specific IMU configuration.

Example code to query a IMU configuration:

//
// Instantiate a channel connecting to a sensor at the factory default
// IP address
channel = crl::multisense::Channel::Create("10.66.171.21");
channel->setMtu(7200);
//
// Create local variables to store the information returned by
// reference from getImuConfig().
std::vector<crl::multisense::imu::Config> imuConfigVect;
uint32_t samplesPerMessage;
//
// Query the IMU configuration from the Channel instance
crl::multisense::Status status = channel->getImuConfig(samplesPerMessage, imuConfigVect);
//
// Check to see if the IMU configuration query was successful
throw std::runtime_error("Unable to query the imu configuration");
}
//
// Use the IMU configuration...
//
// Destroy the channel instance

Example code to set a IMU configuration:

//
// Instantiate a channel connecting to a sensor at the factory default
// IP address
channel = crl::multisense::Channel::Create("10.66.171.21");
channel->setMtu(7200);
//
// Create a vector of IMU configurations to store the queried IMU configuration
std::vector<crl::multisense::imu::Config> imuConfigVect;
//
// Create a uint32_t to store the samplesPerMessage quantity returned
// by reference from getImuConfig
uint32_t samplesPerMessage;
//
// Query the IMU configuration from the Channel instance
status = channel->getImuConfig(samplesPerMessage, imuConfigVect);
//
// Check to see if the IMU configuration query was successful
throw std::runtime_error("Unable to query the imu configuration");
}
//
// Enable streaming for the IMU device at index 0 and select the
// rate corresponding to index 0 in crl::multisense::imu::Info::rates for
// the corresponding IMU device
imuConfigVect[0].enabled = true;
imuConfigVect[0].rateTableIndex = 0;
//
// Do not store these new settings in flash
bool storeSettings = false;
//
// Set the new IMU configuration. Keep the same samplesPerMessage setting
// indicated by the 0 value
crl::multisense::Status status = channel->setImuConfig(storeSettings, 0, imuConfigVect);
//
// Check to see if the new IMU configuration was successfully received.
throw std::runtime_error("Unable to set the imu configuration");
}
//
// Destroy the channel instance

Definition at line 2423 of file MultiSenseTypes.hh.

Member Data Documentation

◆ enabled

bool crl::multisense::imu::Config::enabled

A boolean flag indicating whether the given IMU source is currently enabled.

Definition at line 2430 of file MultiSenseTypes.hh.

◆ name

std::string crl::multisense::imu::Config::name

The name of a specific IMU source corresponding to crl::multisense::imu::Info::name.

Definition at line 2428 of file MultiSenseTypes.hh.

◆ rangeTableIndex

uint32_t crl::multisense::imu::Config::rangeTableIndex

The index into the range table for a given IMU source specified in crl::multisense::imu::Info::ranges.

Definition at line 2436 of file MultiSenseTypes.hh.

◆ rateTableIndex

uint32_t crl::multisense::imu::Config::rateTableIndex

The index into the rate table for a given IMU source specified in crl::multisense::imu::Info::rates.

Definition at line 2433 of file MultiSenseTypes.hh.


The documentation for this class was generated from the following file:
crl::multisense::Channel
Class which manages all communications with a MultiSense device.
Definition: MultiSenseChannel.hh:69
crl::multisense::Status_Ok
static CRL_CONSTEXPR Status Status_Ok
Definition: MultiSenseTypes.hh:98
crl::multisense::Channel::setImuConfig
virtual Status setImuConfig(bool storeSettingsInFlash, uint32_t samplesPerMessage, const std::vector< imu::Config > &c)=0
Set a new IMU configuration.
crl::multisense::Channel::Destroy
static void Destroy(Channel *instanceP)
Destroy a channel instance that was created using the static member function Channel::Create().
crl::multisense::Status
int32_t Status
General status typdef used as a return value for get/set crl::multisense::Channel methods.
Definition: MultiSenseTypes.hh:93
crl::multisense::Channel::setMtu
virtual Status setMtu(int32_t mtu)=0
Set the current sensor's MTU.
crl::multisense::Channel::getImuConfig
virtual Status getImuConfig(uint32_t &samplesPerMessage, std::vector< imu::Config > &c)=0
Query the current IMU configuration.
crl::multisense::Channel::Create
static Channel * Create(const std::string &sensorAddress)
Create a Channel instance, used to manage all communications with a sensor.