42 const rclcpp_lifecycle::State & prev_state)
46 if (base_return != carma_ros2_utils::CallbackReturn::SUCCESS) {
47 RCLCPP_ERROR(get_logger(),
"Drivers Controller could not configure");
57 get_parameter<std::vector<std::string>>(
60 RCLCPP_INFO_STREAM(get_logger(),
"Config: " <<
config_);
72 auto updated_managed_nodes =
84 "driver_discovery", 20,
88 get_clock(), std::chrono::milliseconds(1000),
99 RCLCPP_INFO_STREAM(get_logger(),
"Subsystem able to configure");
100 return CallbackReturn::SUCCESS;
102 RCLCPP_INFO_STREAM(get_logger(),
"Subsystem unable to configure");
103 return CallbackReturn::FAILURE;
108 const rclcpp_lifecycle::State & prev_state)
117 if (base_return == CallbackReturn::SUCCESS) {
118 RCLCPP_INFO(get_logger(),
"Driver Controller activated!");
119 }
else if (base_return == CallbackReturn::FAILURE) {
122 "Driver Controller encountered FAILURE when trying to activate the subsystems... please "
123 "check which driver failed to activate...");
131 if (get_current_state().
id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE) {
135 long time_now = this->now().nanoseconds() / 1e6;
138 auto sys_alert_msg_from_ssc =
145 prev_alert->description != sys_alert_msg_from_ssc.description) {
147 publish_system_alert(sys_alert_msg_from_ssc);
149 RCLCPP_DEBUG_STREAM(get_logger(),
"No change to alert status");
154 const carma_driver_msgs::msg::DriverStatus::SharedPtr msg)
162#include "rclcpp_components/register_node_macro.hpp"
A base class for all subsystem_controllers which provides default lifecycle behavior for subsystems.
BaseSubSystemControllerConfig base_config_
The configuration struct.
virtual carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &prev_state)
virtual carma_ros2_utils::CallbackReturn handle_on_activate(const rclcpp_lifecycle::State &prev_state)
std::vector< std::string > get_non_intersecting_set(const std::vector< std::string > &set_a, const std::vector< std::string > &set_b) const
Returns all elements of the provided set_a which are NOT contained in the provided set_b.
bool trigger_managed_nodes_configure_from_base_class_
Collection of flags which, if true, will cause the base class to make lifecycle service calls to mana...
ros2_lifecycle_manager::Ros2LifecycleManager lifecycle_mgr_
Lifecycle Manager which will track the managed nodes and call their lifecycle services on request.
void critical_drivers_check_callback()
Timer callback function to check status of required ros1 drivers.
DriversControllerConfig config_
Config for user provided parameters.
std::shared_ptr< SSCDriverManager > ssc_driver_manager_
carma_ros2_utils::SubPtr< carma_driver_msgs::msg::DriverStatus > driver_status_sub_
ROS handles.
DriversControllerNode()=delete
boost::optional< carma_msgs::msg::SystemAlert > prev_alert
void driver_discovery_cb(const carma_driver_msgs::msg::DriverStatus::SharedPtr msg)
carma_ros2_utils::CallbackReturn handle_on_activate(const rclcpp_lifecycle::State &prev_state)
rclcpp::TimerBase::SharedPtr ssc_status_check_timer_
carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &prev_state)
int service_timeout_ms
Timeout in ms for service availability.
int call_timeout_ms
Timeout in ms for service calls.
Stuct containing the algorithm configuration values for the GuidanceController.
std::string ros1_ssc_driver_name_
double driver_timeout_
The timeout threshold for essential drivers in ms.
int startup_duration_
The time allocated for system startup in seconds.
std::vector< std::string > excluded_namespace_nodes_
List of nodes in the namespace which will not be managed by this subsystem controller.