ros2_control - humble
Loading...
Searching...
No Matches
ackermann_steering_controller.hpp
1// Copyright (c) 2023, Stogl Robotics Consulting UG (haftungsbeschränkt)
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: dr. sc. Tomislav Petkovic, Dr. Ing. Denis Štogl
16//
17
18#ifndef ACKERMANN_STEERING_CONTROLLER__ACKERMANN_STEERING_CONTROLLER_HPP_
19#define ACKERMANN_STEERING_CONTROLLER__ACKERMANN_STEERING_CONTROLLER_HPP_
20
21#include <memory>
22
23#include "ackermann_steering_controller/visibility_control.h"
24#include "ackermann_steering_controller_parameters.hpp"
25#include "steering_controllers_library/steering_controllers_library.hpp"
26
27namespace ackermann_steering_controller
28{
29// name constants for state interfaces
30static constexpr size_t STATE_TRACTION_RIGHT_WHEEL = 0;
31static constexpr size_t STATE_TRACTION_LEFT_WHEEL = 1;
32static constexpr size_t STATE_STEER_RIGHT_WHEEL = 2;
33static constexpr size_t STATE_STEER_LEFT_WHEEL = 3;
34
35// name constants for command interfaces
36static constexpr size_t CMD_TRACTION_RIGHT_WHEEL = 0;
37static constexpr size_t CMD_TRACTION_LEFT_WHEEL = 1;
38static constexpr size_t CMD_STEER_RIGHT_WHEEL = 2;
39static constexpr size_t CMD_STEER_LEFT_WHEEL = 3;
40
41static constexpr size_t NR_STATE_ITFS = 4;
42static constexpr size_t NR_CMD_ITFS = 4;
43static constexpr size_t NR_REF_ITFS = 2;
44
46{
47public:
49
50 ACKERMANN_STEERING_CONTROLLER__VISIBILITY_PUBLIC controller_interface::CallbackReturn
51 configure_odometry() override;
52
53 ACKERMANN_STEERING_CONTROLLER__VISIBILITY_PUBLIC bool update_odometry(
54 const rclcpp::Duration & period) override;
55
56 ACKERMANN_STEERING_CONTROLLER__VISIBILITY_PUBLIC void
57 initialize_implementation_parameter_listener() override;
58
59protected:
60 std::shared_ptr<ackermann_steering_controller::ParamListener> ackermann_param_listener_;
61 ackermann_steering_controller::Params ackermann_params_;
62};
63} // namespace ackermann_steering_controller
64
65#endif // ACKERMANN_STEERING_CONTROLLER__ACKERMANN_STEERING_CONTROLLER_HPP_
Definition ackermann_steering_controller.hpp:46
Definition steering_controllers_library.hpp:48