Skip to content

Commit

Permalink
Merge pull request PX4#4052 from PX4/revert_sonar_pub
Browse files Browse the repository at this point in the history
Revert "px4flow: disable distance data transmission from px4flow sensor"
  • Loading branch information
jgoppert committed Mar 21, 2016
2 parents 20720bd + acf9be4 commit 2cf5fb8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/drivers/px4flow/px4flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,17 @@ PX4FLOW::init()
return ret;
}

//_class_instance = register_class_devname(RANGE_FINDER_BASE_DEVICE_PATH);
_class_instance = register_class_devname(RANGE_FINDER_BASE_DEVICE_PATH);

/* get a publish handle on the range finder topic */
//struct distance_sensor_s ds_report = {};
struct distance_sensor_s ds_report = {};

//_distance_sensor_topic = orb_advertise_multi(ORB_ID(distance_sensor), &ds_report,
// &_orb_class_instance, ORB_PRIO_HIGH);
_distance_sensor_topic = orb_advertise_multi(ORB_ID(distance_sensor), &ds_report,
&_orb_class_instance, ORB_PRIO_HIGH);

//if (_distance_sensor_topic == nullptr) {
// DEVICE_LOG("failed to create distance_sensor object. Did you start uOrb?");
//}
if (_distance_sensor_topic == nullptr) {
DEVICE_LOG("failed to create distance_sensor object. Did you start uOrb?");
}

ret = OK;
/* sensor is ok, but we don't really know if it is within range */
Expand Down Expand Up @@ -554,18 +554,18 @@ PX4FLOW::collect()
}

/* publish to the distance_sensor topic as well */
/*struct distance_sensor_s distance_report;
struct distance_sensor_s distance_report;
distance_report.timestamp = report.timestamp;
distance_report.min_distance = PX4FLOW_MIN_DISTANCE;
distance_report.max_distance = PX4FLOW_MAX_DISTANCE;
distance_report.current_distance = report.ground_distance_m;
distance_report.covariance = 0.0f;
distance_report.type = distance_sensor_s::MAV_DISTANCE_SENSOR_ULTRASOUND;
*//* TODO: the ID needs to be properly set */
//distance_report.id = 0;
//distance_report.orientation = 8;
/* TODO: the ID needs to be properly set */
distance_report.id = 0;
distance_report.orientation = 8;

//orb_publish(ORB_ID(distance_sensor), _distance_sensor_topic, &distance_report);
orb_publish(ORB_ID(distance_sensor), _distance_sensor_topic, &distance_report);

/* post a report to the ring */
if (_reports->force(&report)) {
Expand Down

0 comments on commit 2cf5fb8

Please sign in to comment.