SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CDynamicsTao.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 CDynamicsTao.hpp
24  *
25  * Created on: Aug 23, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CDYNAMICSTAO_HPP_
33 #define CDYNAMICSTAO_HPP_
34 
35 #include <scl/DataTypes.hpp>
36 #include <scl/dynamics/CDynamicsBase.hpp>
38 #include <scl/dynamics/tao/tao/dynamics/taoNode.h>
39 #include <scl/dynamics/tao/tao/dynamics/taoJoint.h>
40 #include <scl/dynamics/tao/tao/dynamics/taoDynamics.h>
41 
42 #include <Eigen/Dense>
43 
44 #include <string>
45 
46 
47 class taoDNode;
48 
49 namespace jspace {
50  struct STaoTreeInfo;
51  class Model;
52 }
53 
54 namespace scl
55 {
56 
57  class SGcModel;
58  struct SRobotSensors;
59 
62  class CDynamicsTao : public CDynamicsBase
63  {
64  public:
65  /* *******************************************************************
66  * Computational functions.
67  * ******************************************************************* */
69  virtual bool computeGCModel(
70  SRobotSensors const * arg_sensor_data,
71  SGcModel * arg_gc_model)
72  { return false; }
73 
82  taoDNode * getTaoIdForLink(std::string arg_link_name);
83 
101  virtual sBool integrate(
105  SRobotIO& arg_inputs,
111  const sFloat arg_time_interval);
112 
113  /* *******************************************************************
114  * Dynamics State functions.
115  * ******************************************************************* */
121  sBool setGeneralizedCoordinates(Eigen::VectorXd &arg_q);
122 
128  sBool setGeneralizedVelocities(Eigen::VectorXd &arg_dq);
129 
135  sBool setGeneralizedForces(Eigen::VectorXd &arg_fgc);
136 
137  /* *******************************************************************
138  * Initialization functions.
139  * ******************************************************************* */
141  CDynamicsTao();
142  virtual ~CDynamicsTao();
143 
150  virtual bool init(const SRobotParsed& arg_robot_data);
151 
152  private:
154  std::string robot_name_;
155 
157  taoNodeRoot *tao_tree_q_root_, *tao_tree_q_dq_root_;
158 
162 
164  size_t ndof_;
165 
168 
170  Eigen::Vector3d gravity_;
171  };
172 
173 }
174 
175 #endif /* CDYNAMICSTAO_HPP_ */
Definition: SRobotIO.hpp:107
sBool setGeneralizedForces(Eigen::VectorXd &arg_fgc)
Definition: CDynamicsTao.cpp:365
jspace::Model * model_
Definition: CDynamicsTao.hpp:161
size_t ndof_
Definition: CDynamicsTao.hpp:164
Definition: SRobotParsed.hpp:51
Definition: Model.hpp:49
Definition: SGcModel.hpp:53
jspace::State state_
Definition: CDynamicsTao.hpp:167
abstract node class for articulated bodyA dynamics node = {Articulated Body Link + Set of associated ...
Definition: taoDNode.h:46
root node class for articulated body dynamicsThis implements taoDNode for root node of a articulated ...
Definition: taoNode.h:147
Definition: State.hpp:33
Definition: CDynamicsBase.hpp:55
Definition: CDynamicsTao.hpp:62
bool sBool
Definition: DataTypes.hpp:54
CDynamicsTao()
Definition: CDynamicsTao.cpp:53
virtual sBool integrate(SRobotIO &arg_inputs, const sFloat arg_time_interval)
Definition: CDynamicsTao.cpp:206
std::string robot_name_
Definition: CDynamicsTao.hpp:154
sBool setGeneralizedVelocities(Eigen::VectorXd &arg_dq)
Definition: CDynamicsTao.cpp:322
taoNodeRoot * tao_tree_q_root_
Definition: CDynamicsTao.hpp:157
Eigen::Vector3d gravity_
Definition: CDynamicsTao.hpp:170
virtual bool computeGCModel(SRobotSensors const *arg_sensor_data, SGcModel *arg_gc_model)
Definition: CDynamicsTao.hpp:69
double sFloat
Definition: DataTypes.hpp:72
virtual bool init(const SRobotParsed &arg_robot_data)
Definition: CDynamicsTao.cpp:111
sBool setGeneralizedCoordinates(Eigen::VectorXd &arg_q)
Definition: CDynamicsTao.cpp:280
Definition: SRobotIO.hpp:49
taoDNode * getTaoIdForLink(std::string arg_link_name)
Definition: CDynamicsTao.cpp:200