EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Loading...
Searching...
No Matches
navigation_fake_capability.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_FAKE_COLLABORATION_DEPLOYMENT__NAVIGATION_FAKE_CAPABILITY_HPP_
17#define EASYFLEET_FAKE_COLLABORATION_DEPLOYMENT__NAVIGATION_FAKE_CAPABILITY_HPP_
18
19#include <string>
20
21#include "easyfleet_interfaces/action/navigation.hpp"
22#include "rclcpp/rclcpp.hpp"
23#include "rclcpp_action/rclcpp_action.hpp"
24#include "rclcpp_lifecycle/lifecycle_node.hpp"
25
26#include "easyfleet_core/capability.hpp"
27#include "easyfleet_core/navigation_action_server_base.hpp"
28
29namespace easyfleet_fake_collaboration_deployment
30{
31
33
43{
44public:
49 rclcpp_lifecycle::LifecycleNode & node,
50 const std::string & action_name);
51
52protected:
57 rclcpp_action::GoalResponse on_goal_received(
58 const rclcpp_action::GoalUUID & uuid,
59 std::shared_ptr<const Goal> goal) override;
60
64 void on_execute(const GoalHandleSharedPtr goal_handle) override;
65
66private:
67 double mock_navigation_duration_s_;
68 double mock_feedback_period_s_;
69 double mock_initial_distance_m_;
70};
71
75class NavigationFakeCapability : public easyfleet_core::Capability<NavigationFakeActionServer>
76{
77public:
80 explicit NavigationFakeCapability(const rclcpp::NodeOptions & options = rclcpp::NodeOptions());
81};
82
83} // namespace easyfleet_fake_collaboration_deployment
84
85#endif // EASYFLEET_FAKE_COLLABORATION_DEPLOYMENT__NAVIGATION_FAKE_CAPABILITY_HPP_
std::shared_ptr< GoalHandle > GoalHandleSharedPtr
Definition action_server_base.hpp:79
Lifecycle node that advertises a single action as a "capability".
Definition capability.hpp:65
Fixes ActionServerBase's action type to easyfleet_interfaces/Navigation, so a concrete navigation bac...
Definition navigation_action_server_base.hpp:31
NavigationFakeActionServer(rclcpp_lifecycle::LifecycleNode &node, const std::string &action_name)
Constructs the action server.
Definition navigation_fake_capability.cpp:40
void on_execute(const GoalHandleSharedPtr goal_handle) override
Simulates navigation progress over mock_navigation_duration_s_, publishing feedback every mock_feedba...
Definition navigation_fake_capability.cpp:63
rclcpp_action::GoalResponse on_goal_received(const rclcpp_action::GoalUUID &uuid, std::shared_ptr< const Goal > goal) override
Always accepts (this mock never rejects a goal).
Definition navigation_fake_capability.cpp:53
NavigationFakeCapability(const rclcpp::NodeOptions &options=rclcpp::NodeOptions())
Constructs the capability node.
Definition navigation_fake_capability.cpp:120