solver_factory.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_FACTORIES_SOLVER_FACTORY_H
19 #define COB_TWIST_CONTROLLER_CONSTRAINT_SOLVERS_FACTORIES_SOLVER_FACTORY_H
20 
21 #include <set>
22 #include <Eigen/Core>
23 #include <Eigen/SVD>
24 #include <kdl/jntarray.hpp>
25 
29 
32 {
33  public:
34  virtual Eigen::MatrixXd calculateJointVelocities(Matrix6Xd_t& jacobian_data,
35  const Vector6d_t& in_cart_velocities,
36  const JointStates& joint_states,
37  boost::shared_ptr<DampingBase>& damping_method,
38  std::set<ConstraintBase_t>& constraints) const = 0;
39 
40  virtual ~ISolverFactory() {}
41 };
42 
44 template <typename T>
46 {
47  public:
49  const LimiterParams& limiter_params,
50  TaskStackController_t& task_stack_controller)
51  {
52  constraint_solver_.reset(new T(params, limiter_params, task_stack_controller));
53  }
54 
56  {
57  constraint_solver_.reset();
58  }
59 
71  Eigen::MatrixXd calculateJointVelocities(Matrix6Xd_t& jacobian_data,
72  const Vector6d_t& in_cart_velocities,
73  const JointStates& joint_states,
74  boost::shared_ptr<DampingBase>& damping_method,
75  std::set<ConstraintBase_t>& constraints) const
76  {
77  constraint_solver_->setJacobianData(jacobian_data);
78  constraint_solver_->setConstraints(constraints);
79  constraint_solver_->setDamping(damping_method);
80  Eigen::MatrixXd new_q_dot = constraint_solver_->solve(in_cart_velocities, joint_states);
81  return new_q_dot;
82  }
83 
84  private:
86 };
87 
88 #endif // COB_TWIST_CONTROLLER_CONSTRAINT_SOLVERS_FACTORIES_SOLVER_FACTORY_H
virtual ~ISolverFactory()
Eigen::Matrix< double, 6, 1 > Vector6d_t
Abstract base class defining interfaces for the creation of a specific solver.
Eigen::MatrixXd calculateJointVelocities(Matrix6Xd_t &jacobian_data, const Vector6d_t &in_cart_velocities, const JointStates &joint_states, boost::shared_ptr< DampingBase > &damping_method, std::set< ConstraintBase_t > &constraints) const
SolverFactory(const TwistControllerParams &params, const LimiterParams &limiter_params, TaskStackController_t &task_stack_controller)
Interface definition to support generic usage of the solver factory without specifying a typename in ...
virtual Eigen::MatrixXd calculateJointVelocities(Matrix6Xd_t &jacobian_data, const Vector6d_t &in_cart_velocities, const JointStates &joint_states, boost::shared_ptr< DampingBase > &damping_method, std::set< ConstraintBase_t > &constraints) const =0
Eigen::Matrix< double, 6, Eigen::Dynamic > Matrix6Xd_t
boost::shared_ptr< T > constraint_solver_


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