Skip to content

Commit

Permalink
ControlManager: fixed disturbance initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Apr 10, 2024
1 parent 6038065 commit adb758f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/control_manager/control_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8732,15 +8732,23 @@ void ControlManager::initializeControlOutput(void) {

Controller::ControlOutput controller_output;

controller_output.diagnostics.total_mass = _uav_mass_;
controller_output.diagnostics.mass_difference = 0.0;
controller_output.diagnostics.total_mass = _uav_mass_;
controller_output.diagnostics.mass_difference = 0.0;

controller_output.diagnostics.disturbance_bx_b = _initial_body_disturbance_x_;
controller_output.diagnostics.disturbance_by_b = _initial_body_disturbance_y_;

if (std::abs(_initial_body_disturbance_x_) > 0.001 || std::abs(_initial_body_disturbance_y_) > 0.001) {
controller_output.diagnostics.disturbance_estimator = true;
}

controller_output.diagnostics.disturbance_wx_w = 0.0;
controller_output.diagnostics.disturbance_wy_w = 0.0;

controller_output.diagnostics.disturbance_bx_w = 0.0;
controller_output.diagnostics.disturbance_by_w = 0.0;
controller_output.diagnostics.controller = "none";

controller_output.diagnostics.controller = "none";

mrs_lib::set_mutexed(mutex_last_control_output_, controller_output, last_control_output_);
}
Expand Down

0 comments on commit adb758f

Please sign in to comment.