SMACC2
Loading...
Searching...
No Matches
cb_position_control_free_space.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
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/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
21#pragma once
22
23#include <geometry_msgs/msg/twist.hpp>
26
27namespace cl_nav2z
28{
30{
31private:
32 double targetYaw_;
34 double k_betta_;
36
37 double prev_error_linear_ = 0.0;
38 double prev_error_angular_ = 0.0;
39 double integral_linear_ = 0.0;
40 double integral_angular_ = 0.0;
41
42 // Limit the maximum linear velocity and angular velocity to avoid sudden
43 // movements
44 double max_linear_velocity = 1.0; // Adjust this value according to your needs
45 double max_angular_velocity = 1.0; // Adjust this value according to your needs
46
47 rclcpp::Publisher<geometry_msgs::msg::Twist>::SharedPtr cmd_vel_pub_;
48
49public:
51
52 double threshold_distance_ = 3.0;
53
54 geometry_msgs::msg::Pose target_pose_;
55
57
58 void updateParameters();
59
60 void onEntry() override;
61
62 void onExit() override;
63};
64} // namespace cl_nav2z
rclcpp::Publisher< geometry_msgs::msg::Twist >::SharedPtr cmd_vel_pub_