Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Drone_Controlador_Atitude
HorizontalController.cpp
00001 #include "mbed.h" 00002 #include "HorizontalController.h" 00003 00004 HorizontalController::HorizontalController() 00005 { 00006 phi_r = 0.0f; 00007 theta_r = 0.0f; 00008 } 00009 00010 void HorizontalController::control(float x_r, float y_r, float x, float y, float u, float v) 00011 { 00012 phi_r = control_single(y_r, y, v, y_kp, y_kd)/(-g); 00013 theta_r = control_single(x_r, x, u, x_kp, x_kd)/g; 00014 } 00015 00016 float HorizontalController::control_single(float pos_r, float pos, float vel, float kp, float kd) 00017 { 00018 return kp*(pos_r - pos) - kd*vel; 00019 }
Generated on Thu Jul 14 2022 14:38:28 by
1.7.2