mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 23:33:34 +08:00
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:
co-authored by
Beat Küng
parent
cb682006fe
commit
24d06047bd
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user