mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:53:34 +08:00
gps add device_id
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user