Klamp't  0.8.1
FeedforwardController.h
1 #ifndef FEEDFORWARD_CONTROLLER_H
2 #define FEEDFORWARD_CONTROLLER_H
3 
4 #include "Controller.h"
5 #include <Klampt/Sensing/StateEstimator.h>
6 #include <KrisLibrary/robotics/Wrench.h>
7 
23 {
24  public:
25  FeedforwardController(Robot& robot,shared_ptr<RobotController> base);
26  virtual ~FeedforwardController() {}
27  virtual const char* Type() const { return "FeedforwardController"; }
28  virtual void Update(Real dt);
29  virtual void Reset();
30  virtual bool ReadState(File& f);
31  virtual bool WriteState(File& f) const;
32 
33  //getters/setters
34  virtual map<string,string> Settings() const;
35  virtual bool GetSetting(const string& name,string& str) const;
36  virtual bool SetSetting(const string& name,const string& str);
37 
38  //commands
39  void ZeroForces();
40  void AddForce(int link,const Vector3& f,const Vector3& worldpt);
41  virtual vector<string> Commands() const;
42  virtual bool SendCommand(const string& name,const string& str);
43 
44  //helpers
45  void SolveTorques(Vector& torques,Real dt);
46 
47  shared_ptr<RobotController> base;
48  shared_ptr<RobotStateEstimator> stateEstimator;
49  bool enableGravityCompensation,enableFeedforwardAcceleration;
50  Vector3 gravity;
51  //external forces and moments about the link origin
52  vector<Wrench> wrenches;
53 };
54 
55 
56 #endif
The main robot type used in RobotSim.
Definition: Robot.h:79
A class that adds a feedforward torque to the basic control. The necessary feedforward torque is esti...
Definition: FeedforwardController.h:22
A base class for a robot controller. The base class does nothing.
Definition: Controller.h:27