Easy Navigation
Loading...
Searching...
No Matches
SystemNode Class Reference

ROS 2 lifecycle node coordinating all Easy Navigation components. More...

#include <SystemNode.hpp>

Inheritance diagram for SystemNode:
Collaboration diagram for SystemNode:

Public Types

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

Public Member Functions

void abort_mission (const std::string &reason) override
 SystemActions: aborts the active mission, if any, telling its client why.
bool apply_pending_reconfigure ()
 Applies the pending reconfiguration request, if any, while Active: cycles through unconfigured, setting the parameters there.
std::string get_configuration_dump ()
 Every EasyNav parameter, one "node/parameter=value" per line, sorted.
std::shared_ptr< NavState > get_nav_state () const
 Access to the shared navigation state (for testing and tools).
std::vector< std::string > get_nodes_without_clock ()
 EasyNav nodes with use_sim_time whose ROS clock has not started (still at 0): no /clock reaches them, so their components never run.
rclcpp::CallbackGroup::SharedPtr get_real_time_cbg ()
 Get the real-time callback group.
const safety::SafetySupervisor & get_safety () const
 Safety mode, memory lock and configuration hash, as of the last configure.
std::string get_shutdown_reason () const
 Why the shutdown was requested.
std::map< std::string, SystemNodeInfo > get_system_nodes ()
 Get all system nodes managed by this coordinator.
void hold_mission_progress (bool hold) override
 SystemActions: while held, GoalManager takes no goal as reached.
bool is_reconfigure_pending () const
 Whether a reconfiguration is pending.
bool is_shutdown_requested () const
 Whether the recovery system asked EasyNav to terminate (request_shutdown()).
CallbackReturnT on_activate (const rclcpp_lifecycle::State &state)
 Activate the node.
CallbackReturnT on_cleanup (const rclcpp_lifecycle::State &state)
 Cleanup the node.
CallbackReturnT on_configure (const rclcpp_lifecycle::State &state)
 Configure the node.
CallbackReturnT on_deactivate (const rclcpp_lifecycle::State &state)
 Deactivate the node.
CallbackReturnT on_error (const rclcpp_lifecycle::State &state)
 Handle lifecycle transition error.
CallbackReturnT on_shutdown (const rclcpp_lifecycle::State &state)
 Shutdown the node.
bool request_reconfigure (const std::vector< ParameterChange > &changes, const std::string &reason) override
 SystemActions: pending until apply_pending_reconfigure(); rejected in safety mode.
bool request_restore_parameters (const std::string &reason) override
 SystemActions: pending until apply_pending_reconfigure(); rejected in safety mode.
void request_shutdown (const std::string &reason) override
 SystemActions: records that EasyNav must terminate (see is_shutdown_requested()).
void system_cycle ()
 Non-real-time system cycle.
void system_cycle_rt ()
 Real-time system cycle.
 SystemNode (const rclcpp::NodeOptions &options=rclcpp::NodeOptions())
 Constructor.
 ~SystemNode ()
 Destructor.

Static Public Attributes

static constexpr std::chrono::seconds kClockCheckPeriod {5}
 While Active, how often system_cycle() warns about get_nodes_without_clock().

Detailed Description

ROS 2 lifecycle node coordinating all Easy Navigation components.

Manages lifecycle transitions, real-time execution, and communication between planner, controller, localizer, map manager, and sensor nodes.

Safety ("safety.*" parameters, configuration hash): safety::SafetySupervisor.

Member Typedef Documentation

◆ CallbackReturnT

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

Constructor & Destructor Documentation

◆ SystemNode()

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

Constructor.

Parameters
optionsNode options.

◆ ~SystemNode()

~SystemNode ( )

Destructor.

Member Function Documentation

◆ abort_mission()

void abort_mission ( const std::string & reason)
override

SystemActions: aborts the active mission, if any, telling its client why.

◆ apply_pending_reconfigure()

bool apply_pending_reconfigure ( )

Applies the pending reconfiguration request, if any, while Active: cycles through unconfigured, setting the parameters there.

Called by whoever drives this node's lifecycle, between cycles (never from a cycle: the recovery system is reloaded).

