mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
sensors: print status of temp compensation with 'sensors status'
This commit is contained in:
parent
916a04bc56
commit
fd48d9c190
@ -41,8 +41,8 @@
|
||||
|
||||
#include "temperature_compensation.h"
|
||||
#include <systemlib/param/param.h>
|
||||
#include <stdio.h>
|
||||
#include <px4_defines.h>
|
||||
#include <px4_log.h>
|
||||
|
||||
namespace sensors
|
||||
{
|
||||
@ -422,4 +422,44 @@ int TemperatureCompensation::apply_corrections_baro(int topic_instance, float &s
|
||||
return 1;
|
||||
}
|
||||
|
||||
void TemperatureCompensation::print_status()
|
||||
{
|
||||
PX4_INFO("Temperature Compensation:");
|
||||
PX4_INFO(" gyro: enabled: %i", _parameters.gyro_tc_enable);
|
||||
|
||||
if (_parameters.gyro_tc_enable == 1) {
|
||||
for (int i = 0; i < SENSOR_COUNT_MAX; ++i) {
|
||||
uint8_t mapping = _gyro_data.device_mapping[i];
|
||||
|
||||
if (_gyro_data.device_mapping[i] != 255) {
|
||||
PX4_INFO(" using device ID %i for topic instance %i", _parameters.gyro_cal_data[mapping].ID, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PX4_INFO(" accel: enabled: %i", _parameters.accel_tc_enable);
|
||||
|
||||
if (_parameters.accel_tc_enable == 1) {
|
||||
for (int i = 0; i < SENSOR_COUNT_MAX; ++i) {
|
||||
uint8_t mapping = _accel_data.device_mapping[i];
|
||||
|
||||
if (_accel_data.device_mapping[i] != 255) {
|
||||
PX4_INFO(" using device ID %i for topic instance %i", _parameters.accel_cal_data[mapping].ID, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PX4_INFO(" baro: enabled: %i", _parameters.baro_tc_enable);
|
||||
|
||||
if (_parameters.baro_tc_enable == 1) {
|
||||
for (int i = 0; i < SENSOR_COUNT_MAX; ++i) {
|
||||
uint8_t mapping = _baro_data.device_mapping[i];
|
||||
|
||||
if (_baro_data.device_mapping[i] != 255) {
|
||||
PX4_INFO(" using device ID %i for topic instance %i", _parameters.baro_cal_data[mapping].ID, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -91,6 +91,8 @@ public:
|
||||
int apply_corrections_baro(int topic_instance, float &sensor_data, float temperature,
|
||||
float *offsets, float *scales);
|
||||
|
||||
/** output current configuration status to console */
|
||||
void print_status();
|
||||
private:
|
||||
|
||||
/* Struct containing parameters used by the single axis 5th order temperature compensation algorithm
|
||||
|
||||
@ -873,6 +873,8 @@ void VotedSensorsUpdate::print_status()
|
||||
_mag.voter.print();
|
||||
PX4_INFO("baro status:");
|
||||
_baro.voter.print();
|
||||
|
||||
_temperature_compensation.print_status();
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user