Class LifecycleInterface

Inheritance Relationships

Base Type

  • public rclcpp_lifecycle::LifecycleNode

Derived Type

Class Documentation

class lifecycle_interface::LifecycleInterface : public rclcpp_lifecycle::LifecycleNode

An implementation of the rclcpp lifecycle node in the styling of this codebase. Also abstracts out logging requirements and rclcpp_lifecycle specific types.

Subclassed by ros2_ouster::OusterDriver

Public Functions

LifecycleInterface(const std::string &name, const rclcpp::NodeOptions &options)

A constructor for lifecycle_interface::LifecycleInterface.

Parameters
  • name – Name of node

  • options – Node options for lifecycle node interfaces

CallbackReturn on_configure(const rclcpp_lifecycle::State &state) override

Configure class members.

Parameters

state – Reference to LifeCycle node state

Returns

SUCCESS

CallbackReturn on_activate(const rclcpp_lifecycle::State &state) override

Activate class members.

Parameters

state – Reference to LifeCycle node state

Returns

SUCCESS

CallbackReturn on_deactivate(const rclcpp_lifecycle::State &state) override

Deactivate class members.

Parameters

state – Reference to LifeCycle node state

Returns

SUCCESS

CallbackReturn on_error(const rclcpp_lifecycle::State &state) override

Called when in error lifecycle state to handle failure safely.

Parameters

state – Reference to LifeCycle node state

Returns

SUCCESS

CallbackReturn on_shutdown(const rclcpp_lifecycle::State &state) override

Called when in shutdown lifecycle state to exit node’s lifecycle.

Parameters

state – Reference to LifeCycle node state

Returns

SUCCESS

CallbackReturn on_cleanup(const rclcpp_lifecycle::State &state) override

Called when in cleanup lifecycle state to clean up node’s resources.

Parameters

state – Reference to LifeCycle node state

Returns

SUCCESS

virtual void onConfigure() = 0

lifecycle node’s implementation of configure step

virtual void onActivate() = 0

lifecycle node’s implementation of activate step

virtual void onDeactivate() = 0

lifecycle node’s implementation of deactivate step

virtual void onError() = 0

lifecycle node’s implementation of error step

virtual void onShutdown() = 0

lifecycle node’s implementation of shutdown step

virtual void onCleanup() = 0

lifecycle node’s implementation of cleanup step

inline bool isActive()

Get active state of lifecycle node.

Returns

if the lifecycle node is currently active