controls  3.0.0
BuoyancyController.h
Go to the documentation of this file.
1 #ifndef CONTROLS_CONTROLLER_BUOYANCY_CONTROLLER_H
2 #define CONTROLS_CONTROLLER_BUOYANCY_CONTROLLER_H
3 
5 
26  static constexpr double MAX_DT = 0.1;
27  static constexpr double EXPLODE_THRESHOLD = 1e4;
28 
29 private:
31  double buoyancy_bias_ = 0.0;
32 
34  double saved_buoyancy_bias_ = 0.0;
35 
36 public:
38 
42  void reset() override;
43 
57  Vector6d getForce(const State& goal, const State& curr, double dt) override;
58 
62  void saveBias();
63 
67  void loadBias();
68 
72  double getBias() const;
73 };
74 
75 #endif // CONTROLS_CONTROLLER_BUOYANCY_CONTROLLER_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()=default
Controller that compensates for buoyancy and gravity restoring forces.
Definition: BuoyancyController.h:25
Vector6d getForce(const State &goal, const State &curr, double dt) override
Computes the total buoyancy compensation force.
Definition: BuoyancyController.cpp:14
double getBias() const
Returns the current adaptive bias value in Newtons.
Definition: BuoyancyController.cpp:71
void reset() override
Resets the adaptive buoyancy bias to zero.
Definition: BuoyancyController.cpp:9
void loadBias()
Restores the adaptive bias from the most recent saved snapshot.
Definition: BuoyancyController.cpp:67
void saveBias()
Saves the current adaptive bias for later restoration.
Definition: BuoyancyController.cpp:63
Full kinematic state of the vehicle.
Definition: Types.h:63