Klamp't  0.8.1
Public Member Functions | Public Attributes | List of all members
RobotController Class Reference

A base class for a robot controller. The base class does nothing. More...

#include <Controller.h>

Inheritance diagram for RobotController:
ContactJointTrackingController FeedforwardController JointTrackingController LoggingController OperationalSpaceController PyController SerialController TabulatedController

Public Member Functions

 RobotController (Robot &robot)
virtual const char * Type () const
virtual void Update (Real dt)
virtual void Reset ()
virtual bool ReadState (File &f)
virtual bool WriteState (File &f) const
virtual map< string, string > Settings () const
virtual bool GetSetting (const string &name, string &str) const
virtual bool SetSetting (const string &name, const string &str)
virtual vector< string > Commands () const
virtual bool SendCommand (const string &name, const string &str)
void SetPIDCommand (const Config &qdes)
void SetPIDCommand (const Config &qdes, const Config &dqdes)
void SetFeedforwardPIDCommand (const Config &qdes, const Config &dqdes, const Vector &torques)
void SetTorqueCommand (const Vector &torques)
bool GetCommandedConfig (Config &q)
bool GetCommandedVelocity (Config &dq)
bool GetSensedConfig (Config &q)
bool GetSensedVelocity (Config &dq)

Public Attributes

Real time
Real nominalTimeStep
 a "desired" time step, by default 0, which acts as a hint to the simulator. Note that it doesn't have to abide the hint.
 sensor input (filled in by simulator)
 motor command output (output to simulator)

Detailed Description

A base class for a robot controller. The base class does nothing.

The sensors and command pointer will be set up by the simulator/real robot. In the Update function, the controller should read the sensor information in sensors and write the desired joint commands to the command pointer.

Reset is called when the user hits reset on the simulation.

To support reading and writing controller states, fill in the ReadState and WriteState functions.

To support user-supplied configuration parameters, fill in the Settings() methods. These are currently used in SimTest but in the future we hope to support more general methods for getting/setting controller settings, e.g. in an XML file.

The documentation for this class was generated from the following file: