diff --git a/external_dependencies/unitree_sdk2_python/setup.py b/external_dependencies/unitree_sdk2_python/setup.py index 54d8cac8a..ad2252e61 100644 --- a/external_dependencies/unitree_sdk2_python/setup.py +++ b/external_dependencies/unitree_sdk2_python/setup.py @@ -14,7 +14,7 @@ }, python_requires='>=3.8', install_requires=[ - "cyclonedds==0.10.2", + "cyclonedds>=0.10.2,<12", "numpy", "opencv-python", ], diff --git a/external_dependencies/unitree_sdk2_python/unitree_sdk2py/core/channel.py b/external_dependencies/unitree_sdk2_python/unitree_sdk2py/core/channel.py index daacc6323..1f7f603d6 100644 --- a/external_dependencies/unitree_sdk2_python/unitree_sdk2py/core/channel.py +++ b/external_dependencies/unitree_sdk2_python/unitree_sdk2py/core/channel.py @@ -196,6 +196,13 @@ def __init__(self): super().__init__() def Init(self, id: int, networkInterface: str = None, qos: Qos = None): + # Idempotent: the factory is a Singleton, and re-creating the Domain for + # the same process raises on cyclonedds >= 11 ("Occurred upon + # initialisation of a cyclonedds.domain.Domain"). gear_sonic initializes + # from both the control loop and the simulator in one process, so a + # second Init with an already-live domain must be a no-op. + if self.__domain is not None: + return True config = None # choose config if networkInterface is None: