Klamp't  0.8.1
ControlledSimulator.h
1 #ifndef ODE_CONTROLLED_SIMULATOR_H
2 #define ODE_CONTROLLED_SIMULATOR_H
3 
4 #include <Klampt/Control/Controller.h>
5 #include "ODERobot.h"
6 
7 class WorldSimulation;
8 
18 {
19  public:
21  void Init(Robot* robot,ODERobot* oderobot,RobotController* controller=NULL);
22  void Step(Real dt,WorldSimulation* sim);
23  void UpdateRobot();
24 
25  void GetCommandedConfig(Config& q);
26  void GetCommandedVelocity(Config& dq);
27  void GetSensedConfig(Config& q);
28  void GetSensedVelocity(Config& dq);
29  void GetSimulatedConfig(Config& q);
30  void GetSimulatedVelocity(Config& dq);
32  void GetActuatorTorques(Vector& t) const;
34  void GetLinkTorques(Vector& t) const;
35  RobotMotorCommand* GetCommands() { return &command; }
36 
37  bool ReadState(File& f);
38  bool WriteState(File& f) const;
39 
40  //settings
41  Robot* robot;
42  ODERobot* oderobot;
43  RobotController* controller;
44  Real controlTimeStep;
45 
46  //state
47  Real curTime;
48  Real nextControlTime;
49  RobotMotorCommand command;
50  RobotSensors sensors;
51  vector<Real> nextSenseTime;
52 };
53 
54 #endif
A robot simulated in an ODE "world".
Definition: ODERobot.h:28
The main robot type used in RobotSim.
Definition: Robot.h:79
A collection of basic motor types.
Definition: Command.h:43
A class containing information about an ODE-simulated and controlled robot.
Definition: ControlledSimulator.h:17
void GetLinkTorques(Vector &t) const
Returns a list of torques commanded at the link level.
void GetActuatorTorques(Vector &t) const
Returns a list of torques commanded at the actuator (driver) level.
A set of sensors for the robot.
Definition: Sensor.h:106
A base class for a robot controller. The base class does nothing.
Definition: Controller.h:27
A physical simulator for a RobotWorld.
Definition: WorldSimulation.h:67