-
Notifications
You must be signed in to change notification settings - Fork 0
Joining the arena
For MQTT entities, it is necessary to publish an ArenaHeartbeat message directly to the MQTT broker.
To "see" the arena, simply subscribe to all units' heartbeats using + wildcards: conceptio/unit/+/+/+/heartbeat. To see the position, subscribe to conceptio/unit/+/+/+/data/kinematics
If you are integrating entities into the same local network as the arena, simply publish to ROS2 topics. Mqtt_mirror will listen to ROS2 topics and broadcast them to the MQTT broker, and vice-versa.
As ROS2 does discovery with UDP multicasting, communicating with ROS2 entities across the internet is troublesome. Instead of using a VPN (which may require extra permissions to run/setup), remote ROS2 entities can use the mqtt_client bridge.
The bridge allows ROS2 topics to be mapped to MQTT topics at the broker and vice-versa. The downside is that you must know all topic names when starting the node; mqtt_client does not allow you to subscribe to all topics using the # wildcard, nor it allows you to do late subscriptions. To deal with that, you can use our forked version of mqtt_client that has new services (NewRos2ToMqtt and NewMqttToRos2) for dynamic subscription (a pull request has been opened). Once you have all MQTT <-> ROS2 mappings, just follow the MQTT topic structure and instructions to join and "see" the arena.
To sum it up, here is how to join using a remote ROS2 environment:
- Clone the forked version of mqtt_client.
- Follow mqtt_client README to launch the node with your entity topic mappings (ROS2->MQTT).
- In your nodes, use the RequestArenaEntityList service to periodically fetch all entities currently alive in the arena, and then call the RegisterMqttToRos2 service for each new mapping.
- Subscribe to the
/conceptio/arena/entity_updatestopic and set up a callback to do something whenever a new entity is found or removed from the arena (ideally, your callback should call the RegisterMqttToRos2 service to set up a new mapping for this newly-found entity).
Developed by Conceptio Lab for the Virtual Demonstrator project. For more information contact cogo@ita.br