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
odometer.h
00001 #ifndef odometer_H 00002 #define odometer_H 00003 00004 #include "mbed.h" 00005 #include "generalFunctions.h" 00006 #include "QEI.h" 00007 #include "config.h" 00008 #include "orion_pinmapping.h" 00009 00010 00011 class odometer 00012 { 00013 public: 00014 odometer(); 00015 void update(); 00016 void init(); 00017 //void getRevolutions(float *revolutions[2]); 00018 //void getRPM(float *rpm[2]); 00019 00020 float revolutions[2]; 00021 float rpm[2]; 00022 00023 private: 00024 QEI encLeft; 00025 QEI encRight; 00026 00027 Timer enc_timer; 00028 float timer_s; 00029 00030 uint16_t movWindow_len; 00031 uint16_t movWindow_index; 00032 float encRes; 00033 00034 static const unsigned int movWindow_lenMax = 64; //to prevent excessive RAM usage at program runtime 00035 00036 int32_t pulse_counter[2][2]; // [0:left / 1:right], [0:previous / 1:current] 00037 float rpmWindow_left[movWindow_lenMax]; // [movWindow_index: instantaneous velocity in rpm] 00038 float rpmWindow_right[movWindow_lenMax]; // [movWindow_index: instantaneous velocity in rpm] 00039 00040 float filtered_reading[2][2]; // [0:left / 1:right], [0:revolutions / 1:velocity in rpm] 00041 }; 00042 00043 00044 #endif
Generated on Tue Jul 12 2022 20:53:07 by
1.7.2
