constraint_solver_factory.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *   http://www.apache.org/licenses/LICENSE-2.0
00009 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 
00018 #ifndef COB_TWIST_CONTROLLER_CONSTRAINT_SOLVERS_CONSTRAINT_SOLVER_FACTORY_H
00019 #define COB_TWIST_CONTROLLER_CONSTRAINT_SOLVERS_CONSTRAINT_SOLVER_FACTORY_H
00020 
00021 #include <set>
00022 #include <Eigen/Core>
00023 #include <Eigen/SVD>
00024 #include <kdl/jntarray.hpp>
00025 #include <kdl/chainjnttojacsolver.hpp>
00026 #include <kdl/chainfksolvervel_recursive.hpp>
00027 #include <boost/shared_ptr.hpp>
00028 
00029 #include "cob_twist_controller/cob_twist_controller_data_types.h"
00030 #include "cob_twist_controller/constraint_solvers/factories/solver_factory.h"
00031 #include "cob_twist_controller/callback_data_mediator.h"
00032 
00034 class ConstraintSolverFactory
00035 {
00036     public:
00042         ConstraintSolverFactory(CallbackDataMediator& data_mediator,
00043                                 KDL::ChainJntToJacSolver& jnt_to_jac,
00044                                 KDL::ChainFkSolverVel_recursive& fk_solver_vel,
00045                                 TaskStackController_t& task_stack_controller) :
00046             data_mediator_(data_mediator),
00047             jnt_to_jac_(jnt_to_jac),
00048             task_stack_controller_(task_stack_controller),
00049             fk_solver_vel_(fk_solver_vel)
00050         {
00051             this->solver_factory_.reset();
00052             this->damping_method_.reset();
00053         }
00054 
00055         ~ConstraintSolverFactory()
00056         {
00057             this->solver_factory_.reset();
00058             this->damping_method_.reset();
00059         }
00060 
00070         int8_t calculateJointVelocities(Matrix6Xd_t& jacobian_data,
00071                                         const Vector6d_t& in_cart_velocities,
00072                                         const JointStates& joint_states,
00073                                         Eigen::MatrixXd& out_jnt_velocities);
00074 
00081         static bool getSolverFactory(const TwistControllerParams& params,
00082                                      const LimiterParams& limiter_params,
00083                                      boost::shared_ptr<ISolverFactory>& solver_factory,
00084                                      TaskStackController_t& task_stack_controller);
00085 
00086         int8_t resetAll(const TwistControllerParams& params, const LimiterParams& limiter_params);
00087 
00088     private:
00089         CallbackDataMediator& data_mediator_;
00090         KDL::ChainJntToJacSolver& jnt_to_jac_;
00091         KDL::ChainFkSolverVel_recursive& fk_solver_vel_;
00092 
00093         boost::shared_ptr<ISolverFactory> solver_factory_;
00094         boost::shared_ptr<DampingBase> damping_method_;
00095         std::set<ConstraintBase_t> constraints_;
00096         TaskStackController_t& task_stack_controller_;
00097 };
00098 
00099 #endif  // COB_TWIST_CONTROLLER_CONSTRAINT_SOLVERS_CONSTRAINT_SOLVER_FACTORY_H


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Thu Jun 6 2019 21:19:26