Klamp't  0.9.0
ControlledRobot.h
1 #ifndef CONTROLLED_ROBOT_H
2 #define CONTROLLED_ROBOT_H
3 
4 #include "Controller.h"
5 
6 namespace Klampt {
7 
22 {
23  public:
25  virtual ~ControlledRobot() {}
26  virtual bool Init(RobotModel* robot,RobotController* controller=NULL);
27  virtual void Step(Real dt);
28  virtual void ReadSensorData(RobotSensors& sensors)=0;
29  virtual void WriteCommandData(const RobotMotorCommand& command)=0;
30 
31  //convenience functions for inspection
32  void GetCommandedConfig(Config& q);
33  void GetCommandedVelocity(Config& dq);
34  void GetSensedConfig(Config& q);
35  void GetSensedVelocity(Config& dq);
36 
37  //settings
38  RobotModel* klamptRobotModel;
39  RobotController* klamptController;
40 
41  //state
42  RobotMotorCommand command;
43  RobotSensors sensors;
44 };
45 
46 } //namespace Klampt
47 
48 #endif
A set of sensors for the robot.
Definition: Sensor.h:111
A collection of basic motor types.
Definition: Command.h:45
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
An interface for a Klamp't controlled robot. This should be implemented if you wish to use Klamp't co...
Definition: ControlledRobot.h:21
Definition: ContactDistance.h:6