Skip to content

Commit

Permalink
Add lifecycle states
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiktor-99 committed Jul 14, 2024
1 parent a7d3409 commit c645995
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions human_detector/human_detector/human_detector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from human_detector.human_detector_parameters import human_detector_parameters
from rclpy.lifecycle.node import LifecycleState, TransitionCallbackReturn
from rclpy.lifecycle import LifecycleNode

class HumanDetector(LifecycleNode):
Expand All @@ -21,6 +22,32 @@ def log_parameters(self):
f"Human detector publishes image with detected human on \
{self.parameters.publish_image_with_detected_human_topic} topic.")

def on_configure(self, previous_state: LifecycleState):
self.get_logger().info("IN on_configure")

return TransitionCallbackReturn.SUCCESS

def on_activate(self, previous_state: LifecycleState):
self.get_logger().info("IN on_activate")
return super().on_activate(previous_state)

def on_deactivate(self, previous_state: LifecycleState):
self.get_logger().info("IN on_deactivate")
return super().on_deactivate(previous_state)

def on_cleanup(self, previous_state: LifecycleState):
self.get_logger().info("IN on_cleanup")
return TransitionCallbackReturn.SUCCESS

def on_shutdown(self, previous_state: LifecycleState):
self.get_logger().info("IN on_shutdown")
return TransitionCallbackReturn.SUCCESS

def on_error(self, previous_state: LifecycleState):
self.get_logger().info("IN on_error")
return TransitionCallbackReturn.SUCCESS




def main():
Expand Down

0 comments on commit c645995

Please sign in to comment.