Choreonoid  1.8
ForwardDynamics.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_FORWARD_DYNAMICS_H
7 #define CNOID_BODY_FORWARD_DYNAMICS_H
8 
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class DySubBody;
15 typedef ref_ptr<DySubBody> DySubBodyPtr;
16 
22 class CNOID_EXPORT ForwardDynamics {
23 
24 public:
25  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
26 
27  ForwardDynamics(DySubBody* subBody);
28  virtual ~ForwardDynamics();
29 
30  void setGravityAcceleration(const Vector3& g);
31  void setEulerMethod();
32  void setRungeKuttaMethod();
33  void setTimeStep(double timeStep);
34  void enableSensors(bool on);
35  void setOldAccelSensorCalcMode(bool on);
36 
37  virtual void initialize() = 0;
38  virtual void calcNextState() = 0;
39  virtual void refreshState() = 0;
40 
41 protected:
42  virtual void initializeSensors();
43 
52  static void SE3exp(Isometry3& out_T, const Isometry3& T0, const Vector3& w, const Vector3& vo, double dt);
53 
56  double timeStep;
59 
60  enum { EULER_METHOD, RUNGEKUTTA_METHOD } integrationMode;
61 };
62 
63 }
64 
65 #endif
BasicSensorSimulationHelper.h
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::Isometry3
Eigen::Isometry3d Isometry3
Definition: EigenTypes.h:73
cnoid::ForwardDynamics::sensorsEnabled
bool sensorsEnabled
Definition: ForwardDynamics.h:57
cnoid::DySubBody
Definition: DyBody.h:23
cnoid::ForwardDynamics::g
Vector3 g
Definition: ForwardDynamics.h:55
cnoid::ref_ptr< DySubBody >
cnoid::DySubBodyPtr
ref_ptr< DySubBody > DySubBodyPtr
Definition: DyBody.h:74
cnoid::ForwardDynamics::timeStep
double timeStep
Definition: ForwardDynamics.h:56
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::ForwardDynamics::subBody
DySubBodyPtr subBody
Definition: ForwardDynamics.h:54
cnoid::ForwardDynamics::sensorHelper
BasicSensorSimulationHelper sensorHelper
Definition: ForwardDynamics.h:58
cnoid::BasicSensorSimulationHelper
Definition: BasicSensorSimulationHelper.h:19
cnoid::ForwardDynamics
Definition: ForwardDynamics.h:22