Restricting communication between robots

Just to provide an update on how we are working around this issue at my company (which may not work for most users, as it is strictly limited to DDS RMWs), we are making slight modifications the RMW implementations (rmw_cyclonedds_cpp and rmw_connextdds) to allow us to get a handle to the underlying Publisher/Subscriber entity and modify its partition policy dynamically, following the pattern I laid out in the github issue @v-lopez linked above.

On each robot, we have one ROS2 node acting as a Beacon publishing its UUID with a default wildcard partition, and all other nodes have their partition modified to reflect the robot’s UUID. On the client/peer side, this allows the flexibility to make an explicit ‘connection’ (discovery limit) to a specific robot, or use the wildcard partition to subscribe/publish to all robots (mostly useful for introspective/debugging purposes, or to subscribe to the Beacon topic to discover participants in the network).