ms-iot / ros_msft_mrtk

This repository contains ROS2 bindings for the Mixed Reality Toolkit - allowing you to create VR and AR applications which reflect sensor data from a Robot or provide command and control
MIT License
65 stars 10 forks source link

ROS2 node does not get properly destroyed #36

Open CharlesXu1124 opened 1 year ago

CharlesXu1124 commented 1 year ago

I was using the example listener script in the package to subscribe for my Lidar pointcloud2 data, while I was able to properly subscribe to it and visualize the points, every time I terminated the application in both Unity editor and hololens2 the node is not being properly terminated and became a zombie node in the background. This can be verified by using "ros2 node list" in the terminal, and these zombie nodes can only be destroyed if I manually close the unity editor/reboot hololens device. Do you know is there any way to cleanly close the application?

p.s. I was also looking at other ros2 Unity packages such as this one: https://github.com/RobotecAI/ros2cs, they do have to call a shutdown function to destroy the nodes properly so my guess is such a function might be missing