123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #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<point> calc_location(std::vector<loc_message>&locm)=0;
- virtual int index()
- {
- return -1;
- }
- virtual ~loc_tool(){}
- };
- struct loc_tool_tdoa_3_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>& locm);
- virtual int index();
- };
- struct loc_tool_tdoa_2_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>& locm);
- virtual int index();
- bool is_in_triangle(const std::vector<point>& 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<point> calc_location(std::vector<loc_message>& locm);
- virtual int index();
- };
- struct loc_tool_pdoa_1_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>& locm);
- virtual int index();
- };
- struct loc_tool_pdoa_2_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>& locm);
- virtual int index();
- bool cal_position_pdoa(std::vector<pdoa_msg_ptr>& vps, const pdoa_param& pa);
- };
- struct loc_tool_pdoa_3_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>& locm);
- virtual int index();
- };
- struct loc_tool_tof_3_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>&locm);
- virtual int index();
- };
- struct loc_tool_tof_2_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>&locm);
- virtual int index();
- };
- struct loc_tool_tof_1_base:loc_tool
- {
- virtual std::vector<point> calc_location(std::vector<loc_message>&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<point> calc_location(std::vector<loc_message>&locm);
- };
- #endif
|