mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-20 20:03:54 +08:00
drivers start using uORB message print instead of custom
This commit is contained in:
@@ -595,11 +595,10 @@ BMP280::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u us \n", _report_ticks * USEC_PER_TICK);
|
||||
_reports->print_info("report queue");
|
||||
printf("P Pa: %.3f\n", (double)_P);
|
||||
printf("T: %.3f\n", (double)_T);
|
||||
printf("MSL pressure Pa: %u\n", _msl_pressure);
|
||||
|
||||
sensor_baro_s brp = {};
|
||||
_reports->get(&brp);
|
||||
print_message(brp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -778,11 +777,7 @@ test(enum BMP280_BUS busid)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
PX4_WARN("single read");
|
||||
PX4_WARN("pressure: %10.4f", (double)report.pressure);
|
||||
PX4_WARN("altitude: %11.4f", (double)report.altitude);
|
||||
PX4_WARN("temperature: %8.4f", (double)report.temperature);
|
||||
PX4_WARN("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* set the queue depth to 10 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
@@ -818,11 +813,7 @@ test(enum BMP280_BUS busid)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
PX4_WARN("periodic read %u", i);
|
||||
PX4_WARN("pressure: %10.4f", (double)report.pressure);
|
||||
PX4_WARN("altitude: %11.4f", (double)report.altitude);
|
||||
PX4_WARN("temperature K: %8.4f", (double)report.temperature);
|
||||
PX4_WARN("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
@@ -799,9 +799,7 @@ LPS25H::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
printf("pressure %.2f\n", (double)_last_report.pressure);
|
||||
printf("altitude: %.2f\n", (double)_last_report.altitude);
|
||||
printf("temperature %.2f\n", (double)_last_report.temperature);
|
||||
print_message(_last_report);
|
||||
|
||||
_reports->print_info("report queue");
|
||||
}
|
||||
@@ -959,11 +957,7 @@ test(enum LPS25H_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("pressure: %10.4f", (double)report.pressure);
|
||||
warnx("altitude: %11.4f", (double)report.altitude);
|
||||
warnx("temperature: %8.4f", (double)report.temperature);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* set the queue depth to 10 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
@@ -995,11 +989,7 @@ test(enum LPS25H_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("pressure: %10.4f", (double)report.pressure);
|
||||
warnx("altitude: %11.4f", (double)report.altitude);
|
||||
warnx("temperature K: %8.4f", (double)report.temperature);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
@@ -732,10 +732,10 @@ MPL3115A2::print_info()
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
_reports->print_info("report queue");
|
||||
printf("device: mpl3115a2\n");
|
||||
printf("P: %.3f\n", (double)_P);
|
||||
printf("T: %.3f\n", (double)_T);
|
||||
printf("MSL pressure: %10.4f\n", (double)(_msl_pressure / 100.f));
|
||||
|
||||
sensor_baro_s brp = {};
|
||||
_reports->get(&brp);
|
||||
print_message(brp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -899,11 +899,7 @@ test(enum MPL3115A2_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("pressure: %10.4f", (double)report.pressure);
|
||||
warnx("altitude: %11.4f", (double)report.altitude);
|
||||
warnx("temperature: %8.4f", (double)report.temperature);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* set the queue depth to 10 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
@@ -935,11 +931,7 @@ test(enum MPL3115A2_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("pressure: %10.4f", (double)report.pressure);
|
||||
warnx("altitude: %11.4f", (double)report.altitude);
|
||||
warnx("temperature: %8.4f", (double)report.temperature);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
@@ -895,9 +895,6 @@ MS5611::print_info()
|
||||
printf("TEMP: %d\n", _TEMP);
|
||||
printf("SENS: %lld\n", _SENS);
|
||||
printf("OFF: %lld\n", _OFF);
|
||||
printf("P: %.3f\n", (double)_P);
|
||||
printf("T: %.3f\n", (double)_T);
|
||||
printf("MSL pressure: %10.4f\n", (double)(_msl_pressure / 100.f));
|
||||
|
||||
printf("factory_setup %u\n", _prom.factory_setup);
|
||||
printf("c1_pressure_sens %u\n", _prom.c1_pressure_sens);
|
||||
@@ -907,6 +904,10 @@ MS5611::print_info()
|
||||
printf("c5_reference_temp %u\n", _prom.c5_reference_temp);
|
||||
printf("c6_temp_coeff_temp %u\n", _prom.c6_temp_coeff_temp);
|
||||
printf("serial_and_crc %u\n", _prom.serial_and_crc);
|
||||
|
||||
sensor_baro_s brp = {};
|
||||
_reports->get(&brp);
|
||||
print_message(brp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1118,11 +1119,7 @@ test(enum MS5611_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("pressure: %10.4f", (double)report.pressure);
|
||||
warnx("altitude: %11.4f", (double)report.altitude);
|
||||
warnx("temperature: %8.4f", (double)report.temperature);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* set the queue depth to 10 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
@@ -1154,11 +1151,7 @@ test(enum MS5611_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("pressure: %10.4f", (double)report.pressure);
|
||||
warnx("altitude: %11.4f", (double)report.altitude);
|
||||
warnx("temperature: %8.4f", (double)report.temperature);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
@@ -317,10 +317,7 @@ BATT_SMBUS::test()
|
||||
|
||||
if (updated) {
|
||||
if (orb_copy(ORB_ID(battery_status), sub, &status) == OK) {
|
||||
PX4_INFO("V=%4.2f C=%4.2f AveC=%4.2f DismAh=%f Cap:%hu TempC:%4.2f Remaining:%3.2f\n RunTimeToEmpty:%hu AveTimeToEmpty:%hu CycleCount:%hu SerialNum:%04x",
|
||||
(double)status.voltage_v, (double)status.current_a, (double)status.average_current_a, (double)status.discharged_mah,
|
||||
(uint16_t)status.capacity, (double)status.temperature, (double)status.remaining, (uint16_t)status.run_time_to_empty,
|
||||
(uint16_t)status.average_time_to_empty, (uint16_t)status.cycle_count, (uint16_t)status.serial_number);
|
||||
print_message(status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -801,10 +801,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f of sonar %d,id=%d", (double)report.distance_vector[report.just_updated], report.just_updated,
|
||||
report.id[report.just_updated]);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -831,14 +828,7 @@ test()
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
|
||||
/* Print the sonar rangefinder report sonar distance vector */
|
||||
for (uint8_t count = 0; count < SRF02_MAX_RANGEFINDERS; count++) {
|
||||
warnx("measurement: %0.3f of sonar %u, id=%d", (double)report.distance_vector[count], count + 1, report.id[count]);
|
||||
}
|
||||
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to default rate */
|
||||
|
||||
@@ -231,16 +231,7 @@ int leddar_one_main(int argc, char *argv[])
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
bool valid = false;
|
||||
|
||||
if (report.current_distance > report.min_distance
|
||||
&& report.current_distance < report.max_distance) {
|
||||
valid = true;
|
||||
}
|
||||
|
||||
warnx("valid: %u\n", valid);
|
||||
warnx("distance: %0.3fm\n", (double)report.current_distance);
|
||||
warnx("time: %llu\n", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
} else {
|
||||
help();
|
||||
|
||||
@@ -123,7 +123,8 @@ void LidarLitePWM::print_info()
|
||||
perf_print_counter(_read_errors);
|
||||
perf_print_counter(_sensor_zero_resets);
|
||||
warnx("poll interval: %u ticks", getMeasureTicks());
|
||||
warnx("distance: %.3fm", (double)_range.current_distance);
|
||||
|
||||
print_message(_range);
|
||||
}
|
||||
|
||||
void LidarLitePWM::print_registers()
|
||||
|
||||
@@ -217,9 +217,7 @@ test()
|
||||
return;
|
||||
}
|
||||
|
||||
PX4_INFO("single read");
|
||||
PX4_INFO("measurement: %0.2f m", (double)report.current_distance);
|
||||
PX4_INFO("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (PX4_OK != px4_ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -249,11 +247,7 @@ test()
|
||||
return;
|
||||
}
|
||||
|
||||
PX4_INFO("periodic read %u", i);
|
||||
PX4_INFO("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
PX4_INFO("measurement: %0.3f m", (double)report.current_distance);
|
||||
PX4_INFO("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to default rate */
|
||||
|
||||
@@ -797,9 +797,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -826,11 +824,7 @@ test()
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
warnx("measurement: %0.3f", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to default rate */
|
||||
|
||||
@@ -863,9 +863,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2 Hz rate */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -894,11 +892,7 @@ test()
|
||||
break;
|
||||
}
|
||||
|
||||
warnx("read #%u", i);
|
||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
warnx("measurement: %0.3f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to the default rate */
|
||||
|
||||
@@ -732,9 +732,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -761,11 +759,7 @@ test()
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
warnx("measurement: %0.3f", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to default rate */
|
||||
|
||||
@@ -801,9 +801,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -830,11 +828,7 @@ test()
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
warnx("measurement: %0.3f", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to default rate */
|
||||
|
||||
@@ -801,9 +801,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -830,11 +828,7 @@ test()
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
warnx("measurement: %0.3f", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to default rate */
|
||||
|
||||
@@ -845,9 +845,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -874,9 +872,7 @@ test()
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("measurement: %0.3f", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to default rate */
|
||||
|
||||
@@ -828,9 +828,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2 Hz rate */
|
||||
if (OK != px4_ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -859,11 +857,7 @@ test()
|
||||
break;
|
||||
}
|
||||
|
||||
warnx("read #%u", i);
|
||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
warnx("measurement: %0.3f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to the default rate */
|
||||
|
||||
+2
-11
@@ -873,19 +873,10 @@ GPS::print_status()
|
||||
}
|
||||
|
||||
PX4_INFO("port: %s, baudrate: %d, status: %s", _port, _baudrate, _healthy ? "OK" : "NOT OK");
|
||||
PX4_INFO("sat info: %s, noise: %d, jamming detected: %s",
|
||||
(_p_report_sat_info != nullptr) ? "enabled" : "disabled",
|
||||
_report_gps_pos.noise_per_ms,
|
||||
_report_gps_pos.jamming_indicator == 255 ? "YES" : "NO");
|
||||
PX4_INFO("sat info: %s", (_p_report_sat_info != nullptr) ? "enabled" : "disabled");
|
||||
|
||||
if (_report_gps_pos.timestamp != 0) {
|
||||
PX4_INFO("position lock: %d, satellites: %d, last update: %8.4fms ago", (int)_report_gps_pos.fix_type,
|
||||
_report_gps_pos.satellites_used, (double)(hrt_absolute_time() - _report_gps_pos.timestamp) / 1000.0);
|
||||
PX4_INFO("lat: %d, lon: %d, alt: %d", _report_gps_pos.lat, _report_gps_pos.lon, _report_gps_pos.alt);
|
||||
PX4_INFO("vel: %.2fm/s, %.2fm/s, %.2fm/s", (double)_report_gps_pos.vel_n_m_s,
|
||||
(double)_report_gps_pos.vel_e_m_s, (double)_report_gps_pos.vel_d_m_s);
|
||||
PX4_INFO("hdop: %.2f, vdop: %.2f", (double)_report_gps_pos.hdop, (double)_report_gps_pos.vdop);
|
||||
PX4_INFO("eph: %.2fm, epv: %.2fm", (double)_report_gps_pos.eph, (double)_report_gps_pos.epv);
|
||||
print_message(_report_gps_pos);
|
||||
|
||||
if (_helper) {
|
||||
PX4_INFO("rate position: \t\t%6.2f Hz", (double)_helper->getPositionUpdateRate());
|
||||
|
||||
@@ -1869,16 +1869,7 @@ test()
|
||||
err(1, "immediate acc read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("time: %lld", a_report.timestamp);
|
||||
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
|
||||
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
|
||||
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
|
||||
warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
|
||||
warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
|
||||
warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
|
||||
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
|
||||
(double)(a_report.range_m_s2 / ADIS16448_ONE_G));
|
||||
print_message(a_report);
|
||||
|
||||
/* do a simple demand read */
|
||||
sz = read(fd_gyro, &g_report, sizeof(g_report));
|
||||
@@ -1888,14 +1879,7 @@ test()
|
||||
err(1, "immediate gyro read failed");
|
||||
}
|
||||
|
||||
warnx("gyro x: \t% 9.5f\trad/s", (double)g_report.x);
|
||||
warnx("gyro y: \t% 9.5f\trad/s", (double)g_report.y);
|
||||
warnx("gyro z: \t% 9.5f\trad/s", (double)g_report.z);
|
||||
warnx("gyro x: \t%d\traw", (int)g_report.x_raw);
|
||||
warnx("gyro y: \t%d\traw", (int)g_report.y_raw);
|
||||
warnx("gyro z: \t%d\traw", (int)g_report.z_raw);
|
||||
warnx("gyro range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
|
||||
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
|
||||
print_message(g_report);
|
||||
|
||||
/* do a simple mag demand read */
|
||||
sz = read(fd_mag, &m_report, sizeof(m_report));
|
||||
@@ -1905,16 +1889,7 @@ test()
|
||||
err(1, "immediate mag read failed");
|
||||
}
|
||||
|
||||
warnx("mag x: \t% 9.5f\tgauss", (double)m_report.x);
|
||||
warnx("mag y: \t% 9.5f\tgauss", (double)m_report.y);
|
||||
warnx("mag z: \t% 9.5f\tgauss", (double)m_report.z);
|
||||
warnx("mag x: \t%d\traw", (int)m_report.x_raw);
|
||||
warnx("mag y: \t%d\traw", (int)m_report.y_raw);
|
||||
warnx("mag z: \t%d\traw", (int)m_report.z_raw);
|
||||
warnx("mag range: %8.4f gauss", (double)m_report.range_ga);
|
||||
|
||||
warnx("temp: \t%8.4f\tdeg celsius", (double)a_report.temperature);
|
||||
warnx("temp: \t%d\traw 0x%0x", (short)a_report.temperature_raw, (unsigned short)a_report.temperature_raw);
|
||||
print_message(m_report);
|
||||
|
||||
/* XXX add poll-rate tests here too */
|
||||
close(fd_mag);
|
||||
|
||||
@@ -838,18 +838,7 @@ test()
|
||||
err(1, "immediate acc read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("time: %lld", a_report.timestamp);
|
||||
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
|
||||
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
|
||||
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
|
||||
warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
|
||||
warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
|
||||
warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
|
||||
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
|
||||
(double)(a_report.range_m_s2 / 9.81f));
|
||||
|
||||
/* XXX add poll-rate tests here too */
|
||||
print_message(a_report);
|
||||
|
||||
reset();
|
||||
errx(0, "PASS");
|
||||
|
||||
@@ -225,19 +225,7 @@ test(bool external_bus, enum sensor_type sensor)
|
||||
err(1, "immediate accel read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("time: %lld", a_report.timestamp);
|
||||
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
|
||||
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
|
||||
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
|
||||
warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
|
||||
warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
|
||||
warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
|
||||
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
|
||||
(double)(a_report.range_m_s2 / BMI055_ONE_G));
|
||||
warnx("temp: \t%8.4f\tdeg celsius", (double)a_report.temperature);
|
||||
warnx("temp: \t%d\traw 0x%0x", (short)g_report.temperature_raw, (unsigned short)a_report.temperature_raw);
|
||||
|
||||
print_message(a_report);
|
||||
|
||||
/* reset to default polling */
|
||||
if (ioctl(fd_acc, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
@@ -261,7 +249,6 @@ test(bool external_bus, enum sensor_type sensor)
|
||||
err(1, "gyro reset to manual polling");
|
||||
}
|
||||
|
||||
|
||||
/* do a simple demand read */
|
||||
sz = read(fd_gyr, &g_report, sizeof(g_report));
|
||||
|
||||
@@ -270,15 +257,7 @@ test(bool external_bus, enum sensor_type sensor)
|
||||
err(1, "immediate gyro read failed");
|
||||
}
|
||||
|
||||
warnx("gyr x: \t% 9.5f\trad/s", (double)g_report.x);
|
||||
warnx("gyr y: \t% 9.5f\trad/s", (double)g_report.y);
|
||||
warnx("gyr z: \t% 9.5f\trad/s", (double)g_report.z);
|
||||
warnx("gyr x: \t%d\traw", (int)g_report.x_raw);
|
||||
warnx("gyr y: \t%d\traw", (int)g_report.y_raw);
|
||||
warnx("gyr z: \t%d\traw", (int)g_report.z_raw);
|
||||
warnx("gyr range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
|
||||
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
|
||||
|
||||
print_message(g_report);
|
||||
|
||||
/* reset to default polling */
|
||||
if (ioctl(fd_gyr, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
@@ -286,7 +265,6 @@ test(bool external_bus, enum sensor_type sensor)
|
||||
}
|
||||
|
||||
close(fd_gyr);
|
||||
|
||||
}
|
||||
|
||||
if ((sensor == BMI055_ACCEL) || (sensor == BMI055_GYRO)) {
|
||||
@@ -295,7 +273,6 @@ test(bool external_bus, enum sensor_type sensor)
|
||||
}
|
||||
|
||||
errx(0, "PASS");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -151,16 +151,7 @@ test(bool external_bus)
|
||||
err(1, "immediate acc read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("time: %lld", a_report.timestamp);
|
||||
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
|
||||
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
|
||||
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
|
||||
warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
|
||||
warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
|
||||
warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
|
||||
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
|
||||
(double)(a_report.range_m_s2 / BMI160_ONE_G));
|
||||
print_message(a_report);
|
||||
|
||||
/* do a simple demand read */
|
||||
sz = read(fd_gyro, &g_report, sizeof(g_report));
|
||||
@@ -170,17 +161,7 @@ test(bool external_bus)
|
||||
err(1, "immediate gyro read failed");
|
||||
}
|
||||
|
||||
warnx("gyro x: \t% 9.5f\trad/s", (double)g_report.x);
|
||||
warnx("gyro y: \t% 9.5f\trad/s", (double)g_report.y);
|
||||
warnx("gyro z: \t% 9.5f\trad/s", (double)g_report.z);
|
||||
warnx("gyro x: \t%d\traw", (int)g_report.x_raw);
|
||||
warnx("gyro y: \t%d\traw", (int)g_report.y_raw);
|
||||
warnx("gyro z: \t%d\traw", (int)g_report.z_raw);
|
||||
warnx("gyro range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
|
||||
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
|
||||
|
||||
warnx("temp: \t%8.4f\tdeg celsius", (double)a_report.temperature);
|
||||
warnx("temp: \t%d\traw 0x%0x", (short)a_report.temperature_raw, (unsigned short)a_report.temperature_raw);
|
||||
print_message(g_report);
|
||||
|
||||
/* reset to default polling */
|
||||
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
|
||||
@@ -1273,16 +1273,7 @@ test()
|
||||
err(1, "immediate gyro read failed");
|
||||
}
|
||||
|
||||
warnx("gyro x: \t% 9.5f\trad/s", (double)g_report.x);
|
||||
warnx("gyro y: \t% 9.5f\trad/s", (double)g_report.y);
|
||||
warnx("gyro z: \t% 9.5f\trad/s", (double)g_report.z);
|
||||
warnx("temp: \t%d\tC", (int)g_report.temperature);
|
||||
warnx("gyro x: \t%d\traw", (int)g_report.x_raw);
|
||||
warnx("gyro y: \t%d\traw", (int)g_report.y_raw);
|
||||
warnx("gyro z: \t%d\traw", (int)g_report.z_raw);
|
||||
warnx("temp: \t%d\traw", (int)g_report.temperature_raw);
|
||||
warnx("gyro range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
|
||||
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
|
||||
print_message(g_report);
|
||||
|
||||
if (ioctl(fd_gyro, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
err(1, "reset to default polling");
|
||||
|
||||
@@ -1251,16 +1251,7 @@ test()
|
||||
err(1, "immediate gyro read failed");
|
||||
}
|
||||
|
||||
warnx("gyro x: \t% 9.5f\trad/s", (double)g_report.x);
|
||||
warnx("gyro y: \t% 9.5f\trad/s", (double)g_report.y);
|
||||
warnx("gyro z: \t% 9.5f\trad/s", (double)g_report.z);
|
||||
warnx("temp: \t%d\tC", (int)g_report.temperature);
|
||||
warnx("gyro x: \t%d\traw", (int)g_report.x_raw);
|
||||
warnx("gyro y: \t%d\traw", (int)g_report.y_raw);
|
||||
warnx("gyro z: \t%d\traw", (int)g_report.z_raw);
|
||||
warnx("temp: \t%d\traw", (int)g_report.temperature_raw);
|
||||
warnx("gyro range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
|
||||
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
|
||||
print_message(g_report);
|
||||
|
||||
if (ioctl(fd_gyro, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
err(1, "reset to default polling");
|
||||
|
||||
@@ -1965,15 +1965,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
|
||||
warnx("accel x: \t% 9.5f\tm/s^2", (double)accel_report.x);
|
||||
warnx("accel y: \t% 9.5f\tm/s^2", (double)accel_report.y);
|
||||
warnx("accel z: \t% 9.5f\tm/s^2", (double)accel_report.z);
|
||||
warnx("accel x: \t%d\traw", (int)accel_report.x_raw);
|
||||
warnx("accel y: \t%d\traw", (int)accel_report.y_raw);
|
||||
warnx("accel z: \t%d\traw", (int)accel_report.z_raw);
|
||||
|
||||
warnx("accel range: %8.4f m/s^2", (double)accel_report.range_m_s2);
|
||||
print_message(accel_report);
|
||||
|
||||
int fd_mag = -1;
|
||||
struct mag_report m_report;
|
||||
@@ -1999,13 +1991,7 @@ test()
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("mag x: \t% 9.5f\tga", (double)m_report.x);
|
||||
warnx("mag y: \t% 9.5f\tga", (double)m_report.y);
|
||||
warnx("mag z: \t% 9.5f\tga", (double)m_report.z);
|
||||
warnx("mag x: \t%d\traw", (int)m_report.x_raw);
|
||||
warnx("mag y: \t%d\traw", (int)m_report.y_raw);
|
||||
warnx("mag z: \t%d\traw", (int)m_report.z_raw);
|
||||
warnx("mag range: %8.4f ga", (double)m_report.range_ga);
|
||||
print_message(m_report);
|
||||
|
||||
/* reset to default polling */
|
||||
if (ioctl(fd_accel, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
|
||||
@@ -2456,16 +2456,7 @@ test(enum MPU6000_BUS busid)
|
||||
err(1, "immediate acc read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("time: %lld", a_report.timestamp);
|
||||
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
|
||||
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
|
||||
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
|
||||
warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
|
||||
warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
|
||||
warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
|
||||
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
|
||||
(double)(a_report.range_m_s2 / MPU6000_ONE_G));
|
||||
print_message(a_report);
|
||||
|
||||
/* do a simple demand read */
|
||||
sz = read(fd_gyro, &g_report, sizeof(g_report));
|
||||
@@ -2475,17 +2466,7 @@ test(enum MPU6000_BUS busid)
|
||||
err(1, "immediate gyro read failed");
|
||||
}
|
||||
|
||||
warnx("gyro x: \t% 9.5f\trad/s", (double)g_report.x);
|
||||
warnx("gyro y: \t% 9.5f\trad/s", (double)g_report.y);
|
||||
warnx("gyro z: \t% 9.5f\trad/s", (double)g_report.z);
|
||||
warnx("gyro x: \t%d\traw", (int)g_report.x_raw);
|
||||
warnx("gyro y: \t%d\traw", (int)g_report.y_raw);
|
||||
warnx("gyro z: \t%d\traw", (int)g_report.z_raw);
|
||||
warnx("gyro range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
|
||||
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
|
||||
|
||||
warnx("temp: \t%8.4f\tdeg celsius", (double)a_report.temperature);
|
||||
warnx("temp: \t%d\traw 0x%0x", (short)a_report.temperature_raw, (unsigned short)a_report.temperature_raw);
|
||||
print_message(g_report);
|
||||
|
||||
/* reset to default polling */
|
||||
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
|
||||
@@ -331,16 +331,7 @@ test(enum MPU9250_BUS busid)
|
||||
err(1, "immediate acc read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("time: %lld", a_report.timestamp);
|
||||
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
|
||||
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
|
||||
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
|
||||
warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
|
||||
warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
|
||||
warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
|
||||
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
|
||||
(double)(a_report.range_m_s2 / MPU9250_ONE_G));
|
||||
print_message(a_report);
|
||||
|
||||
/* do a simple demand read */
|
||||
sz = read(fd_gyro, &g_report, sizeof(g_report));
|
||||
@@ -350,17 +341,7 @@ test(enum MPU9250_BUS busid)
|
||||
err(1, "immediate gyro read failed");
|
||||
}
|
||||
|
||||
warnx("gyro x: \t% 9.5f\trad/s", (double)g_report.x);
|
||||
warnx("gyro y: \t% 9.5f\trad/s", (double)g_report.y);
|
||||
warnx("gyro z: \t% 9.5f\trad/s", (double)g_report.z);
|
||||
warnx("gyro x: \t%d\traw", (int)g_report.x_raw);
|
||||
warnx("gyro y: \t%d\traw", (int)g_report.y_raw);
|
||||
warnx("gyro z: \t%d\traw", (int)g_report.z_raw);
|
||||
warnx("gyro range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
|
||||
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
|
||||
|
||||
warnx("temp: \t%8.4f\tdeg celsius", (double)a_report.temperature);
|
||||
warnx("temp: \t%d\traw 0x%0x", (short)a_report.temperature_raw, (unsigned short)a_report.temperature_raw);
|
||||
print_message(g_report);
|
||||
|
||||
/* do a simple demand read */
|
||||
sz = read(fd_mag, &m_report, sizeof(m_report));
|
||||
@@ -370,14 +351,7 @@ test(enum MPU9250_BUS busid)
|
||||
err(1, "immediate mag read failed");
|
||||
}
|
||||
|
||||
warnx("mag x: \t% 9.5f\tGa", (double)m_report.x);
|
||||
warnx("mag y: \t% 9.5f\tGa", (double)m_report.y);
|
||||
warnx("mag z: \t% 9.5f\tGa", (double)m_report.z);
|
||||
warnx("mag x: \t%d\traw", (int)m_report.x_raw);
|
||||
warnx("mag y: \t%d\traw", (int)m_report.y_raw);
|
||||
warnx("mag z: \t%d\traw", (int)m_report.z_raw);
|
||||
warnx("mag range: %8.4f Ga", (double)m_report.range_ga);
|
||||
warnx("mag temp: %8.4f\tdeg celsius", (double)m_report.temperature);
|
||||
print_message(m_report);
|
||||
|
||||
/* reset to default polling */
|
||||
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||
|
||||
@@ -1413,12 +1413,7 @@ HMC5883::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
printf("output (%.2f %.2f %.2f)\n", (double)_last_report.x, (double)_last_report.y, (double)_last_report.z);
|
||||
printf("offsets (%.2f %.2f %.2f)\n", (double)_scale.x_offset, (double)_scale.y_offset, (double)_scale.z_offset);
|
||||
printf("scaling (%.2f %.2f %.2f) 1/range_scale %.2f range_ga %.2f\n",
|
||||
(double)_scale.x_scale, (double)_scale.y_scale, (double)_scale.z_scale,
|
||||
(double)(1.0f / _range_scale), (double)_range_ga);
|
||||
printf("temperature %.2f\n", (double)_last_report.temperature);
|
||||
print_message(_last_report);
|
||||
_reports->print_info("report queue");
|
||||
}
|
||||
|
||||
@@ -1598,9 +1593,7 @@ test(enum HMC5883_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* check if mag is onboard or external */
|
||||
if ((ret = ioctl(fd, MAGIOCGEXTERNAL, 0)) < 0) {
|
||||
@@ -1639,9 +1632,7 @@ test(enum HMC5883_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
errx(0, "PASS");
|
||||
|
||||
@@ -1253,12 +1253,7 @@ IST8310::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
printf("output (%.2f %.2f %.2f)\n", (double)_last_report.x, (double)_last_report.y, (double)_last_report.z);
|
||||
printf("offsets (%.2f %.2f %.2f)\n", (double)_scale.x_offset, (double)_scale.y_offset, (double)_scale.z_offset);
|
||||
printf("scaling (%.2f %.2f %.2f) 1/range_scale %.2f\n",
|
||||
(double)_scale.x_scale, (double)_scale.y_scale, (double)_scale.z_scale,
|
||||
(double)(1.0f / _range_scale));
|
||||
printf("temperature %.2f\n", (double)_last_report.temperature);
|
||||
print_message(_last_report);
|
||||
_reports->print_info("report queue");
|
||||
}
|
||||
|
||||
@@ -1412,17 +1407,13 @@ test(enum IST8310_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
PX4_INFO("single read");
|
||||
PX4_INFO("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
PX4_INFO("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* check if mag is onboard or external */
|
||||
if ((ret = ioctl(fd, MAGIOCGEXTERNAL, 0)) < 0) {
|
||||
errx(1, "failed to get if mag is onboard or external");
|
||||
}
|
||||
|
||||
PX4_INFO("device active: %s", ret ? "external" : "onboard");
|
||||
|
||||
/* set the queue depth to 5 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
errx(1, "failed to set queue depth");
|
||||
@@ -1453,9 +1444,7 @@ test(enum IST8310_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
PX4_INFO("periodic read %u", i);
|
||||
PX4_INFO("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
PX4_INFO("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
PX4_INFO("PASS");
|
||||
|
||||
@@ -1297,12 +1297,7 @@ LIS3MDL::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
printf("output (%.2f %.2f %.2f)\n", (double)_last_report.x, (double)_last_report.y, (double)_last_report.z);
|
||||
printf("offsets (%.2f %.2f %.2f)\n", (double)_scale.x_offset, (double)_scale.y_offset, (double)_scale.z_offset);
|
||||
printf("scaling (%.2f %.2f %.2f) 1/range_scale %.2f range_ga %.2f\n",
|
||||
(double)_scale.x_scale, (double)_scale.y_scale, (double)_scale.z_scale,
|
||||
(double)(1.0f / _range_scale), (double)_range_ga);
|
||||
printf("temperature %.2f\n", (double)_last_report.temperature);
|
||||
print_message(_last_report);
|
||||
_reports->print_info("report queue");
|
||||
}
|
||||
|
||||
@@ -1494,17 +1489,13 @@ test(enum LIS3MDL_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* check if mag is onboard or external */
|
||||
if ((ret = ioctl(fd, MAGIOCGEXTERNAL, 0)) < 0) {
|
||||
errx(1, "failed to get if mag is onboard or external");
|
||||
}
|
||||
|
||||
warnx("device active: %s", ret ? "external" : "onboard");
|
||||
|
||||
/* set the queue depth to 5 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
errx(1, "failed to set queue depth");
|
||||
@@ -1535,9 +1526,7 @@ test(enum LIS3MDL_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
errx(0, "PASS");
|
||||
|
||||
@@ -872,11 +872,7 @@ test()
|
||||
warnx("immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("pixel_flow_x_integral: %i", f_integral.pixel_flow_x_integral);
|
||||
warnx("pixel_flow_y_integral: %i", f_integral.pixel_flow_y_integral);
|
||||
warnx("framecount_integral: %u",
|
||||
f_integral.frame_count_since_last_readout);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 10Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 10)) {
|
||||
@@ -903,25 +899,7 @@ test()
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
|
||||
warnx("framecount_total: %u", f.frame_count);
|
||||
warnx("framecount_integral: %u",
|
||||
f_integral.frame_count_since_last_readout);
|
||||
warnx("pixel_flow_x_integral: %i", f_integral.pixel_flow_x_integral);
|
||||
warnx("pixel_flow_y_integral: %i", f_integral.pixel_flow_y_integral);
|
||||
warnx("gyro_x_rate_integral: %i", f_integral.gyro_x_rate_integral);
|
||||
warnx("gyro_y_rate_integral: %i", f_integral.gyro_y_rate_integral);
|
||||
warnx("gyro_z_rate_integral: %i", f_integral.gyro_z_rate_integral);
|
||||
warnx("integration_timespan [us]: %u", f_integral.integration_timespan);
|
||||
warnx("ground_distance: %0.2f m",
|
||||
(double) f_integral.ground_distance / 1000);
|
||||
warnx("time since last sonar update [us]: %i",
|
||||
f_integral.sonar_timestamp);
|
||||
warnx("quality integration average : %i", f_integral.qual);
|
||||
warnx("quality : %i", f.qual);
|
||||
|
||||
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
errx(0, "PASS");
|
||||
|
||||
@@ -1214,7 +1214,7 @@ UavcanNode::print_info()
|
||||
printf("ESC mixer: %s\n", (_mixers == nullptr) ? "NONE" : "OK");
|
||||
|
||||
if (_outputs.noutputs != 0) {
|
||||
printf("ESC output: ");
|
||||
PX4_INFO("ESC output: ");
|
||||
|
||||
for (uint8_t i = 0; i < _outputs.noutputs; i++) {
|
||||
printf("%d ", (int)(_outputs.output[i] * 1000));
|
||||
@@ -1224,28 +1224,11 @@ UavcanNode::print_info()
|
||||
|
||||
// ESC status
|
||||
int esc_sub = orb_subscribe(ORB_ID(esc_status));
|
||||
struct esc_status_s esc;
|
||||
memset(&esc, 0, sizeof(esc));
|
||||
esc_status_s esc = {};
|
||||
orb_copy(ORB_ID(esc_status), esc_sub, &esc);
|
||||
|
||||
printf("ESC Status:\n");
|
||||
printf("Addr\tV\tA\tTemp\tSetpt\tRPM\tErr\n");
|
||||
|
||||
for (uint8_t i = 0; i < _outputs.noutputs; i++) {
|
||||
const float temp_celsius = (esc.esc[i].esc_temperature > 0) ?
|
||||
(esc.esc[i].esc_temperature - 273.15F) : 0.0F;
|
||||
|
||||
printf("%d\t", esc.esc[i].esc_address);
|
||||
printf("%3.2f\t", (double)esc.esc[i].esc_voltage);
|
||||
printf("%3.2f\t", (double)esc.esc[i].esc_current);
|
||||
printf("%3.2f\t", (double)temp_celsius);
|
||||
printf("%3.2f\t", (double)esc.esc[i].esc_setpoint);
|
||||
printf("%d\t", esc.esc[i].esc_rpm);
|
||||
printf("%d", esc.esc[i].esc_errorcount);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
orb_unsubscribe(esc_sub);
|
||||
|
||||
print_message(esc);
|
||||
}
|
||||
|
||||
// Sensor bridges
|
||||
|
||||
@@ -395,8 +395,7 @@ test()
|
||||
return 1;
|
||||
}
|
||||
|
||||
PX4_WARN("single read");
|
||||
PX4_WARN("diff pressure: %d pa", (int)report.differential_pressure_filtered_pa);
|
||||
print_message(report);
|
||||
|
||||
/* start the sensor polling at 2Hz */
|
||||
if (OK != px4_ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
|
||||
@@ -423,9 +422,7 @@ test()
|
||||
PX4_WARN("periodic read failed");
|
||||
}
|
||||
|
||||
PX4_WARN("periodic read %u", i);
|
||||
PX4_WARN("diff pressure: %d pa", (int)report.differential_pressure_filtered_pa);
|
||||
PX4_WARN("temperature: %d C (0x%02x)", (int)report.temperature, (unsigned) report.temperature);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
/* reset the sensor polling to its default rate */
|
||||
|
||||
@@ -380,16 +380,7 @@ GPSSIM::print_info()
|
||||
_report_gps_pos.jamming_indicator == 255 ? "YES" : "NO");
|
||||
|
||||
if (_report_gps_pos.timestamp != 0) {
|
||||
PX4_INFO("position lock: %dD, satellites: %d, last update: %8.4fms ago", (int)_report_gps_pos.fix_type,
|
||||
_report_gps_pos.satellites_used, (double)(hrt_absolute_time() - _report_gps_pos.timestamp) / 1000.0);
|
||||
PX4_INFO("lat: %d, lon: %d, alt: %d", _report_gps_pos.lat, _report_gps_pos.lon, _report_gps_pos.alt);
|
||||
PX4_INFO("vel: %.2fm/s, %.2fm/s, %.2fm/s", (double)_report_gps_pos.vel_n_m_s,
|
||||
(double)_report_gps_pos.vel_e_m_s, (double)_report_gps_pos.vel_d_m_s);
|
||||
PX4_INFO("eph: %.2fm, epv: %.2fm", (double)_report_gps_pos.eph, (double)_report_gps_pos.epv);
|
||||
//PX4_INFO("rate position: \t%6.2f Hz", (double)_Helper->get_position_update_rate());
|
||||
//PX4_INFO("rate velocity: \t%6.2f Hz", (double)_Helper->get_velocity_update_rate());
|
||||
PX4_INFO("rate publication:\t%6.2f Hz", (double)_rate);
|
||||
|
||||
print_message(_report_gps_pos);
|
||||
}
|
||||
|
||||
usleep(100000);
|
||||
|
||||
Reference in New Issue
Block a user