ros2_control - rolling
Loading...
Searching...
No Matches
tricycle_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 TRICYCLE_STEERING_CONTROLLER__TRICYCLE_STEERING_CONTROLLER_HPP_
19#define TRICYCLE_STEERING_CONTROLLER__TRICYCLE_STEERING_CONTROLLER_HPP_
20
21#include <memory>
22
23#include "steering_controllers_library/steering_controllers_library.hpp"
24#include "tricycle_steering_controller/tricycle_steering_controller_parameters.hpp"
25
26namespace tricycle_steering_controller
27{
28// name constants for state interfaces
29static constexpr size_t STATE_TRACTION_RIGHT_WHEEL = 0;
30static constexpr size_t STATE_TRACTION_LEFT_WHEEL = 1;
31static constexpr size_t STATE_DUAL_TRACTION_STEER_AXIS = 2;
32
33// name constants for command interfaces
34static constexpr size_t CMD_TRACTION_RIGHT_WHEEL = 0;
35static constexpr size_t CMD_TRACTION_LEFT_WHEEL = 1;
36static constexpr size_t CMD_DUAL_TRACTION_STEER_WHEEL = 2;
37
38// name constants for state interfaces
39static constexpr size_t STATE_TRACTION_SINGLE_WHEEL = 0;
40static constexpr size_t STATE_SINGLE_TRACTION_STEER_AXIS = 1;
41
42// name constants for command interfaces
43static constexpr size_t CMD_TRACTION_SINGLE_WHEEL = 0;
44static constexpr size_t CMD_SINGLE_TRACTION_STEER_WHEEL = 1;
45
46class TricycleSteeringController : public steering_controllers_library::SteeringControllersLibrary
47{
48public:
49 TricycleSteeringController();
50
51 controller_interface::CallbackReturn configure_odometry() override;
52
53 bool update_odometry(const rclcpp::Duration & period) override;
54
55 void initialize_implementation_parameter_listener() override;
56
57protected:
58 std::shared_ptr<tricycle_steering_controller::ParamListener> tricycle_param_listener_;
59 tricycle_steering_controller::Params tricycle_params_;
60};
61} // namespace tricycle_steering_controller
62
63#endif // TRICYCLE_STEERING_CONTROLLER__TRICYCLE_STEERING_CONTROLLER_HPP_
Definition steering_controllers_library.hpp:42