Browse Source

only advertise range topic of px4flow board if it is the primary range device (#5390)

this allows selecting another range device such as a lidar by starting that app first
sbg
Nicolas de Palezieux 9 years ago committed by Lorenz Meier
parent
commit
ebce93f338
  1. 5
      src/drivers/px4flow/px4flow.cpp

5
src/drivers/px4flow/px4flow.cpp

@ -245,6 +245,7 @@ PX4FLOW::init() @@ -245,6 +245,7 @@ PX4FLOW::init()
/* get a publish handle on the range finder topic */
struct distance_sensor_s ds_report = {};
if (_class_instance == CLASS_DEVICE_PRIMARY) {
_distance_sensor_topic = orb_advertise_multi(ORB_ID(distance_sensor), &ds_report,
&_orb_class_instance, ORB_PRIO_HIGH);
@ -252,6 +253,10 @@ PX4FLOW::init() @@ -252,6 +253,10 @@ PX4FLOW::init()
DEVICE_LOG("failed to create distance_sensor object. Did you start uOrb?");
}
} else {
DEVICE_LOG("not primary range device, not advertising");
}
ret = OK;
/* sensor is ok, but we don't really know if it is within range */
_sensor_ok = true;

Loading…
Cancel
Save