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 
16  static constexpr double MAX_DT = 0.1;
17  static constexpr double EXPLODE_THRESHOLD = 1e4;
18 
20  static constexpr double MAX_CG_CB_OFFSET = 0.01;
21 
22 private:
24  Vector6d buoyancy_bias_ = Vector6d::Zero();
25 
27  bool is_stationkeeping_ = false;
28 
46  static bool adapt_axis(double& bias, double error_sig, double rate, double adapt_rate, double pos_thresh,
47  double vel_thresh, double clamp, double dt);
48 
49 public:
51 
55  void reset() override;
56 
60  void set_stationkeeping(bool stationkeeping);
61 
71  Vector6d get_force(const State& goal, const State& curr, double dt) override;
72 };
73 
74 #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
Buoyancy/gravity restoring compensation with optional adaptive bias.
Definition: BuoyancyController.h:15
Vector6d get_force(const State &goal, const State &curr, double dt) override
Computes the buoyancy compensation wrench.
Definition: BuoyancyController.cpp:34
void set_stationkeeping(bool stationkeeping)
Sets whether the vehicle is stationkeeping (gates adaptation on/off)
Definition: BuoyancyController.cpp:14
void reset() override
Resets the adaptive buoyancy bias to zero.
Definition: BuoyancyController.cpp:9
Full kinematic state of the vehicle.
Definition: Types.h:63