#include <Operation_Layer/MCU/Vehicle_Speed.h>
#include "can.h"

#define Pi			3.141593
#define Radius  	0.270798
#define gear_ratio 	11.93

float RPM = 0; //X = Est RPM(MCU CAN DATA)
float Est_Speed_data = 0;

void Est_Vehicle_Speed()
{
	if(GV_MCU_RPM < 0)	RPM = -GV_MCU_RPM;
	else				RPM = GV_MCU_RPM;

    Est_Speed_data = 2 * Pi * Radius * (RPM / gear_ratio) * 60 / 1000;

    GV_VCU_Vx_Fbk = Est_Speed_data;
}
