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  {
58  ros::Time now = ros::Time::now();
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
cob_twist_controller
Definition: controller_interface.h:33
ros::Publisher
cob_twist_controller::ControllerInterfaceBase::~ControllerInterfaceBase
virtual ~ControllerInterfaceBase()
Definition: controller_interface_base.h:34
cob_twist_controller::ControllerInterfaceBase::nh_
ros::NodeHandle nh_
Definition: controller_interface_base.h:45
boost::shared_ptr< SimpsonIntegrator >
ros.h
cob_twist_controller::ControllerInterfacePositionBase::period_
ros::Duration period_
Definition: controller_interface_base.h:70
cob_twist_controller::ControllerInterfacePositionBase::pos_
std::vector< double > pos_
Definition: controller_interface_base.h:68
cob_twist_controller::ControllerInterfaceBase::processResult
virtual void processResult(const KDL::JntArray &q_dot_ik, const KDL::JntArray &current_q)=0
cob_twist_controller::ControllerInterfaceBase
Base class for controller interfaces.
Definition: controller_interface_base.h:31
cob_twist_controller::ControllerInterfacePositionBase::integrator_
boost::shared_ptr< SimpsonIntegrator > integrator_
Definition: controller_interface_base.h:67
cob_twist_controller::ControllerInterfaceBase::ControllerInterfaceBase
ControllerInterfaceBase()
Definition: controller_interface_base.h:42
cob_twist_controller::ControllerInterfaceBase::initialize
virtual void initialize(ros::NodeHandle &nh, const TwistControllerParams &params)=0
simpson_integrator.h
cob_twist_controller::ControllerInterfacePositionBase
Base class for controller interfaces using position integration.
Definition: controller_interface_base.h:50
cob_twist_controller::ControllerInterfacePositionBase::ControllerInterfacePositionBase
ControllerInterfacePositionBase()
Definition: controller_interface_base.h:65
cob_twist_controller::ControllerInterfacePositionBase::last_update_time_
ros::Time last_update_time_
Definition: controller_interface_base.h:69
cob_twist_controller::ControllerInterfacePositionBase::updateIntegration
bool updateIntegration(const KDL::JntArray &q_dot_ik, const KDL::JntArray &current_q)
Definition: controller_interface_base.h:55
cob_twist_controller::ControllerInterfaceBase::pub_
ros::Publisher pub_
Definition: controller_interface_base.h:46
ros::Time
cob_twist_controller::ControllerInterfacePositionBase::~ControllerInterfacePositionBase
~ControllerInterfacePositionBase()
Definition: controller_interface_base.h:53
cob_twist_controller::ControllerInterfaceBase::params_
TwistControllerParams params_
Definition: controller_interface_base.h:44
TwistControllerParams
Definition: cob_twist_controller_data_types.h:209
cob_twist_controller::ControllerInterfacePositionBase::vel_
std::vector< double > vel_
Definition: controller_interface_base.h:68
ros::Duration
ros::NodeHandle
cob_twist_controller_data_types.h
ros::Time::now
static Time now()


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Mon May 1 2023 02:44:43