SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
STaskBase.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 STaskBase.hpp
24  *
25  * Created on: Dec 25, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef STASKBASE_HPP_
33 #define STASKBASE_HPP_
34 
35 #include <string>
36 
37 #include <scl/DataTypes.hpp>
38 
39 #include <scl/data_structs/SObject.hpp>
40 #include <scl/data_structs/SRobotParsed.hpp>
41 #include <scl/data_structs/SRobotIO.hpp>
42 
43 #include <scl/data_structs/SGcModel.hpp>
44 
45 namespace scl
46 {
47  //Forward declaration allows pointers to the parent controller
48  class SControllerMultiTask;
49 
69  class STaskBase : public SObject
70  {
71  public:
74 
76  std::string type_task_;
77 
82 
92 
95  sUInt priority_;
96 
98  scl::sUInt dof_task_;
99 
103 
106 
111  Eigen::MatrixXd J_, J_6_, J_dyn_inv_;
112 
115  Eigen::MatrixXd null_space_;
116 
118  Eigen::MatrixXd M_task_, M_task_inv_;
119 
124  Eigen::MatrixXd force_task_cc_;
125 
130  Eigen::MatrixXd force_task_grav_;
131 
135  Eigen::VectorXd force_task_;
136 
139  Eigen::VectorXd force_task_max_,force_task_min_;
140 
144  Eigen::VectorXd force_gc_;
145 
149  Eigen::MatrixXd range_space_;
150 
158  Eigen::VectorXd kp_, kv_, ka_, ki_;
159 
173  std::vector<sString2> task_nonstd_params_;
174 
175  /* *********************************************************************
176  * External shared data interface
177  * ********************************************************************* */
180  Eigen::VectorXd shared_data_;
181 
182  /* *********************************************************************
183  * Initialization functions
184  * ********************************************************************* */
186  STaskBase();
187 
189  virtual ~STaskBase(){}
190 
194  bool init(const std::string & arg_name,
195  const std::string & arg_type,
196  const sUInt arg_priority,
198  const scl::sUInt arg_task_dof,
199  const SRobotParsed* arg_robot_ds,
200  /* The remaining variables initialize model_ and servo_ */
201  const SGcModel* arg_gc_model,
202  const Eigen::VectorXd & arg_kp,
203  const Eigen::VectorXd & arg_kv,
204  const Eigen::VectorXd & arg_ka,
205  const Eigen::VectorXd & arg_ki,
206  const Eigen::VectorXd & arg_ftask_max,
207  const Eigen::VectorXd & arg_ftask_min,
211  const std::vector<scl::sString2>& arg_nonstd_params);
212 
214  bool setParentController(const SControllerMultiTask* arg_parent);
215 
222  virtual bool initTaskParams()=0;
223  };
224 }
225 #endif /* STASKBASE_HPP_ */
Definition: STaskBase.hpp:69
sUInt priority_
Definition: STaskBase.hpp:95
const SRobotParsed * robot_
Definition: STaskBase.hpp:102
const SControllerMultiTask * parent_controller_
Definition: STaskBase.hpp:73
Definition: SControllerMultiTask.hpp:54
Eigen::MatrixXd range_space_
Definition: STaskBase.hpp:149
Definition: SRobotParsed.hpp:51
Definition: SGcModel.hpp:53
bool init(const std::string &arg_name, const std::string &arg_type, const sUInt arg_priority, const scl::sUInt arg_task_dof, const SRobotParsed *arg_robot_ds, const SGcModel *arg_gc_model, const Eigen::VectorXd &arg_kp, const Eigen::VectorXd &arg_kv, const Eigen::VectorXd &arg_ka, const Eigen::VectorXd &arg_ki, const Eigen::VectorXd &arg_ftask_max, const Eigen::VectorXd &arg_ftask_min, const std::vector< scl::sString2 > &arg_nonstd_params)
Definition: STaskBase.cpp:54
Eigen::VectorXd force_gc_
Definition: STaskBase.hpp:144
Eigen::MatrixXd J_
Definition: STaskBase.hpp:111
const SGcModel * gc_model_
Definition: STaskBase.hpp:105
virtual bool initTaskParams()=0
Eigen::VectorXd shared_data_
Definition: STaskBase.hpp:180
std::vector< sString2 > task_nonstd_params_
Definition: STaskBase.hpp:173
Eigen::MatrixXd M_task_
Definition: STaskBase.hpp:118
Eigen::MatrixXd force_task_grav_
Definition: STaskBase.hpp:130
bool sBool
Definition: DataTypes.hpp:54
scl::sBool has_control_null_space_
Definition: STaskBase.hpp:91
bool setParentController(const SControllerMultiTask *arg_parent)
Definition: STaskBase.cpp:216
std::string type_task_
Definition: STaskBase.hpp:76
Eigen::VectorXd force_task_max_
Definition: STaskBase.hpp:139
virtual ~STaskBase()
Definition: STaskBase.hpp:189
scl::sUInt dof_task_
Definition: STaskBase.hpp:98
Eigen::VectorXd kp_
Definition: STaskBase.hpp:158
Eigen::VectorXd force_task_
Definition: STaskBase.hpp:135
Eigen::MatrixXd force_task_cc_
Definition: STaskBase.hpp:124
Eigen::MatrixXd null_space_
Definition: STaskBase.hpp:115
STaskBase()
Definition: STaskBase.cpp:41
Definition: SObject.hpp:43
scl::sBool has_been_activated_
Definition: STaskBase.hpp:81