mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
temperature_calibration:Use inttypes
This commit is contained in:
committed by
Julian Oes
parent
d73f842151
commit
77082188d8
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2020 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2016-2020, 2021 PX4 Development Team. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -433,38 +433,38 @@ int TemperatureCompensation::update_offsets_baro(int topic_instance, float tempe
|
|||||||
void TemperatureCompensation::print_status()
|
void TemperatureCompensation::print_status()
|
||||||
{
|
{
|
||||||
PX4_INFO("Temperature Compensation:");
|
PX4_INFO("Temperature Compensation:");
|
||||||
PX4_INFO(" gyro: enabled: %i", _parameters.gyro_tc_enable);
|
PX4_INFO(" gyro: enabled: %" PRId32, _parameters.gyro_tc_enable);
|
||||||
|
|
||||||
if (_parameters.gyro_tc_enable == 1) {
|
if (_parameters.gyro_tc_enable == 1) {
|
||||||
for (int i = 0; i < GYRO_COUNT_MAX; ++i) {
|
for (int i = 0; i < GYRO_COUNT_MAX; ++i) {
|
||||||
uint8_t mapping = _gyro_data.device_mapping[i];
|
uint8_t mapping = _gyro_data.device_mapping[i];
|
||||||
|
|
||||||
if (_gyro_data.device_mapping[i] != 255) {
|
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(" using device ID %" PRId32 " for topic instance %i", _parameters.gyro_cal_data[mapping].ID, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PX4_INFO(" accel: enabled: %i", _parameters.accel_tc_enable);
|
PX4_INFO(" accel: enabled: %" PRId32, _parameters.accel_tc_enable);
|
||||||
|
|
||||||
if (_parameters.accel_tc_enable == 1) {
|
if (_parameters.accel_tc_enable == 1) {
|
||||||
for (int i = 0; i < ACCEL_COUNT_MAX; ++i) {
|
for (int i = 0; i < ACCEL_COUNT_MAX; ++i) {
|
||||||
uint8_t mapping = _accel_data.device_mapping[i];
|
uint8_t mapping = _accel_data.device_mapping[i];
|
||||||
|
|
||||||
if (_accel_data.device_mapping[i] != 255) {
|
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(" using device ID %" PRId32 " for topic instance %i", _parameters.accel_cal_data[mapping].ID, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PX4_INFO(" baro: enabled: %i", _parameters.baro_tc_enable);
|
PX4_INFO(" baro: enabled: %" PRId32, _parameters.baro_tc_enable);
|
||||||
|
|
||||||
if (_parameters.baro_tc_enable == 1) {
|
if (_parameters.baro_tc_enable == 1) {
|
||||||
for (int i = 0; i < BARO_COUNT_MAX; ++i) {
|
for (int i = 0; i < BARO_COUNT_MAX; ++i) {
|
||||||
uint8_t mapping = _baro_data.device_mapping[i];
|
uint8_t mapping = _baro_data.device_mapping[i];
|
||||||
|
|
||||||
if (_baro_data.device_mapping[i] != 255) {
|
if (_baro_data.device_mapping[i] != 255) {
|
||||||
PX4_INFO(" using device ID %i for topic instance %i", _parameters.baro_cal_data[mapping].ID, i);
|
PX4_INFO(" using device ID %" PRId32 " for topic instance %i", _parameters.baro_cal_data[mapping].ID, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2020 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2016-2020, 2021 PX4 Development Team. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -66,7 +66,8 @@ void TemperatureCompensationModule::parameters_update()
|
|||||||
int temp = _temperature_compensation.set_sensor_id_gyro(report.device_id, uorb_index);
|
int temp = _temperature_compensation.set_sensor_id_gyro(report.device_id, uorb_index);
|
||||||
|
|
||||||
if (temp < 0) {
|
if (temp < 0) {
|
||||||
PX4_INFO("No temperature calibration available for gyro %i (device id %u)", uorb_index, report.device_id);
|
PX4_INFO("No temperature calibration available for gyro %" PRIu8 " (device id %" PRIu32 ")", uorb_index,
|
||||||
|
report.device_id);
|
||||||
_corrections.gyro_device_ids[uorb_index] = 0;
|
_corrections.gyro_device_ids[uorb_index] = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -83,7 +84,8 @@ void TemperatureCompensationModule::parameters_update()
|
|||||||
int temp = _temperature_compensation.set_sensor_id_accel(report.device_id, uorb_index);
|
int temp = _temperature_compensation.set_sensor_id_accel(report.device_id, uorb_index);
|
||||||
|
|
||||||
if (temp < 0) {
|
if (temp < 0) {
|
||||||
PX4_INFO("No temperature calibration available for accel %i (device id %u)", uorb_index, report.device_id);
|
PX4_INFO("No temperature calibration available for accel %" PRIu8 " (device id %" PRIu32 ")", uorb_index,
|
||||||
|
report.device_id);
|
||||||
_corrections.accel_device_ids[uorb_index] = 0;
|
_corrections.accel_device_ids[uorb_index] = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -100,7 +102,8 @@ void TemperatureCompensationModule::parameters_update()
|
|||||||
int temp = _temperature_compensation.set_sensor_id_baro(report.device_id, uorb_index);
|
int temp = _temperature_compensation.set_sensor_id_baro(report.device_id, uorb_index);
|
||||||
|
|
||||||
if (temp < 0) {
|
if (temp < 0) {
|
||||||
PX4_INFO("No temperature calibration available for baro %i (device id %u)", uorb_index, report.device_id);
|
PX4_INFO("No temperature calibration available for baro %" PRIu8 " (device id %" PRIu32 ")", uorb_index,
|
||||||
|
report.device_id);
|
||||||
_corrections.baro_device_ids[uorb_index] = 0;
|
_corrections.baro_device_ids[uorb_index] = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2017 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2017, 2021 PX4 Development Team. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -116,7 +116,7 @@ void TemperatureCalibration::task_main()
|
|||||||
|
|
||||||
int32_t min_temp_rise = 24;
|
int32_t min_temp_rise = 24;
|
||||||
param_get(param_find("SYS_CAL_TDEL"), &min_temp_rise);
|
param_get(param_find("SYS_CAL_TDEL"), &min_temp_rise);
|
||||||
PX4_INFO("Waiting for %i degrees difference in sensor temperature", min_temp_rise);
|
PX4_INFO("Waiting for %" PRId32 " degrees difference in sensor temperature", min_temp_rise);
|
||||||
|
|
||||||
int32_t min_start_temp = 5;
|
int32_t min_start_temp = 5;
|
||||||
param_get(param_find("SYS_CAL_TMIN"), &min_start_temp);
|
param_get(param_find("SYS_CAL_TMIN"), &min_start_temp);
|
||||||
|
|||||||
Reference in New Issue
Block a user