SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CTaskGcSet.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 CTaskGcSet.hpp
24  *
25  * Created on: Aug 29, 2011
26  *
27  * Copyright (C) 2011
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CTASKGCSET_HPP_
33 #define CTASKGCSET_HPP_
34 
35 #include <scl/DataTypes.hpp>
36 
37 #include <scl/control/task/CTaskBase.hpp>
38 #include <scl/control/task/tasks/data_structs/STaskGcSet.hpp>
39 
40 #include <Eigen/Core>
41 
42 #include <vector>
43 #include <string>
44 
45 namespace scl
46 {
59  class CTaskGcSet: public scl::CTaskBase
60  {
61  public:
62  /********************************
63  * CTaskBase API
64  *********************************/
66  virtual bool computeServo(const SRobotSensors* arg_sensors);
67 
70  virtual bool computeModel(const SRobotSensors* arg_sensors);
71 
72  /* **************************************************************
73  * Status Get/Set Functions
74  * ************************************************************** */
76  virtual STaskBase* getTaskData();
77 
79  virtual bool setGoalPos(const Eigen::VectorXd & arg_goal);
80 
82  virtual bool setGoalVel(const Eigen::VectorXd & arg_goal);
83 
85  virtual bool setGoalAcc(const Eigen::VectorXd & arg_goal);
86 
88  virtual bool getGoalPos(Eigen::VectorXd & arg_goal) const
89  { arg_goal = data_->q_goal_; return true; }
90 
92  virtual bool getGoalVel(Eigen::VectorXd & arg_goal) const
93  { arg_goal = data_->dq_goal_; return true; }
94 
96  virtual bool getGoalAcc(Eigen::VectorXd & arg_goal) const
97  { arg_goal = data_->ddq_goal_; return true; }
98 
99  /********************************
100  * Initialization specific functions
101  *********************************/
103  CTaskGcSet();
104 
106  virtual ~CTaskGcSet(){}
107 
110  virtual bool init(STaskBase* arg_task_data,
111  CDynamicsBase* arg_dynamics);
112 
115  virtual void reset();
116 
117  private:
118  STaskGcSet* data_;
121  Eigen::VectorXd selected_gcs_;
122  };
123 
124 } /* namespace scl */
125 #endif /* CTASKGCSET_HPP_ */
Definition: STaskBase.hpp:69
virtual bool computeModel(const SRobotSensors *arg_sensors)
Definition: CTaskGcSet.cpp:211
virtual ~CTaskGcSet()
Definition: CTaskGcSet.hpp:106
virtual bool getGoalPos(Eigen::VectorXd &arg_goal) const
Definition: CTaskGcSet.hpp:88
virtual bool getGoalAcc(Eigen::VectorXd &arg_goal) const
Definition: CTaskGcSet.hpp:96
virtual bool getGoalVel(Eigen::VectorXd &arg_goal) const
Definition: CTaskGcSet.hpp:92
Eigen::VectorXd selected_gcs_
Definition: CTaskGcSet.hpp:121
Definition: CTaskGcSet.hpp:59
Definition: CDynamicsBase.hpp:55
virtual bool computeServo(const SRobotSensors *arg_sensors)
Definition: CTaskGcSet.cpp:153
virtual void reset()
Definition: CTaskGcSet.cpp:145
Definition: STaskGcSet.hpp:43
CTaskGcSet()
Definition: CTaskGcSet.cpp:40
virtual STaskBase * getTaskData()
Definition: CTaskGcSet.cpp:85
virtual bool setGoalAcc(const Eigen::VectorXd &arg_goal)
Definition: CTaskGcSet.cpp:127
virtual bool setGoalPos(const Eigen::VectorXd &arg_goal)
Definition: CTaskGcSet.cpp:89
virtual bool init(STaskBase *arg_task_data, CDynamicsBase *arg_dynamics)
Definition: CTaskGcSet.cpp:46
Definition: SRobotIO.hpp:49
Definition: CTaskBase.hpp:54
virtual bool setGoalVel(const Eigen::VectorXd &arg_goal)
Definition: CTaskGcSet.cpp:108