mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
sensors: switch status PX4_INFO -> PX4_INFO_RAW
This commit is contained in:
parent
b1d2a0cc4e
commit
dd6b7fa98f
@ -301,25 +301,26 @@ bool Accelerometer::ParametersSave(int desired_calibration_index, bool force)
|
||||
void Accelerometer::PrintStatus()
|
||||
{
|
||||
if (external()) {
|
||||
PX4_INFO("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
||||
(double)_temperature,
|
||||
rotation_enum());
|
||||
PX4_INFO_RAW("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d\n",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
||||
(double)_temperature,
|
||||
rotation_enum());
|
||||
|
||||
} else {
|
||||
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Internal",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
||||
(double)_temperature);
|
||||
PX4_INFO_RAW("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Internal\n",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
||||
(double)_temperature);
|
||||
}
|
||||
|
||||
if (_thermal_offset.norm() > 0.f) {
|
||||
PX4_INFO("%s %" PRIu32 " temperature offset: [%.4f %.4f %.4f]", SensorString(), _device_id,
|
||||
(double)_thermal_offset(0), (double)_thermal_offset(1), (double)_thermal_offset(2));
|
||||
PX4_INFO_RAW("%s %" PRIu32 " temperature offset: [%.4f %.4f %.4f]\n", SensorString(), _device_id,
|
||||
(double)_thermal_offset(0), (double)_thermal_offset(1), (double)_thermal_offset(2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -281,23 +281,23 @@ bool Gyroscope::ParametersSave(int desired_calibration_index, bool force)
|
||||
void Gyroscope::PrintStatus()
|
||||
{
|
||||
if (external()) {
|
||||
PX4_INFO("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_temperature,
|
||||
rotation_enum());
|
||||
PX4_INFO_RAW("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d\n",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_temperature,
|
||||
rotation_enum());
|
||||
|
||||
} else {
|
||||
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Internal",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_temperature);
|
||||
PX4_INFO_RAW("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Internal\n",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_temperature);
|
||||
}
|
||||
|
||||
if (_thermal_offset.norm() > 0.f) {
|
||||
PX4_INFO("%s %" PRIu32 " temperature offset: [%.4f %.4f %.4f]", SensorString(), _device_id,
|
||||
(double)_thermal_offset(0), (double)_thermal_offset(1), (double)_thermal_offset(2));
|
||||
PX4_INFO_RAW("%s %" PRIu32 " temperature offset: [%.4f %.4f %.4f]\n", SensorString(), _device_id,
|
||||
(double)_thermal_offset(0), (double)_thermal_offset(1), (double)_thermal_offset(2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -301,20 +301,21 @@ bool Magnetometer::ParametersSave(int desired_calibration_index, bool force)
|
||||
void Magnetometer::PrintStatus()
|
||||
{
|
||||
if (external()) {
|
||||
PX4_INFO("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
||||
(double)_temperature,
|
||||
rotation_enum());
|
||||
PX4_INFO_RAW("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d\n",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
||||
(double)_temperature,
|
||||
rotation_enum());
|
||||
|
||||
} else {
|
||||
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Internal",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
||||
(double)_temperature);
|
||||
PX4_INFO_RAW("%s %" PRIu32
|
||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Internal\n",
|
||||
SensorString(), device_id(), enabled(),
|
||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
||||
(double)_temperature);
|
||||
}
|
||||
|
||||
#if defined(DEBUG_BUILD)
|
||||
|
||||
@ -142,12 +142,12 @@ float DataValidator::confidence(uint64_t timestamp)
|
||||
void DataValidator::print()
|
||||
{
|
||||
if (_time_last == 0) {
|
||||
PX4_INFO("\tno data");
|
||||
PX4_INFO_RAW("\tno data\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < dimensions; i++) {
|
||||
PX4_INFO("\tval: %8.4f, lp: %8.4f mean dev: %8.4f RMS: %8.4f conf: %8.4f", (double)_value[i],
|
||||
(double)_lp[i], (double)_mean[i], (double)_rms[i], (double)confidence(hrt_absolute_time()));
|
||||
PX4_INFO_RAW("\tval: %8.4f, lp: %8.4f mean dev: %8.4f RMS: %8.4f conf: %8.4f\n", (double)_value[i],
|
||||
(double)_lp[i], (double)_mean[i], (double)_rms[i], (double)confidence(hrt_absolute_time()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,8 +225,8 @@ float *DataValidatorGroup::get_best(uint64_t timestamp, int *index)
|
||||
|
||||
void DataValidatorGroup::print()
|
||||
{
|
||||
PX4_INFO("validator: best: %d, prev best: %d, failsafe: %s (%u events)", _curr_best, _prev_best,
|
||||
(_toggle_count > 0) ? "YES" : "NO", _toggle_count);
|
||||
PX4_INFO_RAW("validator: best: %d, prev best: %d, failsafe: %s (%u events)\n", _curr_best, _prev_best,
|
||||
(_toggle_count > 0) ? "YES" : "NO", _toggle_count);
|
||||
|
||||
DataValidator *next = _first;
|
||||
unsigned i = 0;
|
||||
@ -235,13 +235,13 @@ void DataValidatorGroup::print()
|
||||
if (next->used()) {
|
||||
uint32_t flags = next->state();
|
||||
|
||||
PX4_INFO("sensor #%u, prio: %d, state:%s%s%s%s%s%s", i, next->priority(),
|
||||
((flags & DataValidator::ERROR_FLAG_NO_DATA) ? " OFF" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_STALE_DATA) ? " STALE" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_TIMEOUT) ? " TOUT" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_HIGH_ERRCOUNT) ? " ECNT" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_HIGH_ERRDENSITY) ? " EDNST" : ""),
|
||||
((flags == DataValidator::ERROR_FLAG_NO_ERROR) ? " OK" : ""));
|
||||
PX4_INFO_RAW("sensor #%u, prio: %d, state:%s%s%s%s%s%s\n", i, next->priority(),
|
||||
((flags & DataValidator::ERROR_FLAG_NO_DATA) ? " OFF" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_STALE_DATA) ? " STALE" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_TIMEOUT) ? " TOUT" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_HIGH_ERRCOUNT) ? " ECNT" : ""),
|
||||
((flags & DataValidator::ERROR_FLAG_HIGH_ERRDENSITY) ? " EDNST" : ""),
|
||||
((flags == DataValidator::ERROR_FLAG_NO_ERROR) ? " OK" : ""));
|
||||
|
||||
next->print();
|
||||
}
|
||||
|
||||
@ -769,7 +769,7 @@ int Sensors::print_status()
|
||||
}
|
||||
|
||||
PX4_INFO_RAW("\n");
|
||||
PX4_INFO("Airspeed status:");
|
||||
PX4_INFO_RAW("Airspeed status:\n");
|
||||
_airspeed_validator.print();
|
||||
|
||||
PX4_INFO_RAW("\n");
|
||||
|
||||
@ -256,9 +256,9 @@ void VehicleAcceleration::Run()
|
||||
|
||||
void VehicleAcceleration::PrintStatus()
|
||||
{
|
||||
PX4_INFO("selected sensor: %" PRIu32 ", rate: %.1f Hz, estimated bias: [%.4f %.4f %.4f]",
|
||||
_calibration.device_id(), (double)_filter_sample_rate,
|
||||
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
||||
PX4_INFO_RAW("[vehicle_acceleration] selected sensor: %" PRIu32 ", rate: %.1f Hz, estimated bias: [%.4f %.4f %.4f]\n",
|
||||
_calibration.device_id(), (double)_filter_sample_rate,
|
||||
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
||||
|
||||
_calibration.PrintStatus();
|
||||
}
|
||||
|
||||
@ -338,12 +338,13 @@ void VehicleAirData::Run()
|
||||
void VehicleAirData::PrintStatus()
|
||||
{
|
||||
if (_selected_sensor_sub_index >= 0) {
|
||||
PX4_INFO("selected barometer: %" PRIu32 " (%" PRId8 ")", _last_data[_selected_sensor_sub_index].device_id,
|
||||
_selected_sensor_sub_index);
|
||||
PX4_INFO_RAW("[vehicle_air_data] selected barometer: %" PRIu32 " (%" PRId8 ")\n",
|
||||
_last_data[_selected_sensor_sub_index].device_id,
|
||||
_selected_sensor_sub_index);
|
||||
|
||||
if (fabsf(_thermal_offset[_selected_sensor_sub_index]) > 0.f) {
|
||||
PX4_INFO("%" PRIu32 " temperature offset: %.4f", _last_data[_selected_sensor_sub_index].device_id,
|
||||
(double)_thermal_offset[_selected_sensor_sub_index]);
|
||||
PX4_INFO_RAW("%" PRIu32 " temperature offset: %.4f\n", _last_data[_selected_sensor_sub_index].device_id,
|
||||
(double)_thermal_offset[_selected_sensor_sub_index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -860,9 +860,10 @@ bool VehicleAngularVelocity::CalibrateAndPublish(const hrt_abstime ×tamp_sa
|
||||
|
||||
void VehicleAngularVelocity::PrintStatus()
|
||||
{
|
||||
PX4_INFO("selected sensor: %" PRIu32 ", rate: %.1f Hz %s, estimated bias: [%.5f %.5f %.5f]",
|
||||
_calibration.device_id(), (double)_filter_sample_rate_hz, _fifo_available ? "FIFO" : "",
|
||||
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
||||
PX4_INFO_RAW("[vehicle_angular_velocity] selected sensor: %" PRIu32
|
||||
", rate: %.1f Hz %s, estimated bias: [%.5f %.5f %.5f]\n",
|
||||
_calibration.device_id(), (double)_filter_sample_rate_hz, _fifo_available ? "FIFO" : "",
|
||||
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
||||
|
||||
_calibration.PrintStatus();
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ void VehicleGPSPosition::Publish(const sensor_gps_s &gps, uint8_t selected)
|
||||
|
||||
void VehicleGPSPosition::PrintStatus()
|
||||
{
|
||||
//PX4_INFO("selected GPS: %d", _gps_select_index);
|
||||
//PX4_INFO_RAW("[vehicle_gps_position] selected GPS: %d\n", _gps_select_index);
|
||||
}
|
||||
|
||||
}; // namespace sensors
|
||||
|
||||
@ -701,11 +701,11 @@ void VehicleIMU::UpdateGyroVibrationMetrics(const Vector3f &angular_velocity)
|
||||
|
||||
void VehicleIMU::PrintStatus()
|
||||
{
|
||||
PX4_INFO("%" PRIu8 " - Accel: %" PRIu32 ", interval: %.1f us (SD %.1f us), Gyro: %" PRIu32
|
||||
", interval: %.1f us (SD %.1f us)",
|
||||
_instance,
|
||||
_accel_calibration.device_id(), (double)_accel_interval_us, (double)sqrtf(_accel_interval_best_variance),
|
||||
_gyro_calibration.device_id(), (double)_gyro_interval_us, (double)sqrtf(_gyro_interval_best_variance));
|
||||
PX4_INFO_RAW("[vehicle_imu] %" PRIu8 " - Accel: %" PRIu32 ", interval: %.1f us (SD %.1f us), Gyro: %" PRIu32
|
||||
", interval: %.1f us (SD %.1f us)\n",
|
||||
_instance,
|
||||
_accel_calibration.device_id(), (double)_accel_interval_us, (double)sqrtf(_accel_interval_best_variance),
|
||||
_gyro_calibration.device_id(), (double)_gyro_interval_us, (double)sqrtf(_gyro_interval_best_variance));
|
||||
|
||||
PX4_DEBUG("gyro update mean sample latency: %.6f s, publish latency %.6f s, gyro interval %.6f s",
|
||||
(double)_gyro_update_latency_mean.mean()(0), (double)_gyro_update_latency_mean.mean()(1),
|
||||
|
||||
@ -633,8 +633,9 @@ void VehicleMagnetometer::calcMagInconsistency()
|
||||
void VehicleMagnetometer::PrintStatus()
|
||||
{
|
||||
if (_selected_sensor_sub_index >= 0) {
|
||||
PX4_INFO("selected magnetometer: %" PRIu32 " (%" PRId8 ")", _last_data[_selected_sensor_sub_index].device_id,
|
||||
_selected_sensor_sub_index);
|
||||
PX4_INFO_RAW("[vehicle_magnetometer] selected magnetometer: %" PRIu32 " (%" PRId8 ")\n",
|
||||
_last_data[_selected_sensor_sub_index].device_id,
|
||||
_selected_sensor_sub_index);
|
||||
}
|
||||
|
||||
_voter.print();
|
||||
|
||||
@ -377,11 +377,11 @@ void VotedSensorsUpdate::initSensorClass(SensorData &sensor_data, uint8_t sensor
|
||||
|
||||
void VotedSensorsUpdate::printStatus()
|
||||
{
|
||||
PX4_INFO("selected gyro: %" PRIu32 " (%" PRIu8 ")", _selection.gyro_device_id, _gyro.last_best_vote);
|
||||
PX4_INFO_RAW("selected gyro: %" PRIu32 " (%" PRIu8 ")\n", _selection.gyro_device_id, _gyro.last_best_vote);
|
||||
_gyro.voter.print();
|
||||
|
||||
PX4_INFO_RAW("\n");
|
||||
PX4_INFO("selected accel: %" PRIu32 " (%" PRIu8 ")", _selection.accel_device_id, _accel.last_best_vote);
|
||||
PX4_INFO_RAW("selected accel: %" PRIu32 " (%" PRIu8 ")\n", _selection.accel_device_id, _accel.last_best_vote);
|
||||
_accel.voter.print();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user