Klamp't  0.9.0
LoggingController.h
1 #ifndef LOGGING_CONTROLLER_H
2 #define LOGGING_CONTROLLER_H
3 
4 #include "Controller.h"
5 
6 namespace Klampt {
7 
20 {
21  public:
22  LoggingController(RobotModel& robot,const shared_ptr<RobotController>& base);
23  virtual const char* Type() const { return "LoggingController"; }
24  virtual void Update(Real dt);
25  virtual void Reset();
26  virtual bool ReadState(File& f);
27  virtual bool WriteState(File& f) const;
28  bool SaveLog(const char* fn) const;
29  bool LoadLog(const char* fn);
30 
31  //getters/setters
32  virtual map<string,string> Settings() const;
33  virtual bool GetSetting(const string& name,string& str) const;
34  virtual bool SetSetting(const string& name,const string& str);
35 
36  virtual vector<string> Commands() const;
37  virtual bool SendCommand(const string& name,const string& str);
38 
39  //helpers that compress the logs
40  bool EqualCommand(const ActuatorCommand& a,const ActuatorCommand& b) const;
41  bool EqualCommand(const RobotMotorCommand& a,const RobotMotorCommand& b) const;
42  void RemoveDelays(Real maxDelayTime);
43 
44  shared_ptr<RobotController> base;
45  bool save,replay;
46  bool onlyJointCommands;
47  vector<pair<Real,RobotMotorCommand> > trajectory;
48  int replayIndex;
49 };
50 
51 } // namespace Klampt
52 
53 #endif
A controllre that saves/replays low-level commands from disk.
Definition: LoggingController.h:19
A collection of basic motor types.
Definition: Command.h:45
A basic motor type. Handles PID, torque, and locked velocity modes.
Definition: Command.h:17
A base class for a robot controller. The base class does nothing.
Definition: Controller.h:29
The main robot type used in RobotSim.
Definition: Robot.h:83
Definition: ContactDistance.h:6