#ifndef _solver_mpc #define _solver_mpc #include #include "common_types.h" #include "convexMPC_interface.h" #include #include using Eigen::Matrix; using Eigen::Quaternionf; using Eigen::Quaterniond; template void print_array(T* array, u16 rows, u16 cols) { for(u16 r = 0; r < rows; r++) { for(u16 c = 0; c < cols; c++) std::cout<<(fpt)array[c+r*cols]<<" "; printf("\n"); } } template void print_named_array(const char* name, T* array, u16 rows, u16 cols) { printf("%s:\n",name); print_array(array,rows,cols); } //print named variable template void pnv(const char* name, T v) { printf("%s: ",name); std::cout< T t_min(T a, T b) { if(a T sq(T a) { return a*a; } void solve_mpc(update_data_t* update, problem_setup* setup); void quat_to_rpy(Quaternionf q, Matrix& rpy); void ct_ss_mats(Matrix I_world, fpt m, Matrix r_feet, Matrix R_yaw, Matrix& A, Matrix& B); void resize_qp_mats(s16 horizon); void c2qp(Matrix Ac, Matrix Bc,fpt dt,s16 horizon); mfp* get_q_soln(); #endif