Commit 25e7c674 authored by Demo User's avatar Demo User
Browse files

enc2meters

parent 2b120f53
......@@ -10,7 +10,7 @@
#include <math.h>
#define PI 3.14159265358979323846
float enc2meters = (WHEEL_DIAMETER * PI) / (GEAR_RATIO * ENCODER_RES);
//float enc2meters = (WHEEL_DIAMETER * PI) / (GEAR_RATIO * ENCODER_RES);
/*******************************************************************************
* mb_initialize_odometry()
*
......@@ -33,8 +33,9 @@ void mb_initialize_odometry(mb_odometry_t* mb_odometry, float x, float y, float
*
*******************************************************************************/
void mb_update_odometry(mb_odometry_t* mb_odometry, mb_state_t* mb_state){
// mb_odometry is the input of previous veh's position and orientation
// mb_odometry is the input of previenc2metersous veh's position and orientation
// Reference: https://www.hmc.edu/lair/ARW/ARW-Lecture01-Odometry.pdf P28
float enc2meters = (WHEEL_DIAMETER * PI) / (GEAR_RATIO * ENCODER_RES);
float del_left = mb_state->left_encoder_delta * 1.0 * enc2meters;
float del_right = mb_state->right_encoder_delta * 1.0 * enc2meters;
float del_s = (del_left + del_right) / 2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment