SMACC2
cb_string_publisher.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
21#pragma once
22
25#include <std_msgs/msg/string.hpp>
26
28{
29namespace cl_string_publisher
30{
32{
33public:
35 std::string msg_;
36
37 CbStringPublisher(std::string msg) { msg_ = msg; }
38
39 virtual void runtimeConfigure() override
40 {
41 RCLCPP_INFO_STREAM(
42 getLogger(), "Creating CbStringPublisher behavior with stored message: " << msg_);
43 }
44
45 virtual void onEntry() { this->requiresClient(publisherClient_); }
46
47 void onExit() override
48 {
49 std_msgs::msg::String rosmsg;
50 rosmsg.data = msg_;
52 }
53};
54} // namespace cl_string_publisher
55} // namespace sm_dance_bot_strikes_back
void requiresClient(SmaccClientType *&storage)