Comments (5)
I wonder if this was just my immediate reaction to not having something that was there in ROS1. Looking at the situation with fresh eyes, I wonder if it really is the right thing to have the application take care of the shutdown. It is only the application that will know that foo.shutdown()
might need to happen before bar.shutdown()
lest something catastrophic happen and the world end.
In this case it would be each class's responsibility to agnostically provide an on_shutdown
method.
from rclpy.
@stonier Based on your latest comment, I'm going to close this out for now. If you feel like this is something that core rclpy needs to provide in the future, please feel free to reopen.
from rclpy.
I'd be interested to know if there was an explicit reason it was made available in the ROS 1 api. We could perhaps trawl the rospy issues and commit history to see if there is anything there.
from rclpy.
Unfortunately, it looks like in ros_comm that code comes from this commit: ros/ros_comm@5ac90fafe3 ,which looks like it is probably the port from sourceforge -> github in 2010. To go further back than that, we'd have to go trawling through the original sourceforge stuff, which I don't think is worth it. Maybe @tfoote has some recollection on why it was originally added.
from rclpy.
On gazebo_ros_pkgs
we have a use case where we want to make a service call right before shutdown. On ROS 1 the on_shutdown
hook was being used:
If the hook isn't ported, is there an alternative way to achieve this?
That script is being migrated to ROS 2 on ros-simulation/gazebo_ros_pkgs#948
from rclpy.
Related Issues (20)
- xmlrpc.client.Fault: <Fault 1: "<class 'RuntimeError'>:!rclpy.ok()"> HOT 5
- [design question] get_parameter exception choice HOT 5
- Timer hanging and high CPU load when using MultiThreadedExecutor HOT 18
- rclpy._rclpy_pybind11 HOT 1
- Feature Request for MultiProcessExecutor HOT 2
- async wait/sleep implementation HOT 4
- KeyError in ActionServer._execute_goal HOT 5
- [Feature] Static Type Checking With ament_mypy HOT 1
- Added optional TimerInfo to timer callback
- :farmer: `test_guard_condition` failing consisntent in CycloneDDS HOT 2
- Add utility function to get datetime.datetime from Time HOT 1
- Decode ROS2 raw byte data using rclpy.serialization.deserialize_message HOT 3
- Rate object's destroy() does not destroy the underlying Timer object, leading to CPU usage explosion HOT 6
- Update the executor to not throw ExternalShutdownException
- Make nodes, publishers, subscriptions, services, clients, action servers, action clients Python context managers
- aarch64 cross compiling HOT 9
- Executors mishandle invalid waitables HOT 4
- context.on_shutdown is never called HOT 7
- Bad interaction between `torch.compile` and `MultiThreadedExecutor` HOT 1
- First Time Contributors Documentation (CONTRIBUTING.md) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rclpy.