AutoAPMS
Streamlining behaviors in ROS 2
Loading...
Searching...
No Matches
set_empty.cpp
1// Copyright 2025 Robin Müller
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#include "auto_apms_behavior_tree_core/node.hpp"
16#include "std_srvs/srv/empty.hpp"
17
19{
20
21class SetEmpty : public core::RosServiceNode<std_srvs::srv::Empty>
22{
23public:
24 SetEmpty(const std::string & instance_name, const Config & config, const Context & context)
25 : RosServiceNode(instance_name, config, context)
26 {
27 }
28
29 static BT::PortsList providedPorts() { return providedBasicPorts({}); }
30
31 bool setRequest(Request::SharedPtr & /*request*/) override final { return true; }
32
33 BT::NodeStatus onResponseReceived(const Response::SharedPtr & /*response*/) override final
34 {
35 return BT::NodeStatus::SUCCESS;
36 }
37};
38
39} // namespace auto_apms_behavior_tree
40
41AUTO_APMS_BEHAVIOR_TREE_REGISTER_NODE(auto_apms_behavior_tree::SetEmpty)
Generic behavior tree node wrapper for a ROS 2 service client.
RosServiceNode(const std::string &instance_name, const Config &config, Context context)
#define AUTO_APMS_BEHAVIOR_TREE_REGISTER_NODE(type)
Macro for registering a behavior tree node plugin.
Definition node.hpp:44
Powerful tooling for incorporating behavior trees for task development.
Definition behavior.hpp:32