17#include <rclcpp/create_publisher.hpp>
23 namespace std_ph = std::placeholders;
26 : carma_ros2_utils::CarmaLifecycleNode(options)
32 std::chrono::milliseconds(500),
43 this->get_node_base_interface(), this->get_node_logging_interface(),
44 this->get_node_topics_interface(), this->get_node_parameters_interface()
52 return std::string(get_name());
57 return std::string(get_namespace()) +
"/" + std::string(get_name());
75 return get_current_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE;
80 return carma_ros2_utils::CallbackReturn::SUCCESS;
85 return carma_ros2_utils::CallbackReturn::SUCCESS;
90 return carma_ros2_utils::CallbackReturn::SUCCESS;
95 return carma_ros2_utils::CallbackReturn::SUCCESS;
101 return carma_ros2_utils::CallbackReturn::FAILURE;
138 return carma_planning_msgs::msg::Plugin::UNKNOWN;
149 auto this_shared = shared_from_this();
150 plugin_discovery_pub_ = rclcpp::create_publisher<carma_planning_msgs::msg::Plugin>(this_shared,
"plugin_discovery", 1);
154 carma_planning_msgs::msg::Plugin msg;
virtual uint8_t get_type()
Returns the type of this plugin according to the carma_planning_msgs::Plugin type enum....
virtual bool get_activation_status() final
Returns the activation status of this plugin. The plugins API callbacks will only be triggered when t...
virtual carma_ros2_utils::CallbackReturn on_deactivate_plugin()
Method which is triggered when this plugin is moved from the ACTIVE to INACTIVE states....
carma_ros2_utils::CallbackReturn handle_on_deactivate(const rclcpp_lifecycle::State &) override
carma_ros2_utils::CallbackReturn handle_on_error(const rclcpp_lifecycle::State &, const std::string &exception_string) override
carma_wm::WorldModelConstPtr wm_
virtual std::string get_capability()=0
Get the capability string representing this plugins capabilities Method must be overriden by extendin...
carma_ros2_utils::CallbackReturn handle_on_cleanup(const rclcpp_lifecycle::State &) override
std::string get_plugin_name() const
Return the name of this plugin.
virtual carma_wm::WorldModelConstPtr get_world_model() final
Method to return the default world model provided as a convience by this base class If this method or...
carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &) override
virtual carma_ros2_utils::CallbackReturn on_cleanup_plugin()
Method which is triggered when this plugin is moved from the INACTIVE to UNCONFIGURED states....
virtual bool get_availability()=0
Get the availability status of this plugin based on the current operating environment....
PluginBaseNode(const rclcpp::NodeOptions &)
PluginBaseNode constructor.
virtual carma_ros2_utils::CallbackReturn on_configure_plugin()=0
Method which is triggered when this plugin is moved from the UNCONFIGURED to INACTIVE states....
rclcpp::Publisher< carma_planning_msgs::msg::Plugin >::SharedPtr plugin_discovery_pub_
Publisher for plugin discovery. This publisher will begin publishing.
void lazy_wm_initialization()
Helper function for lazy initialization of wm_listener_. If already initialized method returns (ie....
std::shared_ptr< carma_wm::WMListener > wm_listener_
virtual std::shared_ptr< carma_wm::WMListener > get_world_model_listener() final
Method to return the default world model listener provided as a convience by this base class If this ...
virtual carma_ros2_utils::CallbackReturn on_shutdown_plugin()
Method which is triggered when this plugin is moved from any state to FINALIZED This method should be...
carma_ros2_utils::CallbackReturn handle_on_activate(const rclcpp_lifecycle::State &) override
std::string get_plugin_name_and_ns() const
Return the name of this plugin with namespace. NOTE: If only the name of the plugin is required,...
virtual carma_ros2_utils::CallbackReturn on_error_plugin(const std::string &exception_string)
Method which is triggered when an unhandled exception occurs in this plugin This method should be use...
virtual std::string get_version_id()=0
Returns the version id of this plugin.
void discovery_timer_callback()
Callback for the plugin discovery timer which will publish the plugin discovery message.
carma_ros2_utils::CallbackReturn handle_on_shutdown(const rclcpp_lifecycle::State &) override
virtual carma_ros2_utils::CallbackReturn on_activate_plugin()
Method which is triggered when this plugin is moved from the INACTIVE to ACTIVE states....
rclcpp::TimerBase::SharedPtr discovery_timer_
Timer to trigger publication of the plugin discovery message at a fixed frequency.
std::shared_ptr< const WorldModel > WorldModelConstPtr