Klamp't  0.9.0
SimRobotController.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 namespace Klampt {
8 
9  class Simulator;
10 
20 {
21  public:
23  void Init(RobotModel* robot,ODERobot* oderobot,RobotController* controller=NULL);
24  void Step(Real dt,Simulator* sim);
25  void UpdateRobot();
26 
27  void GetCommandedConfig(Config& q);
28  void GetCommandedVelocity(Config& dq);
29  void GetSensedConfig(Config& q);
30  void GetSensedVelocity(Config& dq);
31  void GetSimulatedConfig(Config& q);
32  void GetSimulatedVelocity(Config& dq);
34  void GetActuatorTorques(Vector& t) const;
36  void GetLinkTorques(Vector& t) const;
37  RobotMotorCommand* GetCommands() { return &command; }
38 
39  bool ReadState(File& f);
40  bool WriteState(File& f) const;
41 
42  //settings
43  RobotModel* robot;
44  ODERobot* oderobot;
45  RobotController* controller;
46  Real controlTimeStep;
47 
48  //state
49  Real curTime;
50  Real nextControlTime;
51  RobotMotorCommand command;
52  RobotSensors sensors;
53  vector<Real> nextSenseTime;
54 };
55 
56 } // namespace Klampt
57 
58 #endif
A set of sensors for the robot.
Definition: Sensor.h:111
void GetActuatorTorques(Vector &t) const
Returns a list of torques commanded at the actuator (driver) level.
A physical simulator for a WorldModel.
Definition: Simulator.h:69
A collection of basic motor types.
Definition: Command.h:45
void GetLinkTorques(Vector &t) const
Returns a list of torques commanded at the link level.
A robot simulated in an ODE "world".
Definition: ODERobot.h:30
A class containing information about an ODE-simulated and controlled robot.
Definition: SimRobotController.h:19
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