SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CTaskOpPosContactForce.hpp
1 /* This file is part of scl, a control and simulation library
2 for robots and biomechanical models.
3 
4 scl is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 3 of the License, or (at your option) any later version.
8 
9 Alternatively, you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
13 
14 scl is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU Lesser General Public
20 License and a copy of the GNU General Public License along with
21 scl. If not, see <http://www.gnu.org/licenses/>.
22 */
23 /* \file CTaskOpPosContactForce.hpp
24  *
25  * Created on: Aug 19, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CTASKOPPOSCONTACTFORCE_HPP_
33 #define CTASKOPPOSCONTACTFORCE_HPP_
34 
35 #include <string>
36 #include <vector>
37 
38 #include <scl/DataTypes.hpp>
39 
40 #include <scl/control/task/tasks/data_structs/STaskOpPosContactForce.hpp>
41 
42 #include <scl/control/task/CTaskBase.hpp>
43 
44 #include <Eigen/Dense>
45 #include <Eigen/SVD>
46 
47 
48 namespace scl
49 {
63 {
64 public:
65  /********************************
66  * CTaskBase API
67  *********************************/
70  virtual bool init(STaskBase* arg_task_data,
71  CDynamicsBase* arg_dynamics);
72 
74  virtual STaskBase* getTaskData();
75 
78  virtual void reset();
79 
81  virtual bool computeServo(const SRobotSensors* arg_sensors);
82 
85  virtual bool computeModel(const SRobotSensors* arg_sensors);
86 
87  /********************************
88  * CTaskOpPosContactForce specific functions
89  *********************************/
92 
95 
97  inline void setGoal(const Eigen::VectorXd & arg_goal)
98  { data_->x_goal_ = arg_goal; }
99 
101  inline void setGoalVel(const Eigen::VectorXd & arg_goal)
102  { data_->dx_goal_ = arg_goal; }
103 
105  inline void setGoalAcc(const Eigen::VectorXd & arg_goal)
106  { data_->ddx_goal_ = arg_goal; }
107 
110 
111 private:
114 
116  Eigen::VectorXd tmp1, tmp2;
117 
119  Eigen::ColPivHouseholderQR<Eigen::Matrix3d> qr_;
120 
123 
126  Eigen::JacobiSVD<Eigen::Matrix3d > svd_;
127  Eigen::Matrix3d singular_values_;
128 };
129 
130 }
131 
132 #endif /* CTASKOPPOSCONTACTFORCE_HPP_ */
virtual bool init(STaskBase *arg_task_data, CDynamicsBase *arg_dynamics)
Definition: CTaskOpPosContactForce.cpp:61
Definition: STaskBase.hpp:69
void setGoal(const Eigen::VectorXd &arg_goal)
Definition: CTaskOpPosContactForce.hpp:97
sBool achievedGoalPos()
Definition: CTaskOpPosContactForce.cpp:263
Eigen::VectorXd tmp1
Definition: CTaskOpPosContactForce.hpp:116
virtual void reset()
Definition: CTaskOpPosContactForce.cpp:106
STaskOpPosContactForce * data_
Definition: CTaskOpPosContactForce.hpp:113
Definition: CTaskOpPosContactForce.hpp:62
Eigen::ColPivHouseholderQR< Eigen::Matrix3d > qr_
Definition: CTaskOpPosContactForce.hpp:119
virtual STaskBase * getTaskData()
Definition: CTaskOpPosContactForce.cpp:103
Definition: CDynamicsBase.hpp:55
void setGoalAcc(const Eigen::VectorXd &arg_goal)
Definition: CTaskOpPosContactForce.hpp:105
CTaskOpPosContactForce()
Definition: CTaskOpPosContactForce.cpp:53
bool sBool
Definition: DataTypes.hpp:54
virtual ~CTaskOpPosContactForce()
Definition: CTaskOpPosContactForce.hpp:94
Definition: STaskOpPosContactForce.hpp:43
void setGoalVel(const Eigen::VectorXd &arg_goal)
Definition: CTaskOpPosContactForce.hpp:101
virtual bool computeServo(const SRobotSensors *arg_sensors)
Definition: CTaskOpPosContactForce.cpp:114
virtual bool computeModel(const SRobotSensors *arg_sensors)
Definition: CTaskOpPosContactForce.cpp:158
Eigen::JacobiSVD< Eigen::Matrix3d > svd_
Definition: CTaskOpPosContactForce.hpp:126
sBool lambda_inv_singular_
Definition: CTaskOpPosContactForce.hpp:122
Definition: SRobotIO.hpp:49
Definition: CTaskBase.hpp:54