8 #include <gtest/gtest.h> 14 namespace configuration
61 EXPECT_DOUBLE_EQ(matrix(0, 0), 1);
62 EXPECT_DOUBLE_EQ(matrix(1, 0), 1);
63 EXPECT_DOUBLE_EQ(matrix(2, 0), 1);
64 EXPECT_DOUBLE_EQ(matrix(3, 0), 1);
65 EXPECT_DOUBLE_EQ(matrix(4, 0), 1);
66 EXPECT_DOUBLE_EQ(matrix(5, 0), 1);
73 EXPECT_EQ(use_custom_calibration,
true);
80 EXPECT_EQ(set_reading_to_nan_on_disconnect,
true);
87 EXPECT_EQ(sensor_configuration.getCalibrationMatrixActive(),
true);
88 EXPECT_EQ(sensor_configuration.getTemperatureCompensationActive(),
true);
89 EXPECT_EQ(sensor_configuration.getImuActive(),
false);
90 EXPECT_EQ(sensor_configuration.getCoordinateSystemConfigurationActive(),
false);
91 EXPECT_EQ(sensor_configuration.getInertiaCompensationActive(),
false);
92 EXPECT_EQ(sensor_configuration.getOrientationEstimationActive(),
true);
97 Eigen::Matrix<double, 6, 6> calibration_matrix = Eigen::Matrix<double, 6, 6>::Identity();
99 sensor_calibration.setCalibrationMatrix(calibration_matrix);
102 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(0, 0), 1);
103 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(0, 1), 0);
104 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(0, 2), 0);
105 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(0, 3), 0);
106 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(0, 4), 0);
107 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(0, 5), 0);
109 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(1, 0), 0);
110 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(1, 1), 1);
111 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(1, 2), 0);
112 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(1, 3), 0);
113 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(1, 4), 0);
114 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(1, 5), 0);
116 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(2, 0), 0);
117 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(2, 1), 0);
118 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(2, 2), 1);
119 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(2, 3), 0);
120 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(2, 4), 0);
121 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(2, 5), 0);
123 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(3, 0), 0);
124 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(3, 1), 0);
125 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(3, 2), 0);
126 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(3, 3), 1);
127 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(3, 4), 0);
128 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(3, 5), 0);
130 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(4, 0), 0);
131 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(4, 1), 0);
132 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(4, 2), 0);
133 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(4, 3), 0);
134 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(4, 4), 1);
135 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(4, 5), 0);
137 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(5, 0), 0);
138 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(5, 1), 0);
139 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(5, 2), 0);
140 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(5, 3), 0);
141 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(5, 4), 0);
142 EXPECT_DOUBLE_EQ(calibration_expected.getCalibrationMatrix()(5, 5), 1);
149 EXPECT_EQ(imu_acceleration_filter, (
unsigned int)128);
156 EXPECT_EQ(imu_angular_rate_filter, (
unsigned int)128);
163 EXPECT_EQ(imu_acceleration_range, 15);
170 EXPECT_EQ(imu_angular_rate_range, 15);
uint8_t getChopEnable() const
Gets the chopEnable variable.
void setUseCustomCalibration(const bool useCustomCalibration)
Sets the useCustomCalibration variable.
Class holding the force-torque filter settings.
bool getSetReadingToNanOnDisconnect() const
Gets the setReadingToNanOnDisconnect variable.
Class holding the configuration of the sensor.
const ForceTorqueFilter & getForceTorqueFilter() const
Gets the forceTorqueFilter variable.
void setImuAccelerationRange(const uint8_t imuAccelerationRange)
Sets the imuAccelerationRange variable.
void setImuAngularRateRange(const uint8_t imuAngularRateRange)
Sets the imuAngularRateRange variable.
void setSensorConfiguration(const SensorConfiguration &sensorConfiguration)
Sets the sensorConfiguration variable.
const Eigen::Matrix< double, 6, 1 > & getForceTorqueOffset() const
Gets the forceTorqueOffset variable.
bool getUseCustomCalibration() const
Gets the useCustomCalibration variable.
Configuration * configuration
unsigned int getImuAngularRateFilter() const
Gets the imuAccelerationFilter variable.
Class holding the sensor configuration settings.
uint8_t getFastEnable() const
Gets the fastEnable variable.
The SensorCalibration class is used for holding the calibration information of each rokubi mini senso...
uint8_t getSkipEnable() const
Gets the skipEnable variable.
uint8_t getImuAccelerationRange() const
Gets the imuAccelerationRange variable.
void setForceTorqueFilter(const ForceTorqueFilter &forceTorqueFilter)
Sets the forceTorqueFilter variable.
void setImuAccelerationFilter(const unsigned int imuAccelerationFilter)
Sets the imuAccelerationFilter variable.
void setSetReadingToNanOnDisconnect(const bool setReadingToNanOnDisconnect)
Sets the setReadingToNanOnDisconnect variable.
const calibration::SensorCalibration & getSensorCalibration() const
Gets the sensorCalibration variable.
unsigned int getImuAccelerationFilter() const
uint8_t getImuAngularRateRange() const
Gets the imuAngularRateRange variable.
void setSensorCalibration(const calibration::SensorCalibration &sensorCalibration)
Sets the sensorCalibration variable.
uint16_t getSincFilterSize() const
Gets the sincFilterSize variable.
~ConfigurationTest() override
void setForceTorqueOffset(const Eigen::Matrix< double, 6, 1 > &forceTorqueOffset)
Sets the forceTorqueOffset variable.
TEST_F(ConfigurationTest, forceTorqueFilterWorksCorrectly)
void setImuAngularRateFilter(const unsigned int imuAngularRateFilter)
Sets the imuAngularRateFilter variable.
const SensorConfiguration & getSensorConfiguration() const
Gets the sensorConfiguration variable.