smaller bugfixes

This commit is contained in:
Robin Müller 2021-05-25 15:16:18 +02:00 committed by Robin Mueller
parent b91a26c7d7
commit f11ac3519e
2 changed files with 13 additions and 10 deletions

@ -1 +1 @@
Subproject commit 61d7c61852d19c91f798d6cfbe4a6fc694cda5df
Subproject commit 6487c88fc99ed8021b2d42cc1de9cba1b50d01d4

View File

@ -151,7 +151,7 @@ ReturnValue_t GyroADIS16507Handler::handleSensorData(const uint8_t *packet) {
/* Now verify the read checksum with the expected checksum
according to datasheet p. 20 */
uint16_t calcChecksum = 0;
for(size_t idx = 2; idx < 22; idx ++) {
for(size_t idx = 2; idx < 20; idx ++) {
calcChecksum += packet[idx];
}
if(checksum != calcChecksum) {
@ -183,13 +183,13 @@ ReturnValue_t GyroADIS16507Handler::handleSensorData(const uint8_t *packet) {
int16_t accelXRaw = packet[10] << 8 | packet[11];
primaryDataset.accelX.value = static_cast<float>(accelXRaw) / INT16_MAX *
ADIS16507::GYRO_RANGE;
ADIS16507::ACCELEROMETER_RANGE;
int16_t accelYRaw = packet[12] << 8 | packet[13];
primaryDataset.accelY.value = static_cast<float>(accelYRaw) / INT16_MAX *
ADIS16507::GYRO_RANGE;
ADIS16507::ACCELEROMETER_RANGE;
int16_t accelZRaw = packet[14] << 8 | packet[15];
primaryDataset.accelZ.value = static_cast<float>(accelZRaw) / INT16_MAX *
ADIS16507::GYRO_RANGE;
ADIS16507::ACCELEROMETER_RANGE;
int16_t temperatureRaw = packet[16] << 8 | packet[17];
primaryDataset.temperature.value = static_cast<float>(temperatureRaw) * 0.1;
@ -199,11 +199,14 @@ ReturnValue_t GyroADIS16507Handler::handleSensorData(const uint8_t *packet) {
#if ADIS16507_DEBUG == 1
if(debugDivider->checkAndIncrement()) {
sif::info << "GyroADIS16507Handler: Angular velocities in degrees per second:" <<
std::endl;
sif::info << "X: " << primaryDataset.angVelocX.value << " \xC2\xB0" << std::endl;
sif::info << "Y: " << primaryDataset.angVelocY.value << " \xC2\xB0" << std::endl;
sif::info << "Z: " << primaryDataset.angVelocZ.value << " \xC2\xB0" << std::endl;
sif::info << "GyroADIS16507Handler: Angular velocities in deg / s" << std::endl;
sif::info << "X: " << primaryDataset.angVelocX.value << std::endl;
sif::info << "Y: " << primaryDataset.angVelocY.value << std::endl;
sif::info << "Z: " << primaryDataset.angVelocZ.value << std::endl;
sif::info << "GyroADIS16507Handler: Accelerations in m / s^2: " << std::endl;
sif::info << "X: " << primaryDataset.accelX.value << std::endl;
sif::info << "Y: " << primaryDataset.accelY.value << std::endl;
sif::info << "Z: " << primaryDataset.accelZ.value << std::endl;
}
#endif