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 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
11 //
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17 // -- END LICENSE BLOCK ------------------------------------------------
18 
19 //----------------------------------------------------------------------
26 //----------------------------------------------------------------------
27 
28 #ifndef UR_CONTROLLERS_SPEED_SCALING_STATE_CONTROLLER_H_INCLUDED
29 #define UR_CONTROLLERS_SPEED_SCALING_STATE_CONTROLLER_H_INCLUDED
30 
33 #include <std_msgs/Float64.h>
34 
36 
37 namespace ur_controllers
38 {
40 {
41 public:
42  SpeedScalingStateController() = default;
43  virtual ~SpeedScalingStateController() override = default;
44 
45  virtual bool init(SpeedScalingInterface* hw, ros::NodeHandle& root_nh, ros::NodeHandle& controller_nh) override;
46  virtual void starting(const ros::Time& time) override;
47  virtual void update(const ros::Time& time, const ros::Duration& /*period*/) override;
48  virtual void stopping(const ros::Time& /*time*/) override;
49 
50 private:
51  std::vector<SpeedScalingHandle> sensors_;
52  // TODO: We should use a custom message for this
53  typedef std::shared_ptr<realtime_tools::RealtimePublisher<std_msgs::Float64> > RtPublisherPtr;
54  std::vector<RtPublisherPtr> realtime_pubs_;
55  std::vector<ros::Time> last_publish_times_;
56  double publish_rate_;
57 };
58 } // namespace ur_controllers
59 #endif // ifndef UR_CONTROLLERS_SPEED_SCALING_STATE_CONTROLLER_H_INCLUDED
virtual void update(const ros::Time &time, const ros::Duration &) override
virtual void stopping(const ros::Time &) override
virtual bool init(SpeedScalingInterface *hw, ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh) override
virtual ~SpeedScalingStateController() override=default
virtual void starting(const ros::Time &time) override
std::shared_ptr< realtime_tools::RealtimePublisher< std_msgs::Float64 > > RtPublisherPtr
Hardware interface to support reading the speed scaling factor.


ur_controllers
Author(s):
autogenerated on Sun Aug 22 2021 02:38:05