gps add device_id

This commit is contained in:
Daniel Agar
2021-04-08 08:27:07 +02:00
committed by Beat Küng
parent 1f4960d480
commit 39c96a8884
10 changed files with 104 additions and 6 deletions
+3
View File
@@ -64,6 +64,8 @@ UavcanGnssBridge::UavcanGnssBridge(uavcan::INode &node) :
for (uint8_t i = 0; i < _max_channels; i++) {
_channel_using_fix2[i] = false;
}
set_device_type(DRV_GPS_DEVTYPE_UAVCAN);
}
UavcanGnssBridge::~UavcanGnssBridge()
@@ -282,6 +284,7 @@ void UavcanGnssBridge::process_fixx(const uavcan::ReceivedDataStructure<FixType>
const bool valid_pos_cov, const bool valid_vel_cov)
{
sensor_gps_s report{};
report.device_id = get_device_id();
/*
* FIXME HACK
@@ -114,6 +114,7 @@ UavcanSensorBridgeBase::publish(const int node_id, const void *report)
// update device id as we now know our device node_id
_device_id.devid_s.address = static_cast<uint8_t>(node_id);
_device_id.devid_s.bus_type = DeviceBusType::DeviceBusType_UAVCAN;
// Publish to the appropriate topic, abort on failure
channel->orb_advert = orb_advertise_multi(_orb_topic, report, &channel->instance);