Class LocalizerNode

Inheritance Relationships

Base Type

  • public rclcpp_lifecycle::LifecycleNode

Class Documentation

class LocalizerNode : public rclcpp_lifecycle::LifecycleNode

ROS 2 lifecycle node that manages localization in Easy Navigation.

Handles lifecycle transitions, dynamic loading of the localization plugin, and periodic update execution in real-time or non-real-time contexts.

Public Types

using CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn

Public Functions

explicit LocalizerNode(const rclcpp::NodeOptions &options = rclcpp::NodeOptions())

Constructor.

Parameters:

options – Optional node configuration.

~LocalizerNode()

Destructor.

CallbackReturnT on_configure(const rclcpp_lifecycle::State &state)

Configure the node.

Parameters:

state – Lifecycle state.

Returns:

SUCCESS if configuration succeeded.

CallbackReturnT on_activate(const rclcpp_lifecycle::State &state)

Activate the node.

Parameters:

state – Lifecycle state.

Returns:

SUCCESS if activation succeeded.

CallbackReturnT on_deactivate(const rclcpp_lifecycle::State &state)

Deactivate the node.

Parameters:

state – Lifecycle state.

Returns:

SUCCESS if deactivation succeeded.

CallbackReturnT on_cleanup(const rclcpp_lifecycle::State &state)

Clean up the node.

Parameters:

state – Lifecycle state.

Returns:

SUCCESS if cleanup succeeded.

CallbackReturnT on_shutdown(const rclcpp_lifecycle::State &state)

Shutdown the node.

Parameters:

state – Lifecycle state.

Returns:

SUCCESS if shutdown succeeded.

CallbackReturnT on_error(const rclcpp_lifecycle::State &state)

Handle lifecycle error transition.

Parameters:

state – Lifecycle state.

Returns:

SUCCESS after handling error.

rclcpp::CallbackGroup::SharedPtr get_real_time_cbg()

Get the callback group for real-time execution.

Returns:

Shared pointer to the callback group.

bool cycle_rt(std::shared_ptr<NavState> nav_state, bool trigger = false)

Run a real-time localization cycle.

Parameters:
  • nav_state – Shared pointer to the navigation state structure.

  • trigger – Optional override to force execution.

Returns:

True if plugin update was executed.

void cycle(std::shared_ptr<NavState> nav_state)

Run a non-real-time localization cycle.

Parameters:

nav_state – Shared pointer to the navigation state structure.