UAVCAN: Make GPS module use the multi-topic facility so that a normal GPS and an UAVCAN GPS can co-exist and do not write on top of each other.

This commit is contained in:
Lorenz Meier 2016-12-26 12:10:57 +01:00
parent da198a40c5
commit 66b9ee2d24
1 changed files with 4 additions and 7 deletions

View File

@ -180,11 +180,8 @@ void UavcanGnssBridge::gnss_fix_sub_cb(const uavcan::ReceivedDataStructure<uavca
report.hdop = msg.pdop;
report.vdop = msg.pdop;
if (_report_pub != nullptr) {
orb_publish(ORB_ID(vehicle_gps_position), _report_pub, &report);
} else {
_report_pub = orb_advertise(ORB_ID(vehicle_gps_position), &report);
}
// Publish to a multi-topic
int32_t gps_orb_instance;
orb_publish_auto(ORB_ID(vehicle_gps_position), &_report_pub, &report, &gps_orb_instance,
ORB_PRIO_HIGH);
}