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