Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] - tree_node crashes when using a TopicSubscriber #108

Open
Oberacda opened this issue Oct 7, 2024 · 0 comments
Open

🐛 [BUG] - tree_node crashes when using a TopicSubscriber #108

Oberacda opened this issue Oct 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working Core Library Issues concerning the core BT library. Nodes Issues concerning the standard node library.
Milestone

Comments

@Oberacda
Copy link
Contributor

Oberacda commented Oct 7, 2024

Description

tree_node crashes when using a subscriber node.

Reproduction URL

https://github.com/fzi-forschungszentrum-informatik/ros2_ros_bt_py

Reproduction steps

1. Build a tree
2. Add a Subscriber Node
3. Start ticking the tree.
4. Shutdown the tree.

Logs

[INFO] [show_editor_url.py-5]: process has finished cleanly [pid 1452930]
[tree_node-1] [INFO] [1728307713.940090096] [BehaviorTreeNode]: initializing package manager...
[rosbridge_websocket-3] [INFO] [1728307714.051126150] [rosbridge_websocket]: Rosbridge WebSocket server started on port 9090
[tree_node-1] [INFO] [1728307714.106561446] [BehaviorTreeNode]: initialized package manager
[tree_node-1] [INFO] [1728307714.214997773] [BehaviorTreeNode]: initialized tree manager
[rosbridge_websocket-3] [INFO] [1728307716.681128584] [rosbridge_websocket]: Calling services in existing thread
[rosbridge_websocket-3] [INFO] [1728307716.682142302] [rosbridge_websocket]: Client connected. 1 clients total.
[rosbridge_websocket-3] [INFO] [1728307716.693264884] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to tree
[rosbridge_websocket-3] [INFO] [1728307716.695065962] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to debug/subtree_info
[rosbridge_websocket-3] [INFO] [1728307716.696378064] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to messages
[rosbridge_websocket-3] [INFO] [1728307716.697456083] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to packages
[rosbridge_websocket-3] [INFO] [1728307716.698312995] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to /BehaviorTreeNode/tree
[rosbridge_websocket-3] [INFO] [1728307716.699506823] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to /BehaviorTreeNode/debug/subtree_info
[rosbridge_websocket-3] [INFO] [1728307716.700521714] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to /BehaviorTreeNode/messages
[rosbridge_websocket-3] [INFO] [1728307716.701596106] [rosbridge_websocket]: [Client 0cfcd506-6047-4ae9-af65-f352e8775ddc] Subscribed to /BehaviorTreeNode/packages
[tree_node-1] [INFO] [1728307724.518192814] [tree_manager.UNKNOWN TREE]: Successfully loaded tree
[tree_node-1] [INFO] [1728307737.433630638] [IOInputOption]: Not calling shutdown method, node has not been initialized yet
[tree_node-1] [INFO] [1728307737.434423198] [outputs]: {'out': [(<bound method NodeData.set of None (object) [#]>, 'GetAttr_2.inputs[object]'), (<bound method NodeData.set of None (object) [#]>, 'GetAttr_3.inputs[object]'), (<bound method NodeData.set of None (object) [#]>, 'GetAttr.inputs[object]')]}
[tree_node-1] [INFO] [1728307737.434855616] [outputs]: {'out': [(<bound method NodeData.set of None (object) [#]>, 'GetAttr_3.inputs[object]'), (<bound method NodeData.set of None (object) [#]>, 'GetAttr.inputs[object]')]}
[tree_node-1] [INFO] [1728307737.435186302] [outputs]: {'out': [(<bound method NodeData.set of None (object) [#]>, 'GetAttr.inputs[object]')]}
[tree_node-1] [ERROR] [1728307821.729720921] [tree_manager.UNKNOWN TREE]: Encountered error while ticking tree: rclpy.shutdown() has been called, Traceback (most recent call last):
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_manager.py", line 516, in tick_report_exceptions
[tree_node-1]     self.tick()
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_manager.py", line 626, in tick
[tree_node-1]     self.rate.sleep()
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/timer.py", line 145, in sleep
[tree_node-1]     self._postsleep()
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/timer.py", line 132, in _postsleep
[tree_node-1]     raise ROSInterruptException()
[tree_node-1] rclpy.exceptions.ROSInterruptException: rclpy.shutdown() has been called
[tree_node-1] 
[tree_node-1] Exception in thread Thread-1 (tick_report_exceptions):
[tree_node-1] Traceback (most recent call last):
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_manager.py", line 516, in tick_report_exceptions
[tree_node-1]     self.tick()
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_manager.py", line 626, in tick
[tree_node-1]     self.rate.sleep()
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/timer.py", line 145, in sleep
[tree_node-1]     self._postsleep()
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/timer.py", line 132, in _postsleep
[tree_node-1]     raise ROSInterruptException()
[tree_node-1] rclpy.exceptions.ROSInterruptException: rclpy.shutdown() has been called
[tree_node-1] 
[tree_node-1] During handling of the above exception, another exception occurred:
[tree_node-1] 
[tree_node-1] Traceback (most recent call last):
[tree_node-1]   File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
[tree_node-1]     self.run()
[tree_node-1]   File "/usr/lib/python3.10/threading.py", line 953, in run
[tree_node-1]     self._target(*self._args, **self._kwargs)
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_manager.py", line 527, in tick_report_exceptions
[tree_node-1]     self.publish_info(
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_manager.py", line 484, in publish_info
[tree_node-1]     self.publish_tree(self.to_msg(ticked=ticked))
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/publisher.py", line 68, in publish
[tree_node-1]     with self.handle:
[tree_node-1] rclpy._rclpy_pybind11.InvalidHandle: cannot use Destroyable because destruction was requested
[tree_node-1] Traceback (most recent call last):
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/ros_bt_py/tree_node", line 33, in <module>
[tree_node-1]     sys.exit(load_entry_point('ros-bt-py==0.0.1', 'console_scripts', 'tree_node')())
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_node.py", line 434, in main
[tree_node-1]     executor.spin()
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 294, in spin
[tree_node-1]     self.spin_once()
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 739, in spin_once
[tree_node-1]     self._spin_once_impl(timeout_sec)
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 736, in _spin_once_impl
[tree_node-1]     raise handler.exception()
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
[tree_node-1]     self._handler.send(None)
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 437, in handler
[tree_node-1]     await call_coroutine(entity, arg)
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 391, in _execute_service
[tree_node-1]     response = await await_or_execute(srv.callback, request, srv.srv_type.Response())
[tree_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[tree_node-1]     return callback(*args)
[tree_node-1]   File "/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/python3.10/site-packages/ros_bt_py/tree_manager.py", line 1015, in control_execution
[tree_node-1]     raise BehaviorTreeException(
[tree_node-1] ros_bt_py.exceptions.BehaviorTreeException: Tried to join tick thread after requesting stop, but failed!
[ERROR] [tree_node-1]: process has died [pid 1452921, exit code 1, cmd '/home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py/lib/ros_bt_py/tree_node --ros-args -r __ns:=/ --params-file /tmp/launch_params_awg5jwuo --params-file /tmp/launch_params_bhcpb9_2 --params-file /tmp/launch_params_s163z3h9 --params-file /tmp/launch_params_i7jh50vg --params-file /tmp/launch_params_3pxylmgl --params-file /tmp/launch_params_hqzhj00k --params-file /tmp/launch_params_nojkm95c --params-file /tmp/launch_params_20apajvn --params-file /tmp/launch_params_047cuggg'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[rosbridge_websocket-3] registered capabilities (classes):
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.call_service.CallService'>
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.advertise.Advertise'>
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.publish.Publish'>
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.subscribe.Subscribe'>
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.defragmentation.Defragment'>
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.advertise_service.AdvertiseService'>
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.service_response.ServiceResponse'>
[rosbridge_websocket-3]  - <class 'rosbridge_library.capabilities.unadvertise_service.UnadvertiseService'>
[rosbridge_websocket-3] Exiting due to SIGINT
[ERROR] [html 8085-2]: process has died [pid 1452923, exit code -2, cmd 'python3 -m http.server -b 0.0.0.0 -d /home/roberto/repos/robot-programming-wih-python/ros2_ws/install/ros_bt_py_web_gui/share/ros_bt_py_web_gui/html 8085'].
[INFO] [rosapi_node-4]: process has finished cleanly [pid 1452927]
[INFO] [rosbridge_websocket-3]: process has finished cleanly [pid 1452925]

ROS2 Version

Humble

OS

Ubuntu 22.04

@Oberacda Oberacda added bug Something isn't working Core Library Issues concerning the core BT library. Nodes Issues concerning the standard node library. labels Oct 7, 2024
@Oberacda Oberacda added this to the ROSCon 2024 milestone Oct 7, 2024
@Oberacda Oberacda self-assigned this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Core Library Issues concerning the core BT library. Nodes Issues concerning the standard node library.
Projects
None yet
Development

No branches or pull requests

1 participant