Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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