constraint_solver_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_CONSTRAINT_SOLVERS_SOLVERS_CONSTRAINT_SOLVER_BASE_H
19 #define COB_TWIST_CONTROLLER_CONSTRAINT_SOLVERS_SOLVERS_CONSTRAINT_SOLVER_BASE_H
20 
21 #include <set>
22 #include <Eigen/Core>
23 #include <kdl/jntarray.hpp>
24 #include <boost/shared_ptr.hpp>
30 
32 template <typename PINV = PInvBySVD>
34 {
35  public:
42  virtual Eigen::MatrixXd solve(const Vector6d_t& in_cart_velocities,
43  const JointStates& joint_states) = 0;
44 
50  {
51  this->damping_ = damping;
52  }
53 
58  inline void setConstraints(std::set<ConstraintBase_t>& constraints)
59  {
60  this->constraints_.clear();
61  this->constraints_ = constraints;
62  }
63 
67  inline void clearConstraints()
68  {
69  this->constraints_.clear();
70  }
71 
75  virtual void setJacobianData(const Matrix6Xd_t& jacobian_data)
76  {
77  this->jacobian_data_ = jacobian_data;
78  }
79 
81  {
82  this->clearConstraints();
83  }
84 
86  const LimiterParams& limiter_params,
87  TaskStackController_t& task_stack_controller) :
88  params_(params),
89  limiter_params_(limiter_params),
90  task_stack_controller_(task_stack_controller)
91  {}
92 
93  protected:
95  std::set<ConstraintBase_t> constraints_;
100  PINV pinv_calc_;
102 };
103 
104 #endif // COB_TWIST_CONTROLLER_CONSTRAINT_SOLVERS_SOLVERS_CONSTRAINT_SOLVER_BASE_H
ConstraintSolver(const TwistControllerParams &params, const LimiterParams &limiter_params, TaskStackController_t &task_stack_controller)
const LimiterParams & limiter_params_
References the inv. diff. kin. solver parameters.
boost::shared_ptr< DampingBase > damping_
References the current Jacobian (matrix data only).
Eigen::Matrix< double, 6, 1 > Vector6d_t
virtual Eigen::MatrixXd solve(const Vector6d_t &in_cart_velocities, const JointStates &joint_states)=0
Matrix6Xd_t jacobian_data_
References the limiter parameters (up-to-date according to KinematicExtension).
PINV pinv_calc_
The currently set damping method.
void setConstraints(std::set< ConstraintBase_t > &constraints)
const TwistControllerParams & params_
Set of constraints.
std::set< ConstraintBase_t > constraints_
set inserts sorted (default less operator); if element has already been added it returns an iterator ...
virtual void setJacobianData(const Matrix6Xd_t &jacobian_data)
Base class for solvers, defining interface methods.
Eigen::Matrix< double, 6, Eigen::Dynamic > Matrix6Xd_t
void setDamping(boost::shared_ptr< DampingBase > &damping)
TaskStackController_t & task_stack_controller_
An instance that helps solving the inverse of the Jacobian.


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