#ifndef _DOG_SOLVE_H_
#define _DOG_SOLVE_H_

#include "zf_common_headfile.h"
#include "zf_common_debug.h"

#include "DOG_data.h"
#include "DOG_sensor.h"

struct DOG_SOLVE;

/*  */
typedef struct DOG_SOLVE{
	/*  */
	float diff_world_x_displacement;	// Xλ΢
	float diff_world_y_displacement;	// Yλ΢
	float diff_x_displacement;			// Xλ΢
	float diff_y_displacement;			// Yλ΢
	float diff_displacement;			// λ΢
	float diff_yaw;						// ΢
	float diff_wheel_1_displacement;	// 1λ
	float diff_wheel_2_displacement; 	// 2λ
	float diff_wheel_3_displacement; 	// 3λ
	float diff_displacement_yaw;		// λƺ΢
	/* ֵ */
	// ŷǽ
	float roll;	
	float pitch;
	float yaw;
	// ˶ѧ
	float wheel_1_speed;	
	float wheel_2_speed;
	float wheel_3_speed;
	// ˶ѧ
	float wheel_1_displacement;	// λ
	float wheel_2_displacement;	
	float wheel_3_displacement;	
	float x_speed;				// Xٶ
	float y_speed;				// Yٶ
	float angular_speed;		// תٶ
	float world_x_displacement;	// 
	float world_y_displacement;	
	float world_yaw;		
	float distance;		// ·
	float displacement;	// λ
	float displacement_yaw;	// λƺ
	/* ̲ */
	float radius;	// ĵְ뾶
	/* жʱ */
	uint16 solve_IT_time;
	/* ־λ */
	_bool_ solve_flag;	// ־λ
	_bool_ encoder_merge_enable_flag;	// ںϱʹܱ־λ
	
	/* Ա */
	void (*euler_angle)(struct DOG_SOLVE* this, struct DOG_IMU imu_data);	// ŷǽ
	void (*move_inv_solve)(struct DOG_SOLVE* this, _move_solve_kind_ kind, float data_1, float data_2, float angular_speed);	// ˶ѧ
	void (*move_solve)(struct DOG_SOLVE* this, float wheel_1_speed_real, float wheel_2_speed_real, float wheel_3_speed_real, float yaw);		// ˶ѧ
}DOG_SOLVE;

// ŷǽ
void euler_angle(struct DOG_SOLVE* this, struct DOG_IMU imu_data);
/*
	˶
	˵
	kind ˶
	data_1 ٶ/Xٶ
	data_2 /Yٶ
	angular_speed תٶ
*/ 
void move_inv_solve(struct DOG_SOLVE* this, _move_solve_kind_ kind, float data_1, float data_2, float angular_speed);		
/*
	˶
	˵
	wheel_1_speed_real 1 ʵ
	wheel_2_speed_real 2 ʵ
	wheel_3_speed_real 2 ʵ
	yaw ʵʺ
*/ 
void move_solve(struct DOG_SOLVE* this, float wheel_1_speed_real, float wheel_2_speed_real, float wheel_3_speed_real, float yaw);		

// 캯
void solve(struct DOG_SOLVE* this, float radius, uint16 solve_IT_time);
// 
void _solve(struct DOG_SOLVE* this);


#endif