merge control stack from easter testing into main#706
Conversation
…ht be a bit wonky
…ht be a bit wonky
…backstepping controller, tuned the adaptive dp backstepping controller a bit for nautilus not yet finished. Added roll back into the controllable parameters, it looks good for now.
…nu/vortex-auv into feat/solver-and-drone-sim-tests
… Vortex wiki and link it in README. Began changing variable names and adding neccesary functionality in vortex-utils
vortexuser
left a comment
There was a problem hiding this comment.
first round of reviews
…o reduce scope. Got rid of magic numbers and made everything initializable and easy to configure. Fixed readme.
…ing_controler_to_quaternion
…verythin the control stack depends on from easter testing in one commit
There was a problem hiding this comment.
is this controller going to be used? If so, maybe clean it up a bit. A lot of unused includes, outdated types/not using common types from vortex utils, redefinitions of existing utils functions
There was a problem hiding this comment.
yes pid controllah was pretty 🔥
| void print_eta(const types::Eta& eta) { | ||
| spdlog::info("Eta values:"); | ||
| auto pos = eta.pos_vector(); | ||
| auto ori = eta.ori_quaternion(); | ||
| spdlog::info("Position - North: {}, East: {}, Down: {}", pos[0], pos[1], | ||
| pos[2]); | ||
| spdlog::info("Orientation - w: {}, x: {}, y: {}, z: {}", ori.w(), ori.x(), | ||
| ori.y(), ori.z()); | ||
| } | ||
|
|
||
| void print_nu(const types::Nu& nu) { | ||
| spdlog::info("Nu values:"); | ||
| auto v = nu.to_vector(); | ||
| spdlog::info("Linear Speed - u: {}, v: {}, w: {}", v(0), v(1), v(2)); | ||
| spdlog::info("Angular Speed - p: {}, q: {}, r: {}", v(3), v(4), v(5)); | ||
| } | ||
|
|
||
| void print_vect_6d(const types::Vector6d& vec) { | ||
| spdlog::info("Vector6d values:"); | ||
| for (int i = 0; i < 6; ++i) { | ||
| spdlog::info("Element[{}]: {}", i, vec[i]); | ||
| } | ||
| } | ||
|
|
||
| void print_J_transformation(const types::J_transformation& J) { | ||
| spdlog::info("J_transformation:"); | ||
|
|
||
| spdlog::info("R (3x3) elements:"); | ||
| for (int i = 0; i < J.R.rows(); ++i) { | ||
| for (int j = 0; j < J.R.cols(); ++j) { | ||
| spdlog::info("R[{},{}] = {}", i, j, J.R(i, j)); | ||
| } | ||
| } | ||
|
|
||
| spdlog::info("T (4x3) elements:"); | ||
| for (int i = 0; i < J.T.rows(); ++i) { | ||
| for (int j = 0; j < J.T.cols(); ++j) { | ||
| spdlog::info("T[{},{}] = {}", i, j, J.T(i, j)); | ||
| } | ||
| } | ||
|
|
||
| spdlog::info("Combined Matrix (7x6) elements:"); | ||
| auto M = J.as_matrix(); | ||
| for (int i = 0; i < M.rows(); ++i) { | ||
| for (int j = 0; j < M.cols(); ++j) { | ||
| spdlog::info("M[{},{}] = {}", i, j, M(i, j)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| void print_Jinv_transformation(const types::Matrix6x7d& J_inv) { | ||
| spdlog::info("J_pseudo_inverse (6x7):"); | ||
| for (int i = 0; i < J_inv.rows(); ++i) { | ||
| std::string row; | ||
| row.reserve(128); | ||
| row += "["; | ||
| for (int j = 0; j < J_inv.cols(); ++j) { | ||
| row += std::to_string(J_inv(i, j)); | ||
| if (j < J_inv.cols() - 1) | ||
| row += ", "; | ||
| } | ||
| row += "]"; | ||
| spdlog::info("{}", row); | ||
| } | ||
| } |
There was a problem hiding this comment.
Why are these still here? We added those to debug the weird behavior last year, not to be used on main
| types::Eta error = error_eta(eta, eta_d); // calculate eta error | ||
|
|
There was a problem hiding this comment.
This comment doesnt add very much
There was a problem hiding this comment.
Goes for the rest of the comments in this file too
| types::Vector6d error_6; | ||
| error_6 << error.x, error.y, error.z, error.qx, error.qy, error.qz; |
There was a problem hiding this comment.
Minor, but having the 6 in the variable name doesnt really do any good, especially when there no longer is references to the 7 sized vector anymore. Also, would probably benefit from adding updated utility functions for the 6 dof quat maths
| std::vector<double> Kp_vec = { | ||
| this->get_parameter("Kp_x").as_double(), | ||
| this->get_parameter("Kp_y").as_double(), | ||
| this->get_parameter("Kp_z").as_double(), | ||
| this->get_parameter("Kp_roll").as_double(), | ||
| this->get_parameter("Kp_pitch").as_double(), | ||
| this->get_parameter("Kp_yaw").as_double(), | ||
| }; | ||
| std::vector<double> Ki_vec = { | ||
| this->get_parameter("Ki_x").as_double(), | ||
| this->get_parameter("Ki_y").as_double(), | ||
| this->get_parameter("Ki_z").as_double(), | ||
| this->get_parameter("Ki_roll").as_double(), | ||
| this->get_parameter("Ki_pitch").as_double(), | ||
| this->get_parameter("Ki_yaw").as_double(), | ||
| }; | ||
| std::vector<double> Kd_vec = { | ||
| this->get_parameter("Kd_x").as_double(), | ||
| this->get_parameter("Kd_y").as_double(), | ||
| this->get_parameter("Kd_z").as_double(), | ||
| this->get_parameter("Kd_roll").as_double(), | ||
| this->get_parameter("Kd_pitch").as_double(), | ||
| this->get_parameter("Kd_yaw").as_double(), | ||
| }; | ||
|
|
||
| types::Vector6d Kp_vec_eigen(Kp_vec.data()); | ||
| types::Vector6d Ki_vec_eigen(Ki_vec.data()); | ||
| types::Vector6d Kd_vec_eigen(Kd_vec.data()); |
There was a problem hiding this comment.
No reason to go through std::vector here is it?
There was a problem hiding this comment.
Have not loooked at it probably you are right
There was a problem hiding this comment.
Why are there 3 param files?
There was a problem hiding this comment.
because i need to test that everything works, will change the workflows to use the sim file in the sim tests when my claude usage is back (i dont do devops dont blame me)
| types::Eta error_eta(const types::Eta& eta, const types::Eta& eta_d) { | ||
| types::Eta eta_error; | ||
|
|
||
| eta_error.pos = eta.pos - eta_d.pos; | ||
| eta_error.ori = eta_d.ori.conjugate() * eta.ori; | ||
|
|
||
| eta_error.ori = eta_error.ori.normalized(); | ||
|
|
||
| return eta_error; | ||
| types::Eta error = eta - eta_d; | ||
| // Enforce shortest path: q and -q represent the same rotation, but only | ||
| // qw >= 0 gives the correct sign for the vector part used as error signal. | ||
| if (error.qw < 0.0) { | ||
| error.qw = -error.qw; | ||
| error.qx = -error.qx; | ||
| error.qy = -error.qy; | ||
| error.qz = -error.qz; | ||
| } | ||
| return error; | ||
| } |
There was a problem hiding this comment.
If we want this to return the 6d error vector we should use the error_quaternion from vortex_utils math.hpp.
There was a problem hiding this comment.
yes, i think i added that after doing this fix during easter
There was a problem hiding this comment.
Should avoid the RPY representation of pose/current_state so the reference mode does not inherit gimbal lock problems etc..
…ushed vortex utils since im not a tyrant
|
Good soup |
|
🎉 This PR is included in version 2.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |

implemented quat adaptive backstepping dp
modified quat pid dp
modified joystick interface
modified reference filter quat