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.
Dependencies: mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo
Fork of Orion_newPCB_test by
generalFunctions.h
00001 #ifndef generalFunctions_H 00002 #define generalFunctions_H 00003 00004 //** Math *************************************** 00005 #define M_PI ( 3.14159265358979 ) 00006 #define DEG_TO_RAD(x) ( x * 0.0174532925 ) 00007 #define RAD_TO_DEG(x) ( x * 57.295779513 ) 00008 00009 //** IMU MPU9150 ******************************** 00010 #define DRIFT_CORRECTION(x) (kp1*x*x + kp2*x + kp3)*eq_correction 00011 00012 //** Encoder ************************************ 00013 #define encoder_cpr (4 * encoder_resolution) 00014 00015 00016 //** General functions class ******************** 00017 class generalFunctions 00018 { 00019 public: 00020 static float sign_f(float in); 00021 static float abs_f(float in); 00022 static float map_f(float in, float in_min, float in_max, float out_min, float out_max); 00023 static float constrain_f(float in, float out_min, float out_max); 00024 static float moving_window(float array[], unsigned int window_size); 00025 00026 private: 00027 00028 00029 }; 00030 00031 00032 #endif
Generated on Tue Jul 12 2022 20:53:07 by
1.7.2
