twist_controller.h
Go to the documentation of this file.
1 // -- BEGIN LICENSE BLOCK ----------------------------------------------
2 // Copyright 2020 FZI Forschungszentrum Informatik
3 // Created on behalf of Universal Robots A/S
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 // -- END LICENSE BLOCK ------------------------------------------------
17 
18 //----------------------------------------------------------------------
25 //----------------------------------------------------------------------
26 
27 #pragma once
28 
30 #include <dynamic_reconfigure/server.h>
31 #include <geometry_msgs/TwistStamped.h>
33 
35 
36 #include <twist_controller/TwistControllerConfig.h>
37 
39 {
48 class TwistController : public controller_interface::Controller<TwistCommandInterface>
49 {
50 public:
51  TwistController() = default;
52  virtual ~TwistController() = default;
53 
54  virtual bool init(TwistCommandInterface* hw, ros::NodeHandle& n) override;
55 
56  virtual void starting(const ros::Time& time) override;
57 
58  virtual void update(const ros::Time& /*time*/, const ros::Duration& /*period*/) override
59  {
61  }
62 
65 
66 private:
68  void twistCallback(const geometry_msgs::TwistConstPtr& msg);
69  void reconfigureCallback(const twist_controller::TwistControllerConfig& config, uint32_t level);
70  double gain_;
71  std::shared_ptr<dynamic_reconfigure::Server<twist_controller::TwistControllerConfig>> server_;
72 };
73 
74 } // namespace ros_controllers_cartesian
virtual void starting(const ros::Time &time) override
realtime_tools::RealtimeBuffer< geometry_msgs::Twist > command_buffer_
void setCommand(const geometry_msgs::Twist &twist)
std::shared_ptr< dynamic_reconfigure::Server< twist_controller::TwistControllerConfig > > server_
virtual bool init(TwistCommandInterface *hw, ros::NodeHandle &n) override
A Cartesian ROS-controller for commanding target twists to a robot.
void reconfigureCallback(const twist_controller::TwistControllerConfig &config, uint32_t level)
void twistCallback(const geometry_msgs::TwistConstPtr &msg)
virtual void update(const ros::Time &, const ros::Duration &) override


twist_controller
Author(s): Felix Exner , Stefan Scherzinger
autogenerated on Thu Feb 23 2023 03:10:50