controller_interface_base.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef COB_TWIST_CONTROLLER_CONTROLLER_INTERFACES_CONTROLLER_INTERFACE_BASE_H
19 #define COB_TWIST_CONTROLLER_CONTROLLER_INTERFACES_CONTROLLER_INTERFACE_BASE_H
20 
21 #include <vector>
22 #include "ros/ros.h"
23 
26 
27 namespace cob_twist_controller
28 {
29 
32 {
33  public:
35 
36  virtual void initialize(ros::NodeHandle& nh,
37  const TwistControllerParams& params) = 0;
38  virtual void processResult(const KDL::JntArray& q_dot_ik,
39  const KDL::JntArray& current_q) = 0;
40 
41  protected:
43 
47 };
48 
51 {
52  public:
54 
55  bool updateIntegration(const KDL::JntArray& q_dot_ik,
56  const KDL::JntArray& current_q)
57  {
59  period_ = now - last_update_time_;
60  last_update_time_ = now;
61  return integrator_->updateIntegration(q_dot_ik, current_q, pos_, vel_);
62  }
63 
64  protected:
66 
68  std::vector<double> pos_, vel_;
71 };
72 
73 }
74 
75 #endif // COB_TWIST_CONTROLLER_CONTROLLER_INTERFACES_CONTROLLER_INTERFACE_BASE_H
virtual void processResult(const KDL::JntArray &q_dot_ik, const KDL::JntArray &current_q)=0
double now()
bool updateIntegration(const KDL::JntArray &q_dot_ik, const KDL::JntArray &current_q)
Base class for controller interfaces using position integration.
Base class for controller interfaces.
static Time now()
virtual void initialize(ros::NodeHandle &nh, const TwistControllerParams &params)=0


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Thu Apr 8 2021 02:40:00