ros2_control - humble
Loading...
Searching...
No Matches
force_torque_sensor_broadcaster.hpp
1// Copyright (c) 2021, 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/*
16 * Authors: Subhas Das, Denis Stogl
17 */
18
19#ifndef FORCE_TORQUE_SENSOR_BROADCASTER__FORCE_TORQUE_SENSOR_BROADCASTER_HPP_
20#define FORCE_TORQUE_SENSOR_BROADCASTER__FORCE_TORQUE_SENSOR_BROADCASTER_HPP_
21
22#include <memory>
23#include <string>
24#include <vector>
25
26#include "controller_interface/controller_interface.hpp"
27#include "force_torque_sensor_broadcaster/visibility_control.h"
28#include "force_torque_sensor_broadcaster_parameters.hpp"
29#include "geometry_msgs/msg/wrench_stamped.hpp"
30#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
31#include "rclcpp_lifecycle/state.hpp"
32#include "realtime_tools/realtime_publisher.hpp"
33#include "semantic_components/force_torque_sensor.hpp"
34
35namespace force_torque_sensor_broadcaster
36{
38{
39public:
40 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC
42
43 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC
45
46 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC
48
49 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_init() override;
50
51 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC
52 controller_interface::CallbackReturn on_configure(
53 const rclcpp_lifecycle::State & previous_state) override;
54
55 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC
56 controller_interface::CallbackReturn on_activate(
57 const rclcpp_lifecycle::State & previous_state) override;
58
59 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC
60 controller_interface::CallbackReturn on_deactivate(
61 const rclcpp_lifecycle::State & previous_state) override;
62
63 FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC
64 controller_interface::return_type update(
65 const rclcpp::Time & time, const rclcpp::Duration & period) override;
66
67protected:
68 std::shared_ptr<ParamListener> param_listener_;
69 Params params_;
70
71 std::unique_ptr<semantic_components::ForceTorqueSensor> force_torque_sensor_;
72
74 rclcpp::Publisher<geometry_msgs::msg::WrenchStamped>::SharedPtr sensor_state_publisher_;
75 std::unique_ptr<StatePublisher> realtime_publisher_;
76};
77
78} // namespace force_torque_sensor_broadcaster
79
80#endif // FORCE_TORQUE_SENSOR_BROADCASTER__FORCE_TORQUE_SENSOR_BROADCASTER_HPP_
Definition controller_interface.hpp:29
Definition force_torque_sensor_broadcaster.hpp:38
FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC controller_interface::return_type update(const rclcpp::Time &time, const rclcpp::Duration &period) override
Definition force_torque_sensor_broadcaster.cpp:144
FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration command_interface_configuration() const override
Get configuration for controller's required command interfaces.
Definition force_torque_sensor_broadcaster.cpp:114
FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC controller_interface::CallbackReturn on_init() override
Extending interface with initialization method which is individual for each controller.
Definition force_torque_sensor_broadcaster.cpp:31
FORCE_TORQUE_SENSOR_BROADCASTER_PUBLIC controller_interface::InterfaceConfiguration state_interface_configuration() const override
Get configuration for controller's required state interfaces.
Definition force_torque_sensor_broadcaster.cpp:122
Definition realtime_publisher.hpp:54
Configuring what command/state interfaces to claim.
Definition controller_interface_base.hpp:56