mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
sensors: switch status PX4_INFO -> PX4_INFO_RAW
This commit is contained in:
@@ -301,8 +301,8 @@ bool Accelerometer::ParametersSave(int desired_calibration_index, bool force)
|
|||||||
void Accelerometer::PrintStatus()
|
void Accelerometer::PrintStatus()
|
||||||
{
|
{
|
||||||
if (external()) {
|
if (external()) {
|
||||||
PX4_INFO("%s %" PRIu32
|
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",
|
" 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(),
|
SensorString(), device_id(), enabled(),
|
||||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||||
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
||||||
@@ -310,7 +310,8 @@ void Accelerometer::PrintStatus()
|
|||||||
rotation_enum());
|
rotation_enum());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Internal",
|
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(),
|
SensorString(), device_id(), enabled(),
|
||||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||||
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
(double)_scale(0), (double)_scale(1), (double)_scale(2),
|
||||||
@@ -318,7 +319,7 @@ void Accelerometer::PrintStatus()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_thermal_offset.norm() > 0.f) {
|
if (_thermal_offset.norm() > 0.f) {
|
||||||
PX4_INFO("%s %" PRIu32 " temperature offset: [%.4f %.4f %.4f]", SensorString(), _device_id,
|
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));
|
(double)_thermal_offset(0), (double)_thermal_offset(1), (double)_thermal_offset(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -281,22 +281,22 @@ bool Gyroscope::ParametersSave(int desired_calibration_index, bool force)
|
|||||||
void Gyroscope::PrintStatus()
|
void Gyroscope::PrintStatus()
|
||||||
{
|
{
|
||||||
if (external()) {
|
if (external()) {
|
||||||
PX4_INFO("%s %" PRIu32
|
PX4_INFO_RAW("%s %" PRIu32
|
||||||
" EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d",
|
" EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Ext ROT: %d\n",
|
||||||
SensorString(), device_id(), enabled(),
|
SensorString(), device_id(), enabled(),
|
||||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||||
(double)_temperature,
|
(double)_temperature,
|
||||||
rotation_enum());
|
rotation_enum());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Internal",
|
PX4_INFO_RAW("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], %.1f degC, Internal\n",
|
||||||
SensorString(), device_id(), enabled(),
|
SensorString(), device_id(), enabled(),
|
||||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||||
(double)_temperature);
|
(double)_temperature);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_thermal_offset.norm() > 0.f) {
|
if (_thermal_offset.norm() > 0.f) {
|
||||||
PX4_INFO("%s %" PRIu32 " temperature offset: [%.4f %.4f %.4f]", SensorString(), _device_id,
|
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));
|
(double)_thermal_offset(0), (double)_thermal_offset(1), (double)_thermal_offset(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,8 +301,8 @@ bool Magnetometer::ParametersSave(int desired_calibration_index, bool force)
|
|||||||
void Magnetometer::PrintStatus()
|
void Magnetometer::PrintStatus()
|
||||||
{
|
{
|
||||||
if (external()) {
|
if (external()) {
|
||||||
PX4_INFO("%s %" PRIu32
|
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",
|
" 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(),
|
SensorString(), device_id(), enabled(),
|
||||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||||
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
||||||
@@ -310,7 +310,8 @@ void Magnetometer::PrintStatus()
|
|||||||
rotation_enum());
|
rotation_enum());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
PX4_INFO("%s %" PRIu32 " EN: %d, offset: [%05.3f %05.3f %05.3f], scale: [%05.3f %05.3f %05.3f], %.1f degC, Internal",
|
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(),
|
SensorString(), device_id(), enabled(),
|
||||||
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
(double)_offset(0), (double)_offset(1), (double)_offset(2),
|
||||||
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
(double)_scale(0, 0), (double)_scale(1, 1), (double)_scale(2, 2),
|
||||||
|
|||||||
@@ -142,12 +142,12 @@ float DataValidator::confidence(uint64_t timestamp)
|
|||||||
void DataValidator::print()
|
void DataValidator::print()
|
||||||
{
|
{
|
||||||
if (_time_last == 0) {
|
if (_time_last == 0) {
|
||||||
PX4_INFO("\tno data");
|
PX4_INFO_RAW("\tno data\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < dimensions; i++) {
|
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],
|
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()));
|
(double)_lp[i], (double)_mean[i], (double)_rms[i], (double)confidence(hrt_absolute_time()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ float *DataValidatorGroup::get_best(uint64_t timestamp, int *index)
|
|||||||
|
|
||||||
void DataValidatorGroup::print()
|
void DataValidatorGroup::print()
|
||||||
{
|
{
|
||||||
PX4_INFO("validator: best: %d, prev best: %d, failsafe: %s (%u events)", _curr_best, _prev_best,
|
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);
|
(_toggle_count > 0) ? "YES" : "NO", _toggle_count);
|
||||||
|
|
||||||
DataValidator *next = _first;
|
DataValidator *next = _first;
|
||||||
@@ -235,7 +235,7 @@ void DataValidatorGroup::print()
|
|||||||
if (next->used()) {
|
if (next->used()) {
|
||||||
uint32_t flags = next->state();
|
uint32_t flags = next->state();
|
||||||
|
|
||||||
PX4_INFO("sensor #%u, prio: %d, state:%s%s%s%s%s%s", i, next->priority(),
|
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_NO_DATA) ? " OFF" : ""),
|
||||||
((flags & DataValidator::ERROR_FLAG_STALE_DATA) ? " STALE" : ""),
|
((flags & DataValidator::ERROR_FLAG_STALE_DATA) ? " STALE" : ""),
|
||||||
((flags & DataValidator::ERROR_FLAG_TIMEOUT) ? " TOUT" : ""),
|
((flags & DataValidator::ERROR_FLAG_TIMEOUT) ? " TOUT" : ""),
|
||||||
|
|||||||
@@ -769,7 +769,7 @@ int Sensors::print_status()
|
|||||||
}
|
}
|
||||||
|
|
||||||
PX4_INFO_RAW("\n");
|
PX4_INFO_RAW("\n");
|
||||||
PX4_INFO("Airspeed status:");
|
PX4_INFO_RAW("Airspeed status:\n");
|
||||||
_airspeed_validator.print();
|
_airspeed_validator.print();
|
||||||
|
|
||||||
PX4_INFO_RAW("\n");
|
PX4_INFO_RAW("\n");
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ void VehicleAcceleration::Run()
|
|||||||
|
|
||||||
void VehicleAcceleration::PrintStatus()
|
void VehicleAcceleration::PrintStatus()
|
||||||
{
|
{
|
||||||
PX4_INFO("selected sensor: %" PRIu32 ", rate: %.1f Hz, estimated bias: [%.4f %.4f %.4f]",
|
PX4_INFO_RAW("[vehicle_acceleration] selected sensor: %" PRIu32 ", rate: %.1f Hz, estimated bias: [%.4f %.4f %.4f]\n",
|
||||||
_calibration.device_id(), (double)_filter_sample_rate,
|
_calibration.device_id(), (double)_filter_sample_rate,
|
||||||
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
||||||
|
|
||||||
|
|||||||
@@ -338,11 +338,12 @@ void VehicleAirData::Run()
|
|||||||
void VehicleAirData::PrintStatus()
|
void VehicleAirData::PrintStatus()
|
||||||
{
|
{
|
||||||
if (_selected_sensor_sub_index >= 0) {
|
if (_selected_sensor_sub_index >= 0) {
|
||||||
PX4_INFO("selected barometer: %" PRIu32 " (%" PRId8 ")", _last_data[_selected_sensor_sub_index].device_id,
|
PX4_INFO_RAW("[vehicle_air_data] selected barometer: %" PRIu32 " (%" PRId8 ")\n",
|
||||||
|
_last_data[_selected_sensor_sub_index].device_id,
|
||||||
_selected_sensor_sub_index);
|
_selected_sensor_sub_index);
|
||||||
|
|
||||||
if (fabsf(_thermal_offset[_selected_sensor_sub_index]) > 0.f) {
|
if (fabsf(_thermal_offset[_selected_sensor_sub_index]) > 0.f) {
|
||||||
PX4_INFO("%" PRIu32 " temperature offset: %.4f", _last_data[_selected_sensor_sub_index].device_id,
|
PX4_INFO_RAW("%" PRIu32 " temperature offset: %.4f\n", _last_data[_selected_sensor_sub_index].device_id,
|
||||||
(double)_thermal_offset[_selected_sensor_sub_index]);
|
(double)_thermal_offset[_selected_sensor_sub_index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -860,7 +860,8 @@ bool VehicleAngularVelocity::CalibrateAndPublish(const hrt_abstime ×tamp_sa
|
|||||||
|
|
||||||
void VehicleAngularVelocity::PrintStatus()
|
void VehicleAngularVelocity::PrintStatus()
|
||||||
{
|
{
|
||||||
PX4_INFO("selected sensor: %" PRIu32 ", rate: %.1f Hz %s, estimated bias: [%.5f %.5f %.5f]",
|
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" : "",
|
_calibration.device_id(), (double)_filter_sample_rate_hz, _fifo_available ? "FIFO" : "",
|
||||||
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
(double)_bias(0), (double)_bias(1), (double)_bias(2));
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ void VehicleGPSPosition::Publish(const sensor_gps_s &gps, uint8_t selected)
|
|||||||
|
|
||||||
void VehicleGPSPosition::PrintStatus()
|
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
|
}; // namespace sensors
|
||||||
|
|||||||
@@ -701,8 +701,8 @@ void VehicleIMU::UpdateGyroVibrationMetrics(const Vector3f &angular_velocity)
|
|||||||
|
|
||||||
void VehicleIMU::PrintStatus()
|
void VehicleIMU::PrintStatus()
|
||||||
{
|
{
|
||||||
PX4_INFO("%" PRIu8 " - Accel: %" PRIu32 ", interval: %.1f us (SD %.1f us), Gyro: %" PRIu32
|
PX4_INFO_RAW("[vehicle_imu] %" PRIu8 " - Accel: %" PRIu32 ", interval: %.1f us (SD %.1f us), Gyro: %" PRIu32
|
||||||
", interval: %.1f us (SD %.1f us)",
|
", interval: %.1f us (SD %.1f us)\n",
|
||||||
_instance,
|
_instance,
|
||||||
_accel_calibration.device_id(), (double)_accel_interval_us, (double)sqrtf(_accel_interval_best_variance),
|
_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));
|
_gyro_calibration.device_id(), (double)_gyro_interval_us, (double)sqrtf(_gyro_interval_best_variance));
|
||||||
|
|||||||
@@ -633,7 +633,8 @@ void VehicleMagnetometer::calcMagInconsistency()
|
|||||||
void VehicleMagnetometer::PrintStatus()
|
void VehicleMagnetometer::PrintStatus()
|
||||||
{
|
{
|
||||||
if (_selected_sensor_sub_index >= 0) {
|
if (_selected_sensor_sub_index >= 0) {
|
||||||
PX4_INFO("selected magnetometer: %" PRIu32 " (%" PRId8 ")", _last_data[_selected_sensor_sub_index].device_id,
|
PX4_INFO_RAW("[vehicle_magnetometer] selected magnetometer: %" PRIu32 " (%" PRId8 ")\n",
|
||||||
|
_last_data[_selected_sensor_sub_index].device_id,
|
||||||
_selected_sensor_sub_index);
|
_selected_sensor_sub_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -377,11 +377,11 @@ void VotedSensorsUpdate::initSensorClass(SensorData &sensor_data, uint8_t sensor
|
|||||||
|
|
||||||
void VotedSensorsUpdate::printStatus()
|
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();
|
_gyro.voter.print();
|
||||||
|
|
||||||
PX4_INFO_RAW("\n");
|
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();
|
_accel.voter.print();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user