mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 04:43:33 +08:00
sensors: print status of temp compensation with 'sensors status'
This commit is contained in:
@@ -41,8 +41,8 @@
|
|||||||
|
|
||||||
#include "temperature_compensation.h"
|
#include "temperature_compensation.h"
|
||||||
#include <systemlib/param/param.h>
|
#include <systemlib/param/param.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <px4_defines.h>
|
#include <px4_defines.h>
|
||||||
|
#include <px4_log.h>
|
||||||
|
|
||||||
namespace sensors
|
namespace sensors
|
||||||
{
|
{
|
||||||
@@ -422,4 +422,44 @@ int TemperatureCompensation::apply_corrections_baro(int topic_instance, float &s
|
|||||||
return 1;
|
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,
|
int apply_corrections_baro(int topic_instance, float &sensor_data, float temperature,
|
||||||
float *offsets, float *scales);
|
float *offsets, float *scales);
|
||||||
|
|
||||||
|
/** output current configuration status to console */
|
||||||
|
void print_status();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/* Struct containing parameters used by the single axis 5th order temperature compensation algorithm
|
/* Struct containing parameters used by the single axis 5th order temperature compensation algorithm
|
||||||
|
|||||||
@@ -873,6 +873,8 @@ void VotedSensorsUpdate::print_status()
|
|||||||
_mag.voter.print();
|
_mag.voter.print();
|
||||||
PX4_INFO("baro status:");
|
PX4_INFO("baro status:");
|
||||||
_baro.voter.print();
|
_baro.voter.print();
|
||||||
|
|
||||||
|
_temperature_compensation.print_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
Reference in New Issue
Block a user