Simulator.h
Go to the documentation of this file.
00001 #include <hrpCorba/OpenHRPCommon.hh>
00002 #include <hrpModel/World.h>
00003 #include <hrpModel/ConstraintForceSolver.h>
00004 #include <hrpUtil/TimeMeasure.h>
00005 #include "hrpsys/util/Project.h"
00006 #include "hrpsys/util/ThreadedObject.h"
00007 #include "hrpsys/util/LogManager.h"
00008 #include "hrpsys/util/ProjectUtil.h"
00009 #include "SceneState.h"
00010 
00011 class BodyRTC;
00012 class SDL_Thread;
00013 
00014 class Simulator : virtual public hrp::World<hrp::ConstraintForceSolver>,
00015     public ThreadedObject
00016 {
00017 public:
00018     Simulator(LogManager<SceneState> *i_log);
00019     void init(Project &prj, BodyFactory &factory);
00020     bool oneStep();
00021     void checkCollision(OpenHRP::CollisionSequence &collisions);
00022     void checkCollision();
00023     void realTime(bool flag) { adjustTime = flag; }
00024     void setTotalTime(double time) { m_totalTime = time; }
00025     double totalTime() { return m_totalTime; }
00026     void setLogTimeStep(double time) { m_logTimeStep = time; }
00027     void clear();
00028     void appendLog();
00029     void addCollisionCheckPair(BodyRTC *b1, BodyRTC *b2);
00030     void kinematicsOnly(bool flag);
00031 private:
00032     LogManager<SceneState> *log;
00033     std::vector<ClockReceiver> receivers;
00034     std::vector<hrp::ColdetLinkPairPtr> pairs;
00035     OpenHRP::CollisionSequence collisions;
00036     SceneState state;
00037     double m_totalTime, m_logTimeStep, m_nextLogTime;
00038     TimeMeasure tm_dynamics, tm_control, tm_collision;
00039     bool adjustTime, m_kinematicsOnly;
00040     std::deque<struct timeval> startTimes;
00041     struct timeval beginTime;
00042 };


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Wed May 15 2019 05:02:19