roboligo
Loading...
Searching...
No Matches
ConnectorBase.hpp
Go to the documentation of this file.
1// Copyright 2026 Juan S. Cely G.
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// https://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#ifndef ROBOLIGO_COMMON_CLASSIFICATION__CONNECTORBASE_HPP_
16#define ROBOLIGO_COMMON_CLASSIFICATION__CONNECTORBASE_HPP_
17
18#include <string>
19
20#include "rclcpp_lifecycle/lifecycle_node.hpp"
21
26
27namespace roboligo
28{
38 {
39 public:
43 ConnectorBase() = default;
44
48 virtual ~ConnectorBase() = default;
49
56 virtual void initialize(
57 const std::shared_ptr<rclcpp_lifecycle::LifecycleNode> parent_node,
58 const std::string & plugin_name);
59
68 virtual bool set(RobotState & robot_state);
69
78 virtual bool update(RobotState & robot_state);
79
88 virtual bool exit(RobotState & robot_state);
89
90 protected:
98 virtual void on_set([[maybe_unused]]RobotState & robot_state){}
99
107 virtual void on_update([[maybe_unused]]RobotState & robot_state){}
108
116 virtual void on_exit([[maybe_unused]]RobotState & robot_state){}
117
118 };
119
120} // namespace roboligo
121#endif // ROBOLIGO_COMMON_CLASSIFICATION__CONNECTORBASE_HPP_
virtual void on_exit(RobotState &robot_state)
Hook called during exit operation.
Definition ConnectorBase.hpp:116
virtual bool update(RobotState &robot_state)
Update robot state.
Definition ConnectorBase.cpp:41
virtual void on_update(RobotState &robot_state)
Hook called during update operation.
Definition ConnectorBase.hpp:107
virtual ~ConnectorBase()=default
Virtual destructor.
virtual void initialize(const std::shared_ptr< rclcpp_lifecycle::LifecycleNode > parent_node, const std::string &plugin_name)
Initialize the connector with a lifecycle node.
Definition ConnectorBase.cpp:20
ConnectorBase()=default
Default constructor.
virtual bool set(RobotState &robot_state)
Set initial robot state.
Definition ConnectorBase.cpp:34
virtual void on_set(RobotState &robot_state)
Hook called during set operation.
Definition ConnectorBase.hpp:98
virtual bool exit(RobotState &robot_state)
Exit and cleanup robot state.
Definition ConnectorBase.cpp:48
PluginBase()=default
Default constructor.
Represents the state and configuration of a robot.
Definition RobotState.hpp:45
Definition ClassificationBase.hpp:28