25 friend class ComponentPublicInterface;
32 explicit Component(
const rclcpp::NodeOptions& node_options,
const std::string& fallback_name =
"Component");
43 [[nodiscard]] std::shared_ptr<state_representation::ParameterInterface>
get_parameter(
const std::string& name)
const;
65 template<
typename DataT>
67 const std::string& signal_name,
const std::shared_ptr<DataT>& data,
const std::string& default_topic =
"",
68 bool fixed_topic =
false,
bool publish_on_step =
true);
97 using rclcpp::Node::get_parameter;
99 std::thread execute_thread_;
105 const std::string& signal_name,
const std::shared_ptr<DataT>& data,
const std::string& default_topic,
106 bool fixed_topic,
bool publish_on_step) {
109 auto parsed_signal_name =
110 this->create_output(PublisherType::PUBLISHER, signal_name, data, default_topic, fixed_topic, publish_on_step);
116 case MessageType::BOOL: {
119 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::Bool>, std_msgs::msg::Bool>>(
124 case MessageType::FLOAT64: {
127 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::Float64>, std_msgs::msg::Float64>>(
132 case MessageType::FLOAT64_MULTI_ARRAY: {
135 rclcpp::Publisher<std_msgs::msg::Float64MultiArray>, std_msgs::msg::Float64MultiArray>>(
140 case MessageType::INT32: {
143 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::Int32>, std_msgs::msg::Int32>>(
148 case MessageType::STRING: {
151 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::String>, std_msgs::msg::String>>(
156 case MessageType::ENCODED_STATE: {
159 std::make_shared<PublisherHandler<rclcpp::Publisher<modulo_core::EncodedState>, modulo_core::EncodedState>>(
164 case MessageType::CUSTOM_MESSAGE: {
168 std::make_shared<PublisherHandler<rclcpp::Publisher<DataT>,
DataT>>(PublisherType::PUBLISHER,
publisher)
174 }
catch (
const std::exception&
ex) {