ros2_control - iron
Loading...
Searching...
No Matches
imu_sensor_broadcaster.hpp
1// Copyright 2021 PAL Robotics SL.
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 * Authors: Subhas Das, Denis Stogl, Victor Lopez
17 */
18
19#ifndef IMU_SENSOR_BROADCASTER__IMU_SENSOR_BROADCASTER_HPP_
20#define IMU_SENSOR_BROADCASTER__IMU_SENSOR_BROADCASTER_HPP_
21
22#include <memory>
23#include <string>
24#include <vector>
25
26#include "controller_interface/controller_interface.hpp"
27#include "imu_sensor_broadcaster/visibility_control.h"
28// auto-generated by generate_parameter_library
29#include "imu_sensor_broadcaster_parameters.hpp"
30#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
31#include "rclcpp_lifecycle/state.hpp"
32#include "realtime_tools/realtime_publisher.h"
33#include "semantic_components/imu_sensor.hpp"
34#include "sensor_msgs/msg/imu.hpp"
35
36namespace imu_sensor_broadcaster
37{
39{
40public:
41 IMU_SENSOR_BROADCASTER_PUBLIC
43
44 IMU_SENSOR_BROADCASTER_PUBLIC
46
47 IMU_SENSOR_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_init() override;
48
49 IMU_SENSOR_BROADCASTER_PUBLIC
50 controller_interface::CallbackReturn on_configure(
51 const rclcpp_lifecycle::State & previous_state) override;
52
53 IMU_SENSOR_BROADCASTER_PUBLIC
54 controller_interface::CallbackReturn on_activate(
55 const rclcpp_lifecycle::State & previous_state) override;
56
57 IMU_SENSOR_BROADCASTER_PUBLIC
58 controller_interface::CallbackReturn on_deactivate(
59 const rclcpp_lifecycle::State & previous_state) override;
60
61 IMU_SENSOR_BROADCASTER_PUBLIC
62 controller_interface::return_type update(
63 const rclcpp::Time & time, const rclcpp::Duration & period) override;
64
65protected:
66 std::shared_ptr<ParamListener> param_listener_;
67 Params params_;
68
69 std::unique_ptr<semantic_components::IMUSensor> imu_sensor_;
70
72 rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr sensor_state_publisher_;
73 std::unique_ptr<StatePublisher> realtime_publisher_;
74};
75
76} // namespace imu_sensor_broadcaster
77
78#endif // IMU_SENSOR_BROADCASTER__IMU_SENSOR_BROADCASTER_HPP_
Definition controller_interface.hpp:29
Definition imu_sensor_broadcaster.hpp:39
IMU_SENSOR_BROADCASTER_PUBLIC controller_interface::return_type update(const rclcpp::Time &time, const rclcpp::Duration &period) override
Definition imu_sensor_broadcaster.cpp:113
IMU_SENSOR_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration command_interface_configuration() const override
Get configuration for controller's required command interfaces.
Definition imu_sensor_broadcaster.cpp:82
IMU_SENSOR_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_init() override
Extending interface with initialization method which is individual for each controller.
Definition imu_sensor_broadcaster.cpp:26
IMU_SENSOR_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration state_interface_configuration() const override
Get configuration for controller's required state interfaces.
Definition imu_sensor_broadcaster.cpp:90
Definition realtime_publisher.hpp:54
Configuring what command/state interfaces to claim.
Definition controller_interface_base.hpp:56