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

change tool_xodrobj, fix some warnings.

yuchuli 1 жил өмнө
parent
commit
8d4abcedf8

+ 1 - 0
src/common/common/xodr/OpenDrive/Lane.cpp

@@ -1576,6 +1576,7 @@ void LaneRoadMark::SetLaneRoadMarkType(LaneRoadMarkType  laneRoadMarkType)
 {
 //    ResetLaneRoadMarkType();
     std::vector<LaneRoadMarkType> * px = &mvectorLaneRoadMarkType;
+    (void)px;
     mvectorLaneRoadMarkType.push_back(laneRoadMarkType);
 }
 void LaneRoadMark::ResetLaneRoadMarkType()

+ 1 - 0
src/common/common/xodr/OpenDrive/ObjectSignal.cpp

@@ -1653,6 +1653,7 @@ const Object_parkingSpace& Object_parkingSpace::operator=(const Object_parkingSp
         mrestrictions = rhs.mrestrictions;
         maccess = rhs.maccess;
     }
+    return *this;
 }
 
 Object::Object(std::string id, double s, double t, double zOffset)

+ 2 - 0
src/common/common/xodr/OpenDrive/OpenDrive.cpp

@@ -386,6 +386,8 @@ const Header& Header::operator=(const Header& rhs)
     mHdg0=rhs.mHdg0;
     mgeoReference = rhs.mgeoReference;
     muserData = rhs.muserData;
+
+    return *this;
 }
 
 Header::Header(unsigned short int revMajor, unsigned short int revMinor, string name, float version, string date,

+ 18 - 10
src/common/common/xodr/OpenDrive/OpenDriveXmlParser.cpp

@@ -77,7 +77,7 @@ bool OpenDriveXmlParser::ReadHeader(TiXmlElement *node)
 	unsigned short int revMajor;
 	unsigned short int revMinor;
 	string name;
-	float version;
+    float version = 1.6f;
 	string date;
 	double north;
 	double south;
@@ -118,6 +118,7 @@ bool OpenDriveXmlParser::ReadHeader(TiXmlElement *node)
         lat0 = 39.0;
     }
     checker+=node->QueryDoubleAttribute("hdg0",&hdg0);
+    (void)checker;
 
     TiXmlElement *nodegeo=node->FirstChildElement("geoReference");
     if(nodegeo != NULL)
@@ -904,17 +905,17 @@ bool OpenDriveXmlParser::ReadLaneSections (Road* road, TiXmlElement *node)
 
 
 	//OutputDebugString( "\n") ;
-	for (unsigned int i=0;i<laneSection->GetLaneVector()->size();i++)
-	{
-		int id = static_cast<Lane>(laneSection->GetLaneVector()->at(i)).GetId();
+//	for (unsigned int i=0;i<laneSection->GetLaneVector()->size();i++)
+//	{
+//		int id = static_cast<Lane>(laneSection->GetLaneVector()->at(i)).GetId();
 
-		/*char* buf;
-		buf=new char[5];
-		itoa(id,buf,10);
+//		/*char* buf;
+//		buf=new char[5];
+//		itoa(id,buf,10);
 
-		OutputDebugString( buf ) ;
-		OutputDebugString( " ") ;*/
-	}
+//		OutputDebugString( buf ) ;
+//		OutputDebugString( " ") ;*/
+//	}
 	//OutputDebugString( "\n") ;
 
 
@@ -1418,6 +1419,8 @@ bool OpenDriveXmlParser::ReadObjectMaterial(Object *pObject, TiXmlElement *node)
         pObject_material->Setroughness(roughness);
     }
 
+    return true;
+
 }
 //--------------
 bool OpenDriveXmlParser::ReadObjectRepeat(Object *pObject, TiXmlElement *node)
@@ -1541,6 +1544,8 @@ bool OpenDriveXmlParser::ReadObjectMarkings(Object *pObject, TiXmlElement *node)
     }
 
     pObject->Setmarkings(xObject_Markings);
+
+    return true;
 }
 
 //--------------
@@ -1658,6 +1663,8 @@ bool OpenDriveXmlParser::ReadObjectBorders(Object * pObject,TiXmlElement * node)
     }
 
     pObject->Setborders(xObject_Border);
+
+    return true;
 }
 
 //--------------
@@ -3812,6 +3819,7 @@ bool OpenDriveXmlParser::ReadFile(std::string fileName)
 		TiXmlElement *rootNode=doc.FirstChildElement();
 		//read header
 		int checker=TIXML_SUCCESS;
+        (void)checker;
 		TiXmlElement *node=rootNode->FirstChildElement("header");
 		ReadHeader(node);
 

+ 5 - 1
src/common/common/xodr/OpenDrive/OpenDriveXmlWriter.cpp

@@ -745,6 +745,7 @@ bool OpenDriveXmlWriter::WriteLaneSections (TiXmlElement *node, LaneSection *lan
 
 	//Fill in lane section
 	short int curType=1;
+    (void)curType;
 	TiXmlElement* nodeLanesLeft=NULL;
 	if(laneSection->GetLeftLaneCount()>0)
 	{
@@ -789,6 +790,7 @@ bool OpenDriveXmlWriter::WriteLaneSections (TiXmlElement *node, LaneSection *lan
 bool OpenDriveXmlWriter::WriteLaneOffset(TiXmlElement *node, LaneOffset *laneOffset)
 {
     double s;
+    (void)s;
     s=laneOffset->GetS();
 
     TiXmlElement* nodeLaneSection = new TiXmlElement("laneOffset");
@@ -1724,7 +1726,7 @@ bool OpenDriveXmlWriter::WriteObjectMarkings(TiXmlElement *node, Object_markings
         std::cout<<"Makrings must have at least 1 marking"<<std::endl;
         return false;
     }
-    unsigned int i;
+    int i;
     for(i=0;i<lmarkingcount;i++)
     {
         WriteObjectMarkingsMarking(nodeObjectMakrings,pObject_markings->GetMarking(i));
@@ -2038,6 +2040,8 @@ bool OpenDriveXmlWriter::WriteSignalReference(TiXmlElement * node, signals_signa
         WriteSignal_laneValidity(nodeSignalReference,pSignalReference->GetlaneValidity(i));
     }
 
+    return true;
+
 }
 
 //--------------

+ 4 - 4
src/common/common/xodr/OpenDrive/Road.cpp

@@ -1995,7 +1995,7 @@ int Road::GetLeftDrivingLaneCount(double s_check)
 
     if(pLS == NULL)return -1;
 
-    int nrtn;
+    int nrtn = 0;
 
     unsigned int nlanecount = pLS->GetLeftLaneCount();
     for(i=0;i<nlanecount;i++)
@@ -2037,7 +2037,7 @@ int Road::GetRightDrivingLaneCount(double s_check)
 
     if(pLS == NULL)return -1;
 
-    int nrtn;
+    int nrtn = 0;
 
     unsigned int nlanecount = pLS->GetRightLaneCount();
     for(i=0;i<nlanecount;i++)
@@ -2381,8 +2381,8 @@ double Road::GetDis(const double x,const double y, const double hdg, double & fR
     if(fdismin < 100.0)
     {
         double fOffset = GetLaneOffsetValue(s);
-        double realx,realy,realhdg;
-        realhdg = refhdg;
+        double realx,realy;//realhdg;
+//        realhdg = refhdg;
         if(fabs(fOffset)<0.00001)
         {
             realx = refx;

+ 13 - 3
src/common/common/xodr/OpenDrive/RoadGeometry.cpp

@@ -184,10 +184,18 @@ void  RoadGeometry::GetCoords(double s_check, double &retX, double &retY)
 	GetCoords(s_check, retX, retY, tmp);
 }
 void RoadGeometry::GetCoords(double s_check, double &retX, double &retY, double &retHDG)
-{}
+{
+    (void)s_check;
+    (void)retX;
+    (void)retY;
+    (void)retHDG;
+}
 
 double RoadGeometry::GetRoadCurvature(double s_check)
-{return 0.0;}
+{
+    (void)s_check;
+    return 0.0;
+}
 
 
 
@@ -239,6 +247,7 @@ void GeometryLine::GetCoords(double s_check, double &retX, double &retY, double
 
 double GeometryLine::GetRoadCurvature(double s_check)
 {
+    (void)s_check;
     return 0.0;
 }
 
@@ -742,7 +751,7 @@ void GeometryPoly3::UpdateSamplePoint()
     {
         while(xvectorgeosample[ipos2].s<=s)
         {
-            if(ipos2 == (xvectorgeosample.size()-1))
+            if(ipos2 == static_cast<int>( (xvectorgeosample.size()-1)) )
             {
                 ipos1 = ipos2;
                 break;
@@ -801,6 +810,7 @@ void GeometryPoly3::UpdateSamplePoint()
 
 
     vector<geosamplepoint> * pxvectorgeosample = &mvectorgeosample;
+    (void)pxvectorgeosample;
     mbHaveSample = true;
 
 }

+ 3 - 0
src/common/common/xodr/OpenDrive/RoadGeometry.h

@@ -51,6 +51,8 @@ public:
 	 * Constructor that initializes the base properties of teh record
 	 */
 	RoadGeometry(double s, double x, double y, double hdg, double length);
+
+    virtual ~RoadGeometry() {};
 	
 	/**
 	 * Clones and returns the new geometry record
@@ -121,6 +123,7 @@ public:
 	 * Constructor that initializes the base properties of the record
 	 */
 	GeometryLine (double s, double x, double y, double hdg, double length);
+    virtual ~GeometryLine()  {};
 
 	/**
 	 * Clones and returns the new geometry record

+ 4 - 4
src/tool/tool_xodrobj/gnss_coordinate_convert.cpp

@@ -16,7 +16,7 @@ void gps2xy(double J4, double K4, double *x, double *y)
     double R4 = sqrt(0.006738525414683) * O4;
     double S4 = sqrt(1 + R4 * R4);
     double T4 = 6399698.901783 / S4;
-    double U4 = (T4 / S4) / S4;
+//    double U4 = (T4 / S4) / S4;
     double V4 = O4 * M4 * 3.1415926536 / 180;
     double W4 = 0.5 + (5 - P4 * P4 + 9 * R4 * R4 + 4 * R4 * R4 * R4 * R4) * V4 * V4 / 24;
     double X4 = V4 * V4 * V4 * V4 / 720 * (61 + (P4 * P4 - 58) * P4 * P4);
@@ -44,7 +44,7 @@ void GaussProjCal(double longitude, double latitude, double *X, double *Y)
     }
 #else
     int ProjNo = 0; int ZoneWide; ////带宽
-    double longitude1, latitude1, longitude0, latitude0, X0, Y0, xval, yval;
+    double longitude1, latitude1, longitude0, X0, Y0, xval, yval; // latitude0
     double a, f, e2, ee, NN, T, C, A, M, iPI;
     iPI = 0.0174532925199433; ////3.1415926535898/180.0;
     ZoneWide = 6; ////6度带宽
@@ -53,7 +53,7 @@ void GaussProjCal(double longitude, double latitude, double *X, double *Y)
     ProjNo = (int)(longitude / ZoneWide);
     longitude0 = ProjNo * ZoneWide + ZoneWide / 2;
     longitude0 = longitude0 * iPI;
-    latitude0 = 0;
+ //   latitude0 = 0;
     longitude1 = longitude * iPI; //经度转换为弧度
     latitude1 = latitude * iPI; //纬度转换为弧度
     e2 = 2 * f - f * f;
@@ -148,7 +148,7 @@ void GaussProjInvCal(double X, double Y, double *longitude, double *latitude)
 #else
 
     int ProjNo; int ZoneWide; ////带宽
-    double longitude1, latitude1, longitude0, latitude0, X0, Y0, xval, yval;
+    double longitude1, latitude1, longitude0, X0, Y0, xval, yval; //latitude0
     double e1, e2, f, a, ee, NN, T, C, M, D, R, u, fai, iPI;
     iPI = 0.0174532925199433; ////3.1415926535898/180.0;
     a = 6378245.0; f = 1.0 / 298.3; //54年北京坐标系参数

+ 35 - 8
src/tool/tool_xodrobj/mainwindow.cpp

@@ -84,7 +84,7 @@ static int getmnfac(OpenDrive & mxodr,double & fmovex,double & fmovey)
     fymin = std::numeric_limits<double>::max() *(1.0);
     fymax = std::numeric_limits<double>::max()*(-1.0);
     bool bHaveRealRoad = false;
-    for(i=0;i<mxodr.GetRoadCount();i++)
+    for(i=0;i<static_cast<int>( mxodr.GetRoadCount());i++)
     {
         int j;
 
@@ -94,7 +94,7 @@ static int getmnfac(OpenDrive & mxodr,double & fmovex,double & fmovey)
             continue;
         }
         bHaveRealRoad = true;
-        for(j=0;j<mxodr.GetRoad(i)->GetGeometryBlockCount();j++)
+        for(j=0; j<static_cast<int>(mxodr.GetRoad(i)->GetGeometryBlockCount());j++)
         {
             GeometryBlock * pgeob = pRoad->GetGeometryBlock(j);
             double x,y;
@@ -193,6 +193,8 @@ MainWindow::MainWindow(QWidget *parent) :
 
 
     double fmovex,fmovey;
+    fmovex = 0;
+    fmovey = 0;
     mnfac = getmnfac(mxodr,fmovex,fmovey);
 
     mfViewMoveX = mfViewMoveX - fmovex;
@@ -283,6 +285,7 @@ MainWindow::~MainWindow()
 
 void MainWindow::resizeEvent(QResizeEvent *event)
 {
+    (void)event;
     qDebug("resize");
     QSize sizemain = ui->centralWidget->size();
     qDebug("size x = %d y=%d",sizemain.width(),sizemain.height());
@@ -301,10 +304,10 @@ void MainWindow::AdjustWPos(QSize sizemain)
 
 void MainWindow::ExecPainter()
 {
-    
-    
-    
+
     QTime x;
+
+
     x.start();
     //    qDebug("painter.");
     
@@ -331,11 +334,12 @@ void MainWindow::ExecPainter()
     
     painter->setPen(Qt::blue);
     int nfac = mnfac;
-    for(i=0;i<mxodr.GetRoadCount();i++)
+    (void)nfac;
+    for(i=0;i<static_cast<int>( mxodr.GetRoadCount());i++)
     {
         int j;
         Road * pRoad = mxodr.GetRoad(i);
-        for(j=0;j<mxodr.GetRoad(i)->GetGeometryBlockCount();j++)
+        for(j=0;j<static_cast<int>( mxodr.GetRoad(i)->GetGeometryBlockCount());j++)
         {
             GeometryBlock * pgeob = pRoad->GetGeometryBlock(j);
             double x,y;
@@ -367,10 +371,15 @@ void MainWindow::ExecPainter()
                 double sstep = pSpiral->GetLength()/((double)ncount);
                 int k;
                 double x0,y0,hdg0,s0;
+                (void)x0;
+                (void)y0;
+                (void)hdg0;
+                (void)s0;
                 x0 = pSpiral->GetX();
                 y0 = pSpiral->GetY();
                 s0 = pSpiral->GetS();
                 hdg0 = pSpiral->GetHdg() ;
+                (void)x0; (void)y0; (void)hdg0;
                 painter->setPen(Qt::red);
                 for(k=0;k<ncount;k++)
                 {
@@ -409,6 +418,7 @@ void MainWindow::ExecPainter()
                 double hdgstep;
                 double hdg0 = parc->GetHdg();
                 double hdgnow = parc->GetHdg();
+                (void)hdgnow;
                 if(ncount > 0) hdgstep= (parc->GetLength()/R)/ncount;
                 for(k=0;k<ncount;k++)
                 {
@@ -443,17 +453,23 @@ void MainWindow::ExecPainter()
                 B = ppoly->GetB();
                 C = ppoly->GetC();
                 D = ppoly->GetD();
+                (void)A;(void)B;(void)C;(void)D;
                 const double steplim = 0.1;
                 double du = steplim;
                 double u = 0;
                 double v = 0;
                 double oldx,oldy;
+                (void)du;(void)u;(void)v;(void)oldx;(void)oldy;
                 oldx = x;
                 oldy = y;
+                (void)oldx; (void)oldy;
                 double xstart,ystart;
+                (void)xstart;(void)ystart;
                 xstart = x;
                 ystart = y;
+                (void)xstart; (void)ystart;
                 double hdgstart = ppoly->GetHdg();
+                (void)hdgstart;
                 double flen = 0;
                 while(flen < ppoly->GetLength())
                 {
@@ -662,6 +678,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     int nYPos = 30;
 
     int i;
+    (void)i;
 
     int nSpace = mnFontHeight * 65/10;
     int nLEWidth = mnFontHeight * 6;
@@ -681,6 +698,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLabel->setText("Head0");
     pLabel->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     nXPos = nXPos + nSpace;
+    (void )nXPos;
 
     nXPos = 10;
     nYPos = nYPos + mnFontHeight * 2;
@@ -702,6 +720,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLE->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     mpLEHead0 = pLE;
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
     nXPos = 10;
     nYPos = nYPos + mnFontHeight * 4;
@@ -817,6 +836,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLabel->setText("SelLat");
     pLabel->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
     nXPos = 10;
     nYPos = nYPos + mnFontHeight * 2;
@@ -832,6 +852,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLE->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     mpLE_SelY = pLE;
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
 
 
@@ -882,11 +903,13 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLabel->setText("Cur Lat");
     pLabel->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
     pLabel = new QLabel(pGroup);
     pLabel->setText("Cur Heading");
     pLabel->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
     nXPos = 10;
     nYPos = nYPos + mnFontHeight * 2;
@@ -908,6 +931,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLE->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     mpLE_CurHeading = pLE;
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
 
     nXPos = 10;
@@ -922,6 +946,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLabel->setText("Dst Lat");
     pLabel->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
 
     nXPos = 10;
@@ -938,6 +963,7 @@ void MainWindow::CreateTab1View(QTabWidget * p)
     pLE->setGeometry(nXPos,nYPos,nLEWidth,nLEHeight);
     mpLE_DstLat = pLE;
     nXPos = nXPos + nSpace;
+    (void)nXPos;
 
     nXPos = 10;
     nYPos = nYPos + mnFontHeight * 2;
@@ -1483,6 +1509,7 @@ void MainWindow::onClickSetStart()
  */
 void MainWindow::UpdateMap(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
 {
+    (void)index; (void)dt; (void)strmemname;
 
     //    std::cout<<"update map "<<std::endl;
     int gpsunitsize = sizeof(iv::GPS_INS);
@@ -1523,7 +1550,7 @@ void MainWindow::UpdateMap(const char * strdata,const unsigned int nSize,const u
 
 void MainWindow::UpdateGPSIMU(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
 {
-
+    (void)index; (void)dt; (void)strmemname;
     static int64_t nlastfusionupdate = 0;// std::chrono::system_clock::now().time_since_epoch().count()/1000000 ;
     iv::gps::gpsimu  xgpsimu;
     if(!xgpsimu.ParseFromArray(strdata,nSize))

+ 3 - 1
src/tool/tool_xodrobj/myview.cpp

@@ -2,7 +2,7 @@
 #include <QScrollBar>
 #include <iostream>
 #define VIEW_CENTER viewport()->rect().center()
-const double PI = 3.1415926535898;
+//const double PI = 3.1415926535898;
 
 MyView::MyView(QWidget *parent) :
      QGraphicsView(parent),
@@ -85,6 +85,8 @@ void MyView::zoomOut()
 {
 
     int width,hgt;
+    (void)width;
+    (void)hgt;
     width = sceneRect().width();
     hgt = sceneRect().height();
     QScrollBar * psV = verticalScrollBar();

+ 4 - 3
src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

@@ -390,6 +390,7 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
     ModuleFun funbrainrunstate =std::bind(&ADCIntelligentVehicle::UpdateBrainRunState,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
    // mpaVechicleState = iv::modulecomm::RegisterRecvPlus("vehiclestate",funbrainstate);
     void * parun = iv::modulecomm::RegisterRecvPlus("brainrunstate",funbrainrunstate);
+    (void)parun;
 
     ModuleFun fundecition =std::bind(&ADCIntelligentVehicle::UpdateDecition,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
 
@@ -615,7 +616,7 @@ void ADCIntelligentVehicle::timeoutslot()
     is_ok = (ServiceCarStatus.mLidarS>0)?QStringLiteral("ok"):QStringLiteral("error");
     ui->lineEdit_4->setText(is_ok);//激光雷达状态
    // ui->lineEdit_16->setText(is_ok);//激光雷达状态
-    int nOldLidarState = 0;
+    static int nOldLidarState = 0;
     if(ServiceCarStatus.mLidarS>0)
     {
         if(nOldLidarState != 1)
@@ -638,7 +639,7 @@ void ADCIntelligentVehicle::timeoutslot()
     }
     //------------------YOLO----------------------------
     is_ok = (ServiceCarStatus.mYoloS>0)?QStringLiteral("ok"):QStringLiteral("error");
-    int nOldYoloState = 0;
+    static int nOldYoloState = 0;
     if(ServiceCarStatus.mYoloS>0)
     {
         if(nOldYoloState != 1)
@@ -657,7 +658,7 @@ void ADCIntelligentVehicle::timeoutslot()
         }
     }
     //-------------------------------------------------
-    int nMState = 0;
+    static int nMState = 0;
     if(mimobileyeState>0)
     {
         if(nMState != 1)