New `tdma_multi_mac_node` node to handle switching among multiple tdma nodes using software mute
New Features / Improvements
- new node
TdmaMultiMacNodeand new messageTdmaMultiMacStatus.msg- this MR will be calling an instance of
TdmaMultiMacNodeatdma_managerbut there is no requirement it be named this. - the
TdmaMultiMacNode(calledtdma_managerin the exampletest_tdma_multi_mac.launch) allows you to configure and switch between N tdma mac instances of different types and configs. - the
tdma_managerwill only have ONEtdma_namespaceactive at a time. It usessoftware_muteto keep all other tdma macssoftware_mute:True. (tdma macs MUST inherit fromtdma_advancedto getsoftware_mute. Only the base tdma cannot be managed bytdma_multi_mac) -
~default_tdma_namespace: MUST be set to string with tdma namespace relative to grouptdma_manageris in to start and use as the default tdma mac. -
~managed_tdma_namespaces: List of strings with namespaces relative totdma_manager. These TDMA nodes MUST exist and not crash or thetdma_managerwill be blocked waiting for it to come up before being active! -
TODO
~managed_tdma_heartbeat_timeout_sec: doesn't currently work (not hooked up). Will eventually require clients oftdma_managerto publish a heartbeat of some kind when amanaged_tdma_namespaceis active, else we revert to the default tdma if we don't get the heartbeat. (heart beat could be locally generated OR be an acoustic message)
- this MR will be calling an instance of
Notes
- there is an example launch file here:
ros_acomms/ros_acomms_tests/launch/test_tdma_multi_mac.launch. Use this as an example for the required parts of a launch file using atdma_manager - if you specify the managed tdma nodes out of order from the list passed to
tdma_multi_mac~managed_tdma_namespacesrosparam, unexpected behavior happens due to the serial nature of the initialization on the tdma manager (going through each tdma node at a time, blocking until that node is up and we have set it to mute and confirmed on the param server. An out of order launch file will cause the initial period before all tdma nodes are nominal to behave weird). - make sure the
~managed_tdma_namespacesdo not overlap and are all unique. - probably a good idea to add the following to
managed_tdma_namespacesnode xml tagclear_params="true" -
tdma_multi_macpublishes status here:/<platform>/tdma_multi_mac_status. This is a great source of info for the currently active tdma mac. This is a latched topic so you'll get the last msg whenever subscribe happens.
Tutorial
- how to select and switch between multiple macs using a
TdmaMultiMacNodeinstance:- say we have a list of
managed_tdma_namespacesand adefault_tdma_namespaceof:default_tdma_namespace: 'tdma' managed_tdma_namespaces: - 'tdma_A' - 'tdma_B' - 'tdma_C' - 'tdma_D'- to select
'tdma_A', ('tdma' --> 'tdma_A') publish astd_msgs/Booldata=Trueto the topic/<platform>/<tdma_manager_name>/tdma_A/select - to select
'tdma_B', ('tdma_A' --> 'tdma_B') publish astd_msgs/Booldata=Trueto the topic/<platform>/<tdma_manager_name>/tdma_B/select - to select
'tdma_C', ('tdma_B' --> 'tdma_C') publish astd_msgs/Booldata=Trueto the topic/<platform>/<tdma_manager_name>/tdma_C/select - to select
'tdma_D', ('tdma_C' --> 'tdma_D') publish astd_msgs/Booldata=Trueto the topic/<platform>/<tdma_manager_name>/tdma_D/select - to de-select
'tdma_D', ('tdma_D' --> 'tdma') publish astd_msgs/Booldata=Falseto the topic/<platform>/<tdma_manager_name>/tdma_D/select, this will put you back in thedefault_tdma_namespace.
- to select
- say we have a list of
Edited by Caileigh Fitzgerald