Description
When switching WiFi networks from the WiFi network with the ros bridge to a different WiFi network and then returning to the WiFi network with the ros bridge, will result sometimes with ros object stuck on is_connecting=True when trying to reconnect the ros bridge, even if the ros connection was closed properly.
More details
1.Trying to do initiate close() function of the ros object and then connect() function didn't helped in solving the problem.
When looking closer at the problem I noticed the connector state of the RosBridgeClientFactory object is also stuck on 'connecting' tried closing and opening the factory connector.
Switching between WiFi networks again didn't solved the problem.
The ros bridge connection was closed properly every time.
Source of the problem
When investigating the reason for this problem, I noticed it happens as a result of the mainloop function in /twisted/internet/base.py calls
self.doIteration function with t=None, this function call result with the epollreactor object running the doPoll function with timeout=None, which means he waits indefinitely.
Solution I found
I have created a timer which checks if we are in state of is_connecting=True for to long, if that's the case I run the following command:
Description When switching WiFi networks from the WiFi network with the ros bridge to a different WiFi network and then returning to the WiFi network with the ros bridge, will result sometimes with ros object stuck on is_connecting=True when trying to reconnect the ros bridge, even if the ros connection was closed properly.
More details 1.Trying to do initiate close() function of the ros object and then connect() function didn't helped in solving the problem.
Source of the problem When investigating the reason for this problem, I noticed it happens as a result of the mainloop function in /twisted/internet/base.py calls self.doIteration function with t=None, this function call result with the epollreactor object running the doPoll function with timeout=None, which means he waits indefinitely.
Solution I found I have created a timer which checks if we are in state of is_connecting=True for to long, if that's the case I run the following command:
I wont get to details why it solves the problem.
To Reproduce
System: