mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 00:33:33 +08:00
drivers start using uORB message print instead of custom
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user