UAVCAN: Add device tracking and information publishing (#25617)

* uavcan: collect node info and publish every second

* UORB: Add DeviceInformation Message

Format DeviceInformation.msg with standard comment spaces

* SENS: add getter for device_id

* UAVCAN: add publishing of DeviceInformation based on publised message type, and Node Information

* LOG: add deviceInformation

* MSG:BAT: fix comment to be inline with the max_instaces

* UAVCAN: DeviceInformation, incorporated feedback

* UAVCAN: DeviceInformation, incorporated feedback

* UAVCAN: DeviceInformation, Fixed bug with Powermonitor

---------

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
This commit is contained in:
Claudio Chies
2025-12-16 14:53:44 -09:00
committed by GitHub
co-authored by Beat Küng
parent cb682006fe
commit 24d06047bd
43 changed files with 685 additions and 67 deletions
+6 -1
View File
@@ -107,6 +107,7 @@ UavcanNode::UavcanNode(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &sys
_time_sync_slave(_node),
_node_status_monitor(_node),
_node_info_retriever(_node),
_node_info_publisher(_node, _node_info_retriever),
_master_timer(_node),
_param_getset_client(_node),
_param_opcode_client(_node),
@@ -595,7 +596,7 @@ UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events)
}
// Sensor bridges
IUavcanSensorBridge::make_all(_node, _sensor_bridges);
IUavcanSensorBridge::make_all(_node, _sensor_bridges, &_node_info_publisher);
for (const auto &br : _sensor_bridges) {
ret = br->init();
@@ -608,6 +609,10 @@ UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events)
PX4_DEBUG("sensor bridge '%s' init ok", br->get_name());
}
#if defined(CONFIG_UAVCAN_OUTPUTS_CONTROLLER)
_esc_controller.set_node_info_publisher(&_node_info_publisher);
#endif
/* Set up shared service clients */
_param_getset_client.setCallback(GetSetCallback(this, &UavcanNode::cb_getset));
_param_opcode_client.setCallback(ExecuteOpcodeCallback(this, &UavcanNode::cb_opcode));