Show EOL distros:
Package Summary
The robot_activity package implements ROS node lifecycle
- Maintainer status: developed
- Maintainer: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- Author: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- License: BSD
- Bug / feature tracker: https://github.com/snt-robotics/robot_activity/issues
- Source: git https://github.com/snt-robotics/robot_activity.git (branch: master)
Package Summary
The robot_activity package implements ROS node lifecycle
- Maintainer status: developed
- Maintainer: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- Author: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- License: BSD
- Bug / feature tracker: https://github.com/snt-robotics/robot_activity/issues
- Source: git https://github.com/snt-robotics/robot_activity.git (branch: master)
Package Summary
The robot_activity package implements ROS node lifecycle
- Maintainer status: developed
- Maintainer: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- Author: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- License: BSD
- Bug / feature tracker: https://github.com/snt-robotics/robot_activity/issues
- Source: git https://github.com/snt-robotics/robot_activity.git (branch: master)
Package Summary
The robot_activity package implements ROS node lifecycle
- Maintainer status: developed
- Maintainer: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- Author: Maciej ZURAD <maciej.zurad AT gmail DOT com>
- License: BSD
- Bug / feature tracker: https://github.com/snt-robotics/robot_activity/issues
- Source: git https://github.com/snt-robotics/robot_activity.git (branch: master)
Contents
Node lifecycle is coming to ROS 2.0 in form of managed nodes, why not bring it to ROS already?
robot_activity is a ROS package, which implements node lifecycle. The idea is that you don't have to write a lot of bolier-plate code in C++ when making a new ROS node and you get a lot of features for free!
A minimal example using robot_activity is available in the robot_activity_tutorials package. Check the robot_activity_tutorials_minimal_node.cpp
The main features of the package are:
Controllable node lifecycle - nodes automatically expose ROS services that allow you to pause, stop, restart, reconfigure and terminate a given node
ROS subscribers and services are automatically managed for you during the lifecycle. Services and callbacks will not be called if you request your node to exit RUNNING state. This means that you can now safely reconfigure your nodes without relaunching!
- Creation of super-nodes, multiple ROS nodes in a single process (similar to nodelets)
- Easy integration with a node supervisor using heartbeat and error messages.
The node lifecycle can be represented as a Finite State Machine (FSM): When you inherit from robot_activity::ManagedRobotActivity, the subscribers and services are managed for you, meaning that they will only be executed in the RUNNING state.
In PAUSED state, they are invoked, but immediately return without executing the actual body of the callback (services return false).
In STOPPED state, all registered subscribers and services are shutdown, so that no IPC or TCP/IP traffic occurs.
When transitioning back to PAUSED state from STOPPED, the subscribers and services are once again advertised for you (with the same arguments), but still not yet fully executed
When transitioning back to RUNNING state from PAUSED, the subscibers and services are now functional. However, all callback invocation that occured out of RUNNING state are lost.
Library
API
When you inherit from robot_activity::RobotActivity or robot_activity::ManagedRobotActivity, the following node API will be automatically exposedPublished Topics
/heartbeat (robot_activity_msgs/State)- Heartbeat msg is send to a global topic (usually listened to by a node supervisor)
- User can easily raise errors from the inherited class, which will be published on the global /error topic (usually listened to by a node supervisor). This is done by calling RobotActivity::notifyError
Services
~name_space/start (std_srvs/Empty)- Transitions from current state to RUNNING
- Transitions from current state to STOPPED
- Transitions from current state to PAUSED
- Transitions from current state to STOPPED and then to RUNNING
- Transitions from current state to UNCONFIGURED and then to RUNNING if param ~autostart_after_reconfigure is set to True, otherwise transitions to STOPPED
- Transitions from current state to TERMINATED
Parameters
'~wait_for_supervisor' (boolean, default: True)- If set to True, the node upon initialization will immediately pause its execution and wait until there is at least on subscriber on the global \heartbeat topic
- If set to True, upon calling ~reconfigure service the node will transtition to UNCONFIGURED and then to RUNNING, otherwise it will only reach STOPPED state
- Heartbeat rate in Hz published on /heartbeat
Use GitHub to report bugs or submit feature requests. [View active issues]