rclcpp::shutdown

41 views
Skip to first unread message

Dennis Young

unread,
Sep 29, 2016, 5:11:50 PM9/29/16
to ROS SIG NG ROS
Looking into the rclcpp::shutdown(), I believe there is an issue where it should be calling rcl_shutdown() which in turn runs __clean_up_init().

If you call the weird scenario of:

rclcpp::init(argc, argv);
rclcpp::shutdown();
rclcpp::init(argc, argv);

Exceptions get thrown indicating that it is already initialized.  This is not a normal use case by any means and in fact rather aweful.  Unfortunately, my testing framework requires me to have to run init between test executions, which causes problems.

I did see the rclcpp::init calls rcl_init, so I assumed it was just missed in the shutdown.

Am I looking at this correctly?

Thanks.

Lennart Na

unread,
Sep 30, 2016, 3:03:07 AM9/30/16
to ROS SIG NG ROS
I can confirm this.
I had the same bug when writing tests for my C# wrapper, but I could avoid the exception by querying the rcl_ok function. If this function returns ok the rcl is already initialized.
Reply all
Reply to author
Forward
0 new messages