Returns
True if EasyNav was reconfigured (with the new values or, if they failed, the previous ones).

◆ get_configuration_dump()

std::string get_configuration_dump ( )
nodiscard

Every EasyNav parameter, one "node/parameter=value" per line, sorted.

◆ get_nav_state()

std::shared_ptr< NavState > get_nav_state ( ) const
nodiscard

Access to the shared navigation state (for testing and tools).

Returns
Shared pointer to the NavState.

◆ get_nodes_without_clock()

std::vector< std::string > get_nodes_without_clock ( )
nodiscard

EasyNav nodes with use_sim_time whose ROS clock has not started (still at 0): no /clock reaches them, so their components never run.

◆ get_real_time_cbg()

rclcpp::CallbackGroup::SharedPtr get_real_time_cbg ( )

Get the real-time callback group.

Returns
Shared pointer to the callback group.

◆ get_safety()

const safety::SafetySupervisor & get_safety ( ) const
nodiscard

Safety mode, memory lock and configuration hash, as of the last configure.

◆ get_shutdown_reason()

std::string get_shutdown_reason ( ) const
nodiscard

Why the shutdown was requested.

◆ get_system_nodes()

std::map< std::string, SystemNodeInfo > get_system_nodes ( )

Get all system nodes managed by this coordinator.

Returns
Map of node names to node information.

◆ hold_mission_progress()

void hold_mission_progress ( bool hold)
override

SystemActions: while held, GoalManager takes no goal as reached.

◆ is_reconfigure_pending()

bool is_reconfigure_pending ( ) const
nodiscard

Whether a reconfiguration is pending.

◆ is_shutdown_requested()

bool is_shutdown_requested ( ) const
nodiscard

Whether the recovery system asked EasyNav to terminate (request_shutdown()).

Whoever drives this node's lifecycle should then deactivate it, which ends in Finalized (see on_deactivate()/on_error()).

◆ on_activate()

CallbackReturnT on_activate ( const rclcpp_lifecycle::State & state)

Activate the node.

Parameters
stateLifecycle state.
Returns
SUCCESS if activation succeeded.

◆ on_cleanup()

CallbackReturnT on_cleanup ( const rclcpp_lifecycle::State & state)

Cleanup the node.

Parameters
stateLifecycle state.
Returns
SUCCESS if cleanup succeeded.

◆ on_configure()

CallbackReturnT on_configure ( const rclcpp_lifecycle::State & state)

Configure the node.

Parameters
stateLifecycle state.
Returns
SUCCESS if configuration succeeded.

◆ on_deactivate()

CallbackReturnT on_deactivate ( const rclcpp_lifecycle::State & state)

Deactivate the node.

Parameters
stateLifecycle state.
Returns
SUCCESS if deactivation succeeded.

◆ on_error()

CallbackReturnT on_error ( const rclcpp_lifecycle::State & state)

Handle lifecycle transition error.

Parameters
stateLifecycle state.
Returns
SUCCESS if error handled.

◆ on_shutdown()

CallbackReturnT on_shutdown ( const rclcpp_lifecycle::State & state)

Shutdown the node.

Parameters
stateLifecycle state.
Returns
SUCCESS if shutdown succeeded.

◆ request_reconfigure()

bool request_reconfigure ( const std::vector< ParameterChange > & changes,
const std::string & reason )
override

SystemActions: pending until apply_pending_reconfigure(); rejected in safety mode.

◆ request_restore_parameters()

bool request_restore_parameters ( const std::string & reason)
override

SystemActions: pending until apply_pending_reconfigure(); rejected in safety mode.

◆ request_shutdown()

void request_shutdown ( const std::string & reason)
override

SystemActions: records that EasyNav must terminate (see is_shutdown_requested()).

◆ system_cycle()

void system_cycle ( )

Non-real-time system cycle.

◆ system_cycle_rt()

void system_cycle_rt ( )

Real-time system cycle.

Member Data Documentation

◆ kClockCheckPeriod

std::chrono::seconds kClockCheckPeriod {5}
staticconstexpr

While Active, how often system_cycle() warns about get_nodes_without_clock().


The documentation for this class was generated from the following files: