Skip to content

BasicNavigator doesn't clean up ActionClients #2923

@m2-farzan

Description

@m2-farzan

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • ROS2 Version:
    • Galactic
  • Version or commit hash:
    • 1.0.8-1focal.20220203.051427
  • DDS implementation:
    • Fast-RTPS

Steps to reproduce issue

#!/bin/python3

import rclpy
from nav2_simple_commander.robot_navigator import BasicNavigator

rclpy.init()
nav = BasicNavigator()
nav.destroy_node()

Expected behavior

Clean exit

Actual behavior

Exits with 0 code but prints the following warning:

Exception ignored in: <function ActionClient.__del__ at 0x7f310cc98f70>
Traceback (most recent call last):
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 597, in __del__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 590, in destroy
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 122, in __enter__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 104, in _get_capsule
rclpy._rclpy_pybind11.InvalidHandle: Tried to use a handle that has been destroyed.
Exception ignored in: <function ActionClient.__del__ at 0x7f310cc98f70>
Traceback (most recent call last):
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 597, in __del__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 590, in destroy
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 122, in __enter__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 104, in _get_capsule
rclpy._rclpy_pybind11.InvalidHandle: Tried to use a handle that has been destroyed.
Exception ignored in: <function ActionClient.__del__ at 0x7f310cc98f70>
Traceback (most recent call last):
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 597, in __del__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 590, in destroy
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 122, in __enter__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 104, in _get_capsule
rclpy._rclpy_pybind11.InvalidHandle: Tried to use a handle that has been destroyed.
Exception ignored in: <function ActionClient.__del__ at 0x7f310cc98f70>
Traceback (most recent call last):
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 597, in __del__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 590, in destroy
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 122, in __enter__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 104, in _get_capsule
rclpy._rclpy_pybind11.InvalidHandle: Tried to use a handle that has been destroyed.
Exception ignored in: <function ActionClient.__del__ at 0x7f310cc98f70>
Traceback (most recent call last):
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 597, in __del__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/action/client.py", line 590, in destroy
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 122, in __enter__
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/handle.py", line 104, in _get_capsule
rclpy._rclpy_pybind11.InvalidHandle: Tried to use a handle that has been destroyed.

Additional information

Looks like Node.destroy_node only destroys publishers, subscribers, etc. but doesn't handle ActionClients. I'll post a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions