EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Toggle main menu visibility
Loading...
Searching...
No Matches
capability_node_base.hpp
1
// Copyright 2026 Intelligent Robotics Lab
2
//
3
// This file is part of the project EasyFleet
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
16
#ifndef EASYFLEET_CORE__CAPABILITY_NODE_BASE_HPP_
17
#define EASYFLEET_CORE__CAPABILITY_NODE_BASE_HPP_
18
19
#include <memory>
20
#include <string>
21
22
#include "rclcpp/node_interfaces/node_base_interface.hpp"
23
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
24
25
namespace
easyfleet_core
26
{
27
40
class
CapabilityNodeBase
41
{
42
public
:
44
using
SharedPtr
= std::shared_ptr<CapabilityNodeBase>;
46
using
CallbackReturn
= rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;
47
48
virtual
~CapabilityNodeBase
() =
default
;
49
50
// Named *_node() rather than plain configure()/activate()/etc.: those
51
// names are already taken, with different signatures, by
52
// rclcpp_lifecycle::LifecycleNode itself (which Capability<ActionServerT>
53
// also derives from). Reusing them here would silently *hide* (not
54
// override) LifecycleNode's own overloads for any code holding a
55
// Capability<T>* directly -- including the one-arg configure(CallbackReturn&)
56
// overload existing code (test_capability.cpp) already calls -- breaking
57
// it. Distinct names sidestep that entirely.
60
virtual
CallbackReturn
configure_node
() = 0;
63
virtual
CallbackReturn
activate_node
() = 0;
66
virtual
CallbackReturn
deactivate_node
() = 0;
69
virtual
CallbackReturn
cleanup_node
() = 0;
73
virtual
CallbackReturn
shutdown_node
() = 0;
77
virtual
uint8_t
get_current_state_id
()
const
= 0;
78
82
virtual
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr
get_node_base_interface
() = 0;
83
87
virtual
const
std::string &
get_capability_name
()
const
= 0;
91
virtual
const
std::string &
get_robot_name
()
const
= 0;
92
};
93
94
}
// namespace easyfleet_core
95
96
#endif
// EASYFLEET_CORE__CAPABILITY_NODE_BASE_HPP_
easyfleet_core::CapabilityNodeBase
Non-template handle to an already-constructed Capability<ActionServerT> instance, exposing exactly th...
Definition
capability_node_base.hpp:41
easyfleet_core::CapabilityNodeBase::get_node_base_interface
virtual rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_base_interface()=0
So a Deployment can add the underlying node to its shared executor without knowing its concrete type.
easyfleet_core::CapabilityNodeBase::configure_node
virtual CallbackReturn configure_node()=0
Drive the underlying lifecycle node from UNCONFIGURED to INACTIVE.
easyfleet_core::CapabilityNodeBase::get_robot_name
virtual const std::string & get_robot_name() const =0
The robot identity field published on /capabilities and /capabilities_status.
easyfleet_core::CapabilityNodeBase::shutdown_node
virtual CallbackReturn shutdown_node()=0
Drive the underlying lifecycle node to FINALIZED, from whatever state it is currently in.
easyfleet_core::CapabilityNodeBase::cleanup_node
virtual CallbackReturn cleanup_node()=0
Drive the underlying lifecycle node from INACTIVE to UNCONFIGURED.
easyfleet_core::CapabilityNodeBase::activate_node
virtual CallbackReturn activate_node()=0
Drive the underlying lifecycle node from INACTIVE to ACTIVE.
easyfleet_core::CapabilityNodeBase::deactivate_node
virtual CallbackReturn deactivate_node()=0
Drive the underlying lifecycle node from ACTIVE to INACTIVE.
easyfleet_core::CapabilityNodeBase::CallbackReturn
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn CallbackReturn
Lifecycle transition result type shared with rclcpp_lifecycle.
Definition
capability_node_base.hpp:46
easyfleet_core::CapabilityNodeBase::SharedPtr
std::shared_ptr< CapabilityNodeBase > SharedPtr
Shared pointer to a CapabilityNodeBase.
Definition
capability_node_base.hpp:44
easyfleet_core::CapabilityNodeBase::get_capability_name
virtual const std::string & get_capability_name() const =0
The capability identity field published on /capabilities and /capabilities_status.
easyfleet_core::CapabilityNodeBase::get_current_state_id
virtual uint8_t get_current_state_id() const =0
The underlying lifecycle node's current state id.
easyfleet_core
include
easyfleet_core
capability_node_base.hpp
Generated by
1.17.0