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

all rclpy executor scripts fail on exit #193

Closed
dirk-thomas opened this issue Dec 6, 2017 · 3 comments
Closed

all rclpy executor scripts fail on exit #193

dirk-thomas opened this issue Dec 6, 2017 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@dirk-thomas
Copy link
Member

with something like:

Failed to fini 'rcl_publisher_t'

custom_executor also has the following error:

TypeError: 'tuple' object is not an iterator
@dirk-thomas dirk-thomas added the bug Something isn't working label Dec 6, 2017
@sloretz sloretz self-assigned this Dec 6, 2017
@sloretz
Copy link
Contributor

sloretz commented Dec 6, 2017

Question: Should executor.shutdown() call node.destroy_node() on each node that has been added to it? A benefit is convenience for the user. A negative is it eliminates the possibility of replacing an executor while keeping the nodes alive, though I'm not imaginative enough to think of a scenario where that would be useful.

The Failed to fini 'rcl_publisher_t' errors happen because the examples don't call destroy_node on the nodes they create. At the end of the program the garbage collector calls __del__ on the nodes, but rclpy.shutdown() has already been called so the rcl instance id doesn't match.

Exception ignored in: <bound method Node.__del__ of <examples_rclpy_executors.custom_executor.Estopper object at 0x7f2d7ab94128>>
Traceback (most recent call last):
  File "/workspace/ros2_ws/install_isolated/rclpy/lib/python3.5/site-packages/rclpy/node.py", line 300, in __del__
  File "/workspace/ros2_ws/install_isolated/rclpy/lib/python3.5/site-packages/rclpy/node.py", line 272, in destroy_node
RuntimeError: Failed to fini 'rcl_subscription_t': rcl node is invalid, rcl instance id does not match, at /workspace/ros2_ws/src/ros2/rcl/rcl/src/rcl/node.c:382

Edit: shutdown() -> destroy_node()

@dirk-thomas
Copy link
Member Author

I would lean toward "no".

The demo talker / listener e.g. call just:

node.destroy_node()
rclpy.shutdown()

The examples could do the same.

@sloretz sloretz added in progress Actively being worked on (Kanban column) in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Dec 6, 2017
@sloretz
Copy link
Contributor

sloretz commented Dec 6, 2017

Fixed by #196

@sloretz sloretz closed this as completed Dec 6, 2017
@sloretz sloretz removed the in review Waiting for review (Kanban column) label Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants