Эх сурвалжийг харах

Modify UI gps_type, add some log in driver_map_xodrload

lijinliang 3 жил өмнө
parent
commit
5c338cd5f6

+ 4 - 4
src/driver/driver_map_xodrload/main.cpp

@@ -131,7 +131,7 @@ bool LoadXODR(std::string strpath)
 
 
     Road * proad1 = mxodr.GetRoad(0);
-    givlog->info("road name is %s",proad1->GetRoadName().data());
+    givlog->info("road name is %s",proad1->GetRoadName().c_str());
     std::cout<<" road name is "<<proad1->GetRoadName()<<std::endl;
 }
 
@@ -809,9 +809,9 @@ void ListenHmi(const char * strdata,const unsigned int nSize,const unsigned int
     if(xhmimsg.has_mapname())
     {
         if(LoadXODR(xhmimsg.mapname()))
-            givlog->info("mapLoad","load map success: %s",xhmimsg.mapname());
+            givlog->info("mapLoad","load map success: %s",xhmimsg.mapname().c_str());
         else
-            givlog->error("mapLoad","load map fail: %s",xhmimsg.mapname());
+            givlog->error("mapLoad","load map fail: %s",xhmimsg.mapname().c_str());
     }
 }
 
@@ -909,7 +909,7 @@ int main(int argc, char *argv[])
     }
 
 
-    LoadXODR(strmapth);
+//    LoadXODR(strmapth);
 
     gpmap = iv::modulecomm::RegisterSend("tracemap",20000000,1);
     gpa = iv::modulecomm::RegisterRecv("xodrreq",ListenCmd);

+ 66 - 57
src/ui/ui_ads_hmi_1px/common/gps_type.h

@@ -5,58 +5,58 @@
 #ifndef _IV_COMMON_GPS_TYPE_
 #define _IV_COMMON_GPS_TYPE_
 
-#include <common/boost.h>
+#include "boost.h"
 namespace iv {
-struct GPS_INS
-{
-    int valid = 0xff;
-    int index = 0;	//gps点序号
+    struct GPS_INS
+    {
+        int valid = 0xff;
+        int index = 0;	//gps点序号
 
-    double gps_lat = 0;//纬度
-    double gps_lng = 0;//经度
+        double gps_lat = 0;//纬度
+        double gps_lng = 0;//经度
 
-    double gps_x = 0;
-    double gps_y = 0;
-    double gps_z = 0;
+        double gps_x = 0;
+        double gps_y = 0;
+        double gps_z = 0;
 
-    double ins_roll_angle = 0;	//横滚角 一般定义载体的右、前、上三个方向构成右手系,绕向前的轴旋转就是横滚角,绕向右的轴旋转就是俯仰角,绕向上的轴旋转就是航向角
-    double ins_pitch_angle = 0;	//俯仰角
-    double ins_heading_angle = 0;	//航向角
+        double ins_roll_angle = 0;	//横滚角 一般定义载体的右、前、上三个方向构成右手系,绕向前的轴旋转就是横滚角,绕向右的轴旋转就是俯仰角,绕向上的轴旋转就是航向角
+        double ins_pitch_angle = 0;	//俯仰角
+        double ins_heading_angle = 0;	//航向角
 
-    int ins_status = 0;	//惯导状态 4
-    int rtk_status = 0;	//rtk状态 6 -5 -3
-    int gps_satelites_num = 0;
+        int ins_status = 0;	//惯导状态 4
+        int rtk_status = 0;	//rtk状态 6 -5 -3
+        int gps_satelites_num = 0;
 
-    //-----加速度--------------
-    double accel_x = 0;
-    double accel_y = 0;
-    double accel_z = 0;
+        //-----加速度--------------
+        double accel_x = 0;
+        double accel_y = 0;
+        double accel_z = 0;
 
-    //-------角速度------------
-    double ang_rate_x = 0;
-    double ang_rate_y = 0;
-    double ang_rate_z = 0;
+        //-------角速度------------
+        double ang_rate_x = 0;
+        double ang_rate_y = 0;
+        double ang_rate_z = 0;
 
-    //-----------方向速度--------------
-    double vel_N = 0;
-    double vel_E = 0;
-    double vel_D = 0;
+        //-----------方向速度--------------
+        double vel_N = 0;
+        double vel_E = 0;
+        double vel_D = 0;
 
-    int speed_mode = 0;
-    int mode2 = 0;
-    double speed = 0;			//速度  若导航点则为导航预设速度  若为当前点则为当前车速
+        int speed_mode = 0;
+        int mode2 = 0;
+        double speed = 0;			//速度  若导航点则为导航预设速度  若为当前点则为当前车速
 
-    int roadMode;
-    int runMode;
-    int roadSum;
-    int roadOri;
+        int roadMode;
+        int runMode;
+        int roadSum;
+        int roadOri;
 
-    double mfLaneWidth = 3.5; // Current Lane Width
+        double mfLaneWidth = 3.5; // Current Lane Width
 
-    double mfDisToLaneLeft = 1.8; //Distance to Lane Left
-    int mnLaneChangeMark = 0; //1 to Left 0 not change   -1 to right
-    double mfDisToRoadLeft = 1.8; //Distance to Road Left
-    double mfRoadWidth = 3.5; // Road Width
+        double mfDisToLaneLeft = 1.8; //Distance to Lane Left
+        int mnLaneChangeMark = 0; //1 to Left 0 not change   -1 to right
+        double mfDisToRoadLeft = 1.8; //Distance to Road Left
+        double mfRoadWidth = 3.5; // Road Width
 
         bool mbInLaneAvoid = false; //if true suport In Lane Avoid
         double gps_lat_avoidleft;
@@ -68,30 +68,39 @@ struct GPS_INS
         double gps_x_avoidright = 0;
         double gps_y_avoidright = 0;
 
+        bool mbnoavoid = false; //If true this point is no avoid.
+        double mfCurvature = 0.0;
 
+        char mcreserved[10];
+        int mnreserved[5];
+        double mfreserved[2];
 
-};
 
-typedef boost::shared_ptr<iv::GPS_INS> GPSData;
-class Point2D
-{
-public:
-    double x = 0, y = 0, speed=0;
-    int v1 = 0, v2 = 0;
 
-    int roadMode = 0;
-    Point2D()
-    {
-        x = y = v1 = 0;
-    }
+    };
 
-    Point2D(double _x, double _y)
-    {
-        x = _x; y = _y;
-    }
+    typedef boost::shared_ptr<iv::GPS_INS> GPSData;
+    class Point2D
+   {
+     public:
+        double x = 0, y = 0, speed=0,obs_speed_x=0,obs_speed_y=0;
+        int v1 = 0, v2 = 0;
+        int roadMode = 0;
+        int obs_type=0;
+
+
+        Point2D()
+       {
+           x = y = v1 = 0;
+       }
+
+        Point2D(double _x, double _y)
+       {
+           x = _x; y = _y;
+       }
 
 
-};
+    };