SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CTaskGc.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 CTaskGc.hpp
24  *
25  * Created on: Jul 23, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CTASKGC_HPP_
33 #define CTASKGC_HPP_
34 
35 #include <scl/control/task/CTaskBase.hpp>
36 
37 #include <scl/control/task/tasks/data_structs/STaskGc.hpp>
38 
39 namespace scl
40 {
41 
42  class CTaskGc : public scl::CTaskBase
43  {
44  public:
45  /********************************
46  * CTaskBase API
47  *********************************/
49  virtual bool computeServo(const SRobotSensors* arg_sensors);
50 
53  virtual bool computeModel(const SRobotSensors* arg_sensors);
54 
55  /* **************************************************************
56  * Status Get/Set Functions
57  * ************************************************************** */
59  virtual STaskBase* getTaskData();
60 
62  virtual bool setGoalPos(const Eigen::VectorXd & arg_goal);
63 
65  virtual bool setGoalVel(const Eigen::VectorXd & arg_goal);
66 
68  virtual bool setGoalAcc(const Eigen::VectorXd & arg_goal);
69 
71  virtual bool getGoalPos(Eigen::VectorXd & arg_goal) const
72  { arg_goal = data_->q_goal_; return true; }
73 
75  virtual bool getGoalVel(Eigen::VectorXd & arg_goal) const
76  { arg_goal = data_->dq_goal_; return true; }
77 
79  virtual bool getGoalAcc(Eigen::VectorXd & arg_goal) const
80  { arg_goal = data_->ddq_goal_; return true; }
81 
84 
85  /********************************
86  * Initialization specific functions
87  *********************************/
89  CTaskGc();
90 
92  virtual ~CTaskGc(){}
93 
96  virtual bool init(STaskBase* arg_task_data,
97  CDynamicsBase* arg_dynamics);
98 
99  bool setFlagCompensateForGravity(const bool arg_grav_enabled)
100  {
101  if(NULL == data_){return false;}
102  else{ data_->gravity_enabled_ = arg_grav_enabled; return true; }
103  }
104 
107  virtual void reset();
108 
109  private:
110  STaskGc* data_;
111  };
112 
113 }
114 
115 #endif /* CTASKGC_HPP_ */
CTaskGc()
Definition: CTaskGc.cpp:40
Definition: STaskBase.hpp:69
virtual bool getGoalVel(Eigen::VectorXd &arg_goal) const
Definition: CTaskGc.hpp:75
virtual bool init(STaskBase *arg_task_data, CDynamicsBase *arg_dynamics)
Definition: CTaskGc.cpp:46
virtual void reset()
Definition: CTaskGc.cpp:141
sBool achievedGoalPos()
Definition: CTaskGc.cpp:202
virtual bool computeModel(const SRobotSensors *arg_sensors)
Definition: CTaskGc.cpp:191
virtual ~CTaskGc()
Definition: CTaskGc.hpp:92
Definition: CDynamicsBase.hpp:55
Definition: CTaskGc.hpp:42
bool sBool
Definition: DataTypes.hpp:54
virtual STaskBase * getTaskData()
Definition: CTaskGc.cpp:81
virtual bool getGoalPos(Eigen::VectorXd &arg_goal) const
Definition: CTaskGc.hpp:71
virtual bool getGoalAcc(Eigen::VectorXd &arg_goal) const
Definition: CTaskGc.hpp:79
virtual bool setGoalVel(const Eigen::VectorXd &arg_goal)
Definition: CTaskGc.cpp:104
virtual bool setGoalAcc(const Eigen::VectorXd &arg_goal)
Definition: CTaskGc.cpp:123
virtual bool computeServo(const SRobotSensors *arg_sensors)
Definition: CTaskGc.cpp:149
Definition: SRobotIO.hpp:49
Definition: CTaskBase.hpp:54
virtual bool setGoalPos(const Eigen::VectorXd &arg_goal)
Definition: CTaskGc.cpp:85