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);
91 using rclcpp::Node::get_parameter;
93 std::thread execute_thread_;
99 const std::string& signal_name,
const std::shared_ptr<DataT>& data,
const std::string& default_topic,
100 bool fixed_topic,
bool publish_on_step) {
103 auto parsed_signal_name =
104 this->create_output(PublisherType::PUBLISHER, signal_name, data, default_topic, fixed_topic, publish_on_step);
110 case MessageType::BOOL: {
113 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::Bool>, std_msgs::msg::Bool>>(
118 case MessageType::FLOAT64: {
121 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::Float64>, std_msgs::msg::Float64>>(
126 case MessageType::FLOAT64_MULTI_ARRAY: {
129 rclcpp::Publisher<std_msgs::msg::Float64MultiArray>, std_msgs::msg::Float64MultiArray>>(
134 case MessageType::INT32: {
137 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::Int32>, std_msgs::msg::Int32>>(
142 case MessageType::STRING: {
145 std::make_shared<PublisherHandler<rclcpp::Publisher<std_msgs::msg::String>, std_msgs::msg::String>>(
150 case MessageType::ENCODED_STATE: {
153 std::make_shared<PublisherHandler<rclcpp::Publisher<modulo_core::EncodedState>, modulo_core::EncodedState>>(
158 case MessageType::CUSTOM_MESSAGE: {
162 std::make_shared<PublisherHandler<rclcpp::Publisher<DataT>,
DataT>>(PublisherType::PUBLISHER,
publisher)
168 }
catch (
const std::exception&
ex) {