I am currently working on a very simple ROS2 driver for the RoboMaster. I don't want to use the MultiRobot API, instead, I want to start multiple processes that connect to each robot with the single robot API (it makes more sense to have an independent ROS node for each robot).
This works if I start the nodes independently, but if they are launched at the same time in a launch file, only one of the processes will be able to send the UDP broadcast and the other ones will throw the EADDRINUSE exception. In this PR, I catch this specific error code (raise all other ones), therefore if multiple processes attempt an IP scan at the same time, it will just wait for the timeout instead of failing immediately.
I am currently working on a very simple ROS2 driver for the RoboMaster. I don't want to use the MultiRobot API, instead, I want to start multiple processes that connect to each robot with the single robot API (it makes more sense to have an independent ROS node for each robot). This works if I start the nodes independently, but if they are launched at the same time in a launch file, only one of the processes will be able to send the UDP broadcast and the other ones will throw the EADDRINUSE exception. In this PR, I catch this specific error code (raise all other ones), therefore if multiple processes attempt an IP scan at the same time, it will just wait for the timeout instead of failing immediately.