Unity-Technologies / ROS-TCP-Endpoint

ROS package used to create an endpoint to accept ROS messages sent from a Unity scene using the ROS TCP Connector scripts
Apache License 2.0
179 stars 119 forks source link

Process exit, rclpy._rclpy_pybind11.InvalidHandle: cannot use Destroyable because destruction was requested #148

Open conby opened 2 years ago

conby commented 2 years ago

Describe the bug Endpoint process exit with error: rclpy._rclpy_pybind11.InvalidHandle: cannot use Destroyable because destruction was requested

To Reproduce

  1. boot ROS-TCP-Endpoint node (ROS2)
  2. try to connect and disconnect from unity client several times
  3. Endpoint process exited with error
  4. See error

Console logs / stack traces [INFO] [1652075356.407162168] [UnityEndpoint]: Disconnected from 192.168.8.166 [INFO] [1652076762.672048998] [UnityEndpoint]: Connection from 192.168.8.166 [INFO] [1652076763.037987192] [UnityEndpoint]: RegisterSubscriber(/image2, <class 'sensor_msgs.msg._compressed_image.CompressedImage'>) OK [INFO] [1652076763.106981882] [UnityEndpoint]: RegisterSubscriber(/imagez, <class 'sensor_msgs.msg._compressed_image.CompressedImage'>) OK The following exception was never retrieved: 'NoneType' object has no attribute 'put' [INFO] [1652076763.602603903] [UnityEndpoint]: RegisterSubscriber(/tf, <class 'tf2_msgs.msg._tf_message.TFMessage'>) OK Traceback (most recent call last): File "/home/hee/ros2_galactic/install/ros_tcp_endpoint/lib/ros_tcp_endpoint/default_server_endpoint", line 33, in sys.exit(load_entry_point('ros-tcp-endpoint', 'console_scripts', 'default_server_endpoint')()) File "/home/hee/ros2_galactic/build/ros_tcp_endpoint/ros_tcp_endpoint/default_server_endpoint.py", line 14, in main tcp_server.setup_executor() File "/home/hee/ros2_galactic/build/ros_tcp_endpoint/ros_tcp_endpoint/server.py", line 177, in setup_executor executor.spin() File "/home/hee//ros2_galactic/install/rclpy/lib/python3.6/site-packages/rclpy/executors.py", line 279, in spin self.spin_once() File "/home/hee/ros2_galactic/install/rclpy/lib/python3.6/site-packages/rclpy/executors.py", line 757, in spin_once self._spin_once_impl(timeout_sec) File "/home/hee/ros2_galactic/install/rclpy/lib/python3.6/site-packages/rclpy/executors.py", line 744, in _spin_once_impl timeout_sec, None, wait_condition) File "/home/hee/ros2_galactic/install/rclpy/lib/python3.6/site-packages/rclpy/executors.py", line 690, in wait_for_ready_callbacks return next(self._cb_iter) File "/home/hee/ros2_galactic/install/rclpy/lib/python3.6/site-packages/rclpy/executors.py", line 585, in _wait_for_ready_callbacks waitable.add_to_wait_set(wait_set) File "/home/hee/ros2_galactic/install/rclpy/lib/python3.6/site-packages/rclpy/qos_event.py", line 114, in add_to_wait_set with self.__event: rclpy._rclpy_pybind11.InvalidHandle: cannot use Destroyable because destruction was requested

Expected behavior Endpoint process should not exit

Environment (please complete the following information, where applicable):

antsa123 commented 2 years ago

I'm having this same issue multiple times a day.

JuliusSustarevas commented 2 years ago

Having this in ubuntu 22 ros2 docker container straight from osrf. Not using unity tho. but any ideas appreciated.