Klamp't  0.9.0
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 
8 namespace Klampt {
9 
25 {
26  public:
27  FeedforwardController(RobotModel& robot,shared_ptr<RobotController> base);
28  virtual ~FeedforwardController() {}
29  virtual const char* Type() const { return "FeedforwardController"; }
30  virtual void Update(Real dt);
31  virtual void Reset();
32  virtual bool ReadState(File& f);
33  virtual bool WriteState(File& f) const;
34 
35  //getters/setters
36  virtual map<string,string> Settings() const;
37  virtual bool GetSetting(const string& name,string& str) const;
38  virtual bool SetSetting(const string& name,const string& str);
39 
40  //commands
41  void ZeroForces();
42  void AddForce(int link,const Vector3& f,const Vector3& worldpt);
43  virtual vector<string> Commands() const;
44  virtual bool SendCommand(const string& name,const string& str);
45 
46  //helpers
47  void SolveTorques(Vector& torques,Real dt);
48 
49  shared_ptr<RobotController> base;
50  shared_ptr<RobotStateEstimator> stateEstimator;
51  bool enableGravityCompensation,enableFeedforwardAcceleration;
52  Vector3 gravity;
53  //external forces and moments about the link origin
54  vector<Wrench> wrenches;
55 };
56 
57 } // namespace Klampt
58 
59 #endif
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
A class that adds a feedforward torque to the basic control. The necessary feedforward torque is esti...
Definition: FeedforwardController.h:24