roboligo
Loading...
Searching...
No Matches
ClassificationBase.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__CLASSIFICATIONBASE_HPP_
16#define ROBOLIGO_COMMON_CLASSIFICATION__CLASSIFICATIONBASE_HPP_
17
18#include <string>
19
20#include "rclcpp_lifecycle/lifecycle_node.hpp"
21
26
27namespace roboligo
28{
38 {
39 public:
43 ClassificationBase() = default;
44
48 virtual ~ClassificationBase() = default;
49
55 virtual void initialize(
56 const std::shared_ptr<rclcpp_lifecycle::LifecycleNode> parent_node,
57 const std::string & plugin_name);
58
64 virtual bool set(RobotState & robot_state);
65
71 virtual bool update(RobotState & robot_state);
72
73 protected:
78 virtual void on_set([[maybe_unused]]RobotState & robot_state){}
79
84 virtual void on_update([[maybe_unused]]RobotState & robot_state){}
85
86 };
87
88} // namespace roboligo
89#endif // ROBOLIGO_COMMON_CLASSIFICATION__CLASSIFICATIONBASE_HPP_
virtual void on_update(RobotState &robot_state)
Called when updating robot state (override in derived classes).
Definition ClassificationBase.hpp:84
ClassificationBase()=default
constructor
virtual void initialize(const std::shared_ptr< rclcpp_lifecycle::LifecycleNode > parent_node, const std::string &plugin_name)
Initializes the classification plugin.
Definition ClassificationBase.cpp:20
virtual void on_set(RobotState &robot_state)
Called when setting robot state (override in derived classes).
Definition ClassificationBase.hpp:78
virtual bool update(RobotState &robot_state)
Updates the robot state classification.
Definition ClassificationBase.cpp:41
virtual ~ClassificationBase()=default
Destructor.
virtual bool set(RobotState &robot_state)
Sets the robot state classification.
Definition ClassificationBase.cpp:34
PluginBase()=default
Default constructor.
Represents the state and configuration of a robot.
Definition RobotState.hpp:45
Definition ClassificationBase.hpp:28