43 if (base_return != carma_ros2_utils::CallbackReturn::SUCCESS) {
44 RCLCPP_ERROR(get_logger(),
"Drivers Controller could not configure");
57 RCLCPP_INFO_STREAM(get_logger(),
"Config: " <<
config_);
95 RCLCPP_INFO_STREAM(get_logger(),
"Subsystem able to configure");
96 return CallbackReturn::SUCCESS;
100 RCLCPP_INFO_STREAM(get_logger(),
"Subsystem unable to configure");
101 return CallbackReturn::FAILURE;
115 if (base_return == CallbackReturn::SUCCESS) {
116 RCLCPP_INFO(get_logger(),
"Driver Controller activated!");
118 else if (base_return == CallbackReturn::FAILURE)
120 RCLCPP_ERROR(get_logger(),
"Driver Controller encountered FAILURE when trying to activate the subsystems... please check which driver failed to activate...");
130 long time_now = this->now().nanoseconds() / 1e6;
132 long start_duration = sd.nanoseconds()/1e6;
137 if (get_current_state().
id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE){
140 publish_system_alert(dm);
142 else if (
prev_alert->type == dm.type &&
prev_alert->description.compare(dm.description) == 0) {
143 RCLCPP_DEBUG_STREAM(get_logger(),
"No change to alert status");
147 publish_system_alert(dm);
157 driver_manager_->update_driver_status(msg, this->now().nanoseconds()/1e6);
163#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.
std::shared_ptr< DriverManager > driver_manager_
DriversControllerConfig config_
Config for user provided parameters.
carma_ros2_utils::SubPtr< carma_driver_msgs::msg::DriverStatus > driver_status_sub_
ROS handles.
DriversControllerNode()=delete
rclcpp::TimerBase::SharedPtr timer_
boost::optional< carma_msgs::msg::SystemAlert > prev_alert
void driver_discovery_cb(const carma_driver_msgs::msg::DriverStatus::SharedPtr msg)
void timer_callback()
Timer callback function to check status of required ros1 drivers.
carma_ros2_utils::CallbackReturn handle_on_activate(const rclcpp_lifecycle::State &prev_state)
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::vector< std::string > ros1_camera_drivers_
List of ros1 camera drivers (node name) to consider required and who's failure shall result in automa...
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 > ros1_required_drivers_
List of ros1 controller drivers (node name) to consider required and who's failure shall result in au...
std::vector< std::string > excluded_namespace_nodes_
List of nodes in the namespace which will not be managed by this subsystem controller.