ros2_control - rolling
Loading...
Searching...
No Matches
motion_primitives_forward_controller.hpp
1// Copyright (c) 2025, b»robotized
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// http://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// Authors: Mathias Fuhrer
16
17#ifndef MOTION_PRIMITIVES_CONTROLLERS__MOTION_PRIMITIVES_FORWARD_CONTROLLER_HPP_
18#define MOTION_PRIMITIVES_CONTROLLERS__MOTION_PRIMITIVES_FORWARD_CONTROLLER_HPP_
19
20#include <memory>
21#include <motion_primitives_controllers/motion_primitives_forward_controller_parameters.hpp>
22#include "control_msgs/action/execute_motion_primitive_sequence.hpp"
23#include "motion_primitives_controllers/motion_primitives_base_controller.hpp"
24
25namespace motion_primitives_controllers
26{
27
29{
30public:
32 ~MotionPrimitivesForwardController() override = default;
33
34 controller_interface::CallbackReturn on_init() override;
35
36 controller_interface::CallbackReturn on_configure(
37 const rclcpp_lifecycle::State & previous_state) override;
38
39 controller_interface::CallbackReturn on_activate(
40 const rclcpp_lifecycle::State & previous_state) override;
41
42 controller_interface::CallbackReturn on_deactivate(
43 const rclcpp_lifecycle::State & previous_state) override;
44
45 controller_interface::return_type update(
46 const rclcpp::Time & time, const rclcpp::Duration & period) override;
47
48protected:
49 std::shared_ptr<motion_primitives_forward_controller::ParamListener> param_listener_;
50 motion_primitives_forward_controller::Params params_;
51
52 using ExecuteMotionAction = control_msgs::action::ExecuteMotionPrimitiveSequence;
53 rclcpp_action::Server<ExecuteMotionAction>::SharedPtr action_server_;
54 rclcpp_action::GoalResponse goal_received_callback(
55 const rclcpp_action::GoalUUID & uuid, std::shared_ptr<const ExecuteMotionAction::Goal> goal);
56 rclcpp_action::CancelResponse goal_cancelled_callback(
57 const std::shared_ptr<rclcpp_action::ServerGoalHandle<ExecuteMotionAction>> goal_handle);
58 void goal_accepted_callback(
59 std::shared_ptr<rclcpp_action::ServerGoalHandle<ExecuteMotionAction>> goal_handle);
62};
63
64} // namespace motion_primitives_controllers
65
66#endif // MOTION_PRIMITIVES_CONTROLLERS__MOTION_PRIMITIVES_FORWARD_CONTROLLER_HPP_
Definition motion_primitives_base_controller.hpp:66
Definition motion_primitives_forward_controller.hpp:29
controller_interface::return_type update(const rclcpp::Time &time, const rclcpp::Duration &period) override
Definition motion_primitives_forward_controller.cpp:72
controller_interface::CallbackReturn on_init() override
Extending interface with initialization method which is individual for each controller.
Definition motion_primitives_forward_controller.cpp:22
Definition realtime_server_goal_handle.hpp:44
Definition realtime_thread_safe_box.hpp:68