speed_scaling_state_controller.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // Copyright 2019 FZI Forschungszentrum Informatik
5 // Created on behalf of Universal Robots A/S
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 // -- END LICENSE BLOCK ------------------------------------------------
19 
20 //----------------------------------------------------------------------
27 //----------------------------------------------------------------------
28 
29 #ifndef SPEED_SCALING_STATE_CONTROLLER_SPEED_SCALING_STATE_CONTROLLER_H_INCLUDED
30 #define SPEED_SCALING_STATE_CONTROLLER_SPEED_SCALING_STATE_CONTROLLER_H_INCLUDED
31 
34 #include <std_msgs/Float64.h>
35 
37 
38 namespace scaled_controllers
39 {
40 class SpeedScalingStateController : public controller_interface::Controller<scaled_controllers::SpeedScalingInterface>
41 {
42 public:
43  SpeedScalingStateController() = default;
44  virtual ~SpeedScalingStateController() override = default;
45 
47  ros::NodeHandle& controller_nh) override;
48  virtual void starting(const ros::Time& time) override;
49  virtual void update(const ros::Time& time, const ros::Duration& /*period*/) override;
50  virtual void stopping(const ros::Time& /*time*/) override;
51 
52 private:
53  std::vector<scaled_controllers::SpeedScalingHandle> sensors_;
54  // TODO: We should use a custom message for this
55  typedef std::shared_ptr<realtime_tools::RealtimePublisher<std_msgs::Float64> > RtPublisherPtr;
56  std::vector<RtPublisherPtr> realtime_pubs_;
57  std::vector<ros::Time> last_publish_times_;
58  double publish_rate_;
59 };
60 } // namespace scaled_controllers
61 #endif // ifndef SPEED_SCALING_STATE_CONTROLLER_SPEED_SCALING_STATE_CONTROLLER_H_INCLUDED
virtual void starting(const ros::Time &time) override
std::vector< scaled_controllers::SpeedScalingHandle > sensors_
virtual void update(const ros::Time &time, const ros::Duration &) override
virtual ~SpeedScalingStateController() override=default
std::shared_ptr< realtime_tools::RealtimePublisher< std_msgs::Float64 > > RtPublisherPtr
virtual bool init(scaled_controllers::SpeedScalingInterface *hw, ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh) override


speed_scaling_state_controller
Author(s):
autogenerated on Wed May 18 2022 02:43:20