controls  3.0.0
BaseControllerInterface.h
Go to the documentation of this file.
1 #ifndef CONTROLS_CONTROLLER_BASE_CONTROLLER_INTERFACE_H
2 #define CONTROLS_CONTROLLER_BASE_CONTROLLER_INTERFACE_H
3 
6 #include <utils/Transforms.h>
7 
16 protected:
18  std::shared_ptr<SystemDynamicsBase> auv_;
19 
21  std::shared_ptr<ControllerConfig> config_;
22 
23 public:
25 
32  BaseControllerInterface(std::shared_ptr<SystemDynamicsBase> auv, std::shared_ptr<ControllerConfig> config)
33  : auv_(std::move(auv)), config_(std::move(config)) {
34  }
35 
36  virtual ~BaseControllerInterface() = default;
37 
41  virtual void reset() {};
42 
52  virtual Vector6d getForce(const State& goal, const State& curr, double dt) = 0;
53 };
54 
55 #endif // CONTROLS_CONTROLLER_BASE_CONTROLLER_INTERFACE_H
Eigen::Matrix< double, 6, 1 > Vector6d
Definition: Types.h:29
Abstract base class for a single-responsibility force controller.
Definition: BaseControllerInterface.h:15
BaseControllerInterface(std::shared_ptr< SystemDynamicsBase > auv, std::shared_ptr< ControllerConfig > config)
Constructs a controller with the given dynamics model and config.
Definition: BaseControllerInterface.h:32
virtual ~BaseControllerInterface()=default
std::shared_ptr< ControllerConfig > config_
Tuning parameters shared with all controllers in a stack.
Definition: BaseControllerInterface.h:21
virtual void reset()
Resets any internal state (e.g., integrator terms)
Definition: BaseControllerInterface.h:41
BaseControllerInterface()=default
virtual Vector6d getForce(const State &goal, const State &curr, double dt)=0
Computes the instantaneous 6DOF body force for the given goal and current state.
std::shared_ptr< SystemDynamicsBase > auv_
Vehicle dynamics model shared with all controllers in a stack.
Definition: BaseControllerInterface.h:18
Full kinematic state of the vehicle.
Definition: Types.h:63