move initial sensor priority to parameters and purge ORB_PRIORITY

- CAL_ACCx_EN -> CAL_ACCx_PRIO
 - CAL_GYROx_EN -> CAL_GYROx_PRIO
 - CAL_MAGx_EN -> CAL_MAGx_PRIO
This commit is contained in:
Daniel Agar
2020-08-21 10:12:13 -04:00
parent 971b1e4b4d
commit 27f23ac290
124 changed files with 463 additions and 509 deletions
@@ -87,7 +87,7 @@ static constexpr unsigned char crc_lsb_vector[] = {
CM8JL65::CM8JL65(const char *port, uint8_t rotation) :
ScheduledWorkItem(MODULE_NAME, px4::serial_port_to_wq(port)),
_px4_rangefinder(0 /* TODO: device ids */, ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(0 /* TODO: device ids */, rotation)
{
// Store the port name.
strncpy(_port, port, sizeof(_port) - 1);
@@ -39,7 +39,7 @@
LeddarOne::LeddarOne(const char *serial_port, uint8_t device_orientation):
ScheduledWorkItem(MODULE_NAME, px4::serial_port_to_wq(serial_port)),
_px4_rangefinder(0 /* device id not yet used */, ORB_PRIO_DEFAULT, device_orientation)
_px4_rangefinder(0 /* device id not yet used */, device_orientation)
{
_serial_port = strdup(serial_port);
@@ -45,7 +45,7 @@ LidarLiteI2C::LidarLiteI2C(I2CSPIBusOption bus_option, const int bus, const uint
const int address) :
I2C(DRV_RNG_DEVTYPE_LL40LS, MODULE_NAME, bus, address, bus_frequency),
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
_px4_rangefinder(get_device_id(), ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(get_device_id(), rotation)
{
_px4_rangefinder.set_min_distance(LL40LS_MIN_DISTANCE);
_px4_rangefinder.set_max_distance(LL40LS_MAX_DISTANCE);
@@ -50,7 +50,7 @@
LidarLitePWM::LidarLitePWM(const uint8_t rotation) :
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_px4_rangefinder(0 /* device id not yet used */, ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(0 /* device id not yet used */, rotation)
{
_px4_rangefinder.set_min_distance(LL40LS_MIN_DISTANCE);
_px4_rangefinder.set_max_distance(LL40LS_MAX_DISTANCE);
@@ -275,8 +275,7 @@ MappyDot::collect()
report.variance = 0;
int instance_id;
orb_publish_auto(ORB_ID(distance_sensor), &_distance_sensor_topic, &report, &instance_id, ORB_PRIO_DEFAULT);
orb_publish_auto(ORB_ID(distance_sensor), &_distance_sensor_topic, &report, &instance_id);
}
perf_end(_sample_perf);
@@ -233,7 +233,7 @@ MB12XX::collect()
report.variance = 0.0f;
int instance_id;
orb_publish_auto(ORB_ID(distance_sensor), &_distance_sensor_topic, &report, &instance_id, ORB_PRIO_DEFAULT);
orb_publish_auto(ORB_ID(distance_sensor), &_distance_sensor_topic, &report, &instance_id);
// Begin the next measurement.
if (measure() != PX4_OK) {
+1 -1
View File
@@ -41,7 +41,7 @@
SF0X::SF0X(const char *port, uint8_t rotation) :
ScheduledWorkItem(MODULE_NAME, px4::serial_port_to_wq(port)),
_px4_rangefinder(0 /* device id not yet used */, ORB_PRIO_DEFAULT, rotation),
_px4_rangefinder(0 /* device id not yet used */, rotation),
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read")),
_comms_errors(perf_alloc(PC_COUNT, MODULE_NAME": com_err"))
{
+1 -1
View File
@@ -117,7 +117,7 @@ private:
SF1XX::SF1XX(I2CSPIBusOption bus_option, const int bus, const uint8_t rotation, int bus_frequency, int address) :
I2C(DRV_DIST_DEVTYPE_SF1XX, MODULE_NAME, bus, address, bus_frequency),
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
_px4_rangefinder(DRV_DIST_DEVTYPE_SF1XX, ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(DRV_DIST_DEVTYPE_SF1XX, rotation)
{
}
+1 -1
View File
@@ -36,7 +36,7 @@
SRF02::SRF02(I2CSPIBusOption bus_option, const int bus, const uint8_t rotation, int bus_frequency, int address) :
I2C(DRV_DIST_DEVTYPE_SRF02, MODULE_NAME, bus, address, bus_frequency),
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
_px4_rangefinder(get_device_id(), ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(get_device_id(), rotation)
{
_px4_rangefinder.set_max_distance(SRF02_MAX_DISTANCE);
_px4_rangefinder.set_min_distance(SRF02_MIN_DISTANCE);
@@ -76,7 +76,7 @@ static uint8_t crc8(uint8_t *p, uint8_t len)
TERARANGER::TERARANGER(I2CSPIBusOption bus_option, const int bus, const uint8_t rotation, int bus_frequency) :
I2C(DRV_DIST_DEVTYPE_TERARANGER, MODULE_NAME, bus, TERARANGER_ONE_BASEADDR, bus_frequency),
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
_px4_rangefinder(get_device_id(), ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(get_device_id(), rotation)
{
// up the retries since the device misses the first measure attempts
I2C::_retries = 3;
@@ -37,7 +37,7 @@
TFMINI::TFMINI(const char *port, uint8_t rotation) :
ScheduledWorkItem(MODULE_NAME, px4::serial_port_to_wq(port)),
_px4_rangefinder(0 /* TODO: device id */, ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(0 /* TODO: device id */, rotation)
{
// store port name
strncpy(_port, port, sizeof(_port) - 1);
@@ -35,7 +35,7 @@
AerotennaULanding::AerotennaULanding(const char *port, uint8_t rotation) :
ScheduledWorkItem(MODULE_NAME, px4::serial_port_to_wq(port)),
_px4_rangefinder(0 /* TODO: device ids */, ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(0 /* TODO: device ids */, rotation)
{
/* store port name */
strncpy(_port, port, sizeof(_port) - 1);
@@ -62,7 +62,7 @@
VL53L0X::VL53L0X(I2CSPIBusOption bus_option, const int bus, const uint8_t rotation, int bus_frequency, int address) :
I2C(DRV_DIST_DEVTYPE_VL53L0X, MODULE_NAME, bus, address, bus_frequency),
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
_px4_rangefinder(0 /* device id not yet used */, ORB_PRIO_DEFAULT, rotation)
_px4_rangefinder(0 /* device id not yet used */, rotation)
{
// VL53L0X typical range 0-2 meters with 25 degree field of view
_px4_rangefinder.set_min_distance(0.f);