roboligo
Toggle main menu visibility
Loading...
Searching...
No Matches
roboligo_common
include
roboligo_common
types
PluginBase.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_TYPES__PLUGINBASE_HPP_
16
#define ROBOLIGO_COMMON_TYPES__PLUGINBASE_HPP_
17
18
#include <memory>
19
#include <string>
20
21
#include "rclcpp_lifecycle/lifecycle_node.hpp"
22
23
namespace
roboligo
24
{
32
class
PluginBase
33
{
34
public
:
38
PluginBase
() =
default
;
39
43
virtual
~PluginBase
() =
default
;
44
51
virtual
void
initialize
(
52
const
std::shared_ptr<rclcpp_lifecycle::LifecycleNode> parent_node,
53
const
std::string & plugin_name);
54
58
virtual
void
on_initialize
() {}
59
66
[[nodiscard]] std::shared_ptr<rclcpp_lifecycle::LifecycleNode>
get_node
()
const
;
67
74
[[nodiscard]]
const
std::string &
get_plugin_name
()
const
;
75
76
private
:
77
78
std::shared_ptr<rclcpp_lifecycle::LifecycleNode> parent_node_ {
nullptr
};
79
80
std::string plugin_name_;
81
82
float
frequency_{10.0};
83
};
84
85
}
// namespace roboligo
86
#endif
// ROBOLIGO_COMMON_TYPES__PLUGINBASE_HPP_
roboligo::PluginBase::get_node
std::shared_ptr< rclcpp_lifecycle::LifecycleNode > get_node() const
Retrieves the parent lifecycle node.
Definition
PluginBase.cpp:34
roboligo::PluginBase::get_plugin_name
const std::string & get_plugin_name() const
Retrieves the plugin name.
Definition
PluginBase.cpp:40
roboligo::PluginBase::initialize
virtual void initialize(const std::shared_ptr< rclcpp_lifecycle::LifecycleNode > parent_node, const std::string &plugin_name)
Initializes the plugin with a parent lifecycle node and plugin name.
Definition
PluginBase.cpp:20
roboligo::PluginBase::PluginBase
PluginBase()=default
Default constructor.
roboligo::PluginBase::~PluginBase
virtual ~PluginBase()=default
Virtual destructor for proper cleanup of derived classes.
roboligo::PluginBase::on_initialize
virtual void on_initialize()
Called during plugin initialization. Override in derived classes for custom setup.
Definition
PluginBase.hpp:58
roboligo
Definition
ClassificationBase.hpp:28
Generated by
1.17.0