domain_coordinator.impl module

class domain_coordinator.impl.default_selector

Bases: object

domain_coordinator.impl.domain_id(selector=None)

Get a ROS_DOMAIN_ID from 1 to 100 that will not conflict with other ROS_DOMAIN_IDs.

Processes can use domain_id() to generate ROS_DOMAIN_IDs which allow them to use ROS 2 without unexpected cross-talk between processes. This is similar to the ROS 1 rostest behavior of putting the ROS master on a unique port.

domain_id() is a context manager. The returned domain ID remains reserved for the scope of the context and can be reused afterwards.