PixHawk Pro: Update mag IDs to have external higher priority

This commit is contained in:
Mathieu Bresciani 2017-03-07 14:32:57 +01:00 committed by Lorenz Meier
parent daf668e687
commit d67b6efda3
3 changed files with 7 additions and 1 deletions

View File

@ -941,6 +941,11 @@ LIS3MDL::collect()
new_report.temperature = report.t;
new_report.temperature = 25 + (report.t / (16 * 8.0f));
// XXX revisit for SPI part, might require a bus type IOCTL
unsigned dummy;
sensor_is_onboard = !_interface->ioctl(MAGIOCGEXTERNAL, dummy);
/*
* RAW outputs
*

View File

@ -155,6 +155,7 @@ void UavcanMagnetometerBridge::mag_sub_cb(const uavcan::ReceivedDataStructure<ua
* The proper solution is to be developed.
*/
_report.timestamp = hrt_absolute_time();
_report.device_id = _device_id.devid;
_report.x = (msg.magnetic_field_ga[0] - _scale.x_offset) * _scale.x_scale;
_report.y = (msg.magnetic_field_ga[1] - _scale.y_offset) * _scale.y_scale;

View File

@ -120,7 +120,7 @@ void UavcanCDevSensorBridgeBase::publish(const int node_id, const void *report)
channel->node_id = node_id;
channel->class_instance = class_instance;
channel->orb_advert = orb_advertise_multi(_orb_topic, report, &channel->orb_instance, ORB_PRIO_HIGH);
channel->orb_advert = orb_advertise_multi(_orb_topic, report, &channel->orb_instance, ORB_PRIO_VERY_HIGH);
if (channel->orb_advert == nullptr) {
DEVICE_LOG("ADVERTISE FAILED");
(void)unregister_class_devname(_class_devname, class_instance);