drivers: more adaptations to changed message

This commit is contained in:
Ban Siesta
2015-05-24 15:57:42 +01:00
parent 103d59e9be
commit 0128fef8e0
3 changed files with 16 additions and 12 deletions
+5 -4
View File
@@ -575,13 +575,14 @@ SF0X::collect()
struct distance_sensor_s report;
report.timestamp = hrt_absolute_time();
report.id = 2;
report.type = 0;
report.type = distance_sensor_s::MAV_DISTANCE_SENSOR_LASER;
report.orientation = 8;
report.current_distance = distance_m;
report.min_distance = get_minimum_distance();
report.max_distance = get_maximum_distance();
report.covariance = 0.0f;
/* TODO: set proper ID */
report.id = 0;
/* publish it */
orb_publish(ORB_ID(distance_sensor), _distance_sensor_topic, &report);
@@ -835,7 +836,7 @@ test()
warnx("single read");
warnx("val: %0.2f m", (double)report.current_distance);
warnx("time: %d", report.time_boot_ms);
warnx("time: %llu", report.timestamp);
/* start the sensor polling at 2 Hz rate */
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 2)) {
@@ -866,7 +867,7 @@ test()
warnx("read #%u", i);
warnx("val: %0.3f m", (double)report.current_distance);
warnx("time: %d", report.time_boot_ms);
warnx("time: %llu", report.timestamp);
}
/* reset the sensor polling to the default rate */