ForwardDynamics.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * National Institute of Advanced Industrial Science and Technology (AIST)
8  */
14 #ifndef OPENHRP_FORWARD_DYNAMICS_H_INCLUDED
15 #define OPENHRP_FORWARD_DYNAMICS_H_INCLUDED
16 
17 #include "Body.h"
18 
19 #include <boost/shared_ptr.hpp>
20 #include <boost/intrusive_ptr.hpp>
21 #include <hrpUtil/Eigen3d.h>
22 
23 #include "Config.h"
24 
25 
26 namespace hrp
27 {
28  class AccelSensor;
29 
35  class HRPMODEL_API ForwardDynamics {
36 
37  public:
38  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39 
41  virtual ~ForwardDynamics();
42 
43  void setGravityAcceleration(const Vector3& g);
44  void setEulerMethod();
45  void setRungeKuttaMethod();
46  void setTimeStep(double timeStep);
47  void enableSensors(bool on);
48 
49  virtual void initialize() = 0;
50  virtual void calcNextState() = 0;
51 
52  protected:
53 
54  virtual void initializeSensors();
55  virtual void updateSensorsFinal();
56 
67  static void SE3exp(Vector3& out_p, Matrix33& out_R,
68  const Vector3& p0, const Matrix33& R0,
69  const Vector3& w, const Vector3& vo, double dt);
70 
73  double timeStep;
75 
76  enum { EULER_METHOD, RUNGEKUTTA_METHOD } integrationMode;
77 
78  private:
79 
80  void updateAccelSensor(AccelSensor* sensor);
81  void initializeAccelSensors();
82 
83  // varialbes for calculating sensor values
84  // preview control gain matrices for force sensors
85  typedef Eigen::Matrix2d matrix22;
86  typedef Eigen::Vector2d vector2;
87  matrix22 A;
88  vector2 B;
89 
90  };
91 
92  typedef boost::shared_ptr<ForwardDynamics> ForwardDynamicsPtr;
93 
94 };
95 
96 #endif
Eigen::Vector2d vector2
boost::shared_ptr< ForwardDynamics > ForwardDynamicsPtr
w
boost::shared_ptr< Body > BodyPtr
Definition: Body.h:315
Eigen::Vector3d Vector3
Definition: EigenTypes.h:11
Eigen::Matrix3d Matrix33
Definition: EigenTypes.h:12
Eigen::Matrix2d matrix22


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:21