#ifndef __loc_tool_hpp__ #define __loc_tool_hpp__ #include "loc_message.h" #define DWT_TIME_UNITS (1.0/499.2E6/128.0) #define SPEED_OF_LIGHT (299702547.0) struct ant; struct message_locinfo; struct loc_tool { virtual std::vector calc_location(std::vector&locm)=0; virtual int index() { return -1; } virtual ~loc_tool(){} }; struct loc_tool_tdoa_3_base:loc_tool { virtual std::vector calc_location(std::vector& locm); virtual int index(); }; struct loc_tool_tdoa_2_base:loc_tool { virtual std::vector calc_location(std::vector& locm); virtual int index(); bool is_in_triangle(const std::vector& vps, const point& p); double get_triangle_area(const point& p0, const point& p1, const point&p2); }; struct loc_tool_tdoa_1_base:loc_tool { virtual std::vector calc_location(std::vector& locm); virtual int index(); }; struct loc_tool_pdoa_1_base:loc_tool { virtual std::vector calc_location(std::vector& locm); virtual int index(); }; struct loc_tool_pdoa_2_base:loc_tool { virtual std::vector calc_location(std::vector& locm); virtual int index(); bool cal_position_pdoa(std::vector& vps, const pdoa_param& pa); }; struct loc_tool_pdoa_3_base:loc_tool { virtual std::vector calc_location(std::vector& locm); virtual int index(); }; struct loc_tool_tof_3_base:loc_tool { virtual std::vector calc_location(std::vector&locm); virtual int index(); }; struct loc_tool_tof_2_base:loc_tool { virtual std::vector calc_location(std::vector&locm); virtual int index(); }; struct loc_tool_tof_1_base:loc_tool { virtual std::vector calc_location(std::vector&locm); virtual int index(); }; struct loc_tool_main:loc_tool { static loc_tool* g_tool[9]; // 6 loc_tool_main(); ~loc_tool_main(); static void set_tool(loc_tool*tool); std::vector calc_location(std::vector&locm); }; #endif