Przeglądaj źródła

change tool/map_lanetoxodr. add DialogParkingSpaceFromRTK, but not complete.

yuchuli 3 lat temu
rodzic
commit
f7501cafed

+ 0 - 1
src/common/modulecomm/modulecomm.h

@@ -13,7 +13,6 @@
 #endif
 
 
-
 //#include <iostream>
 //#include <thread>
 

+ 3 - 0
src/common/modulecomm/modulecomm.pro

@@ -11,6 +11,7 @@ QT       += dbus
 
 #DEFINES += USELCM
 
+
 DEFINES += USEDBUS
 
 TARGET = modulecomm
@@ -36,6 +37,8 @@ unix {
     INSTALLS += target
 }
 
+
+
 #INCLUDEPATH += $$PWD/../../../include/
 LIBS += -L$$PWD
 

+ 73 - 0
src/common/modulecomm_pb/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 16 - 0
src/common/modulecomm_pb/modulecomm_pb.cpp

@@ -0,0 +1,16 @@
+#include "modulecomm_pb.h"
+
+namespace iv {
+namespace modulecomm {
+void *  RegisterRecvPB(const char * strcommname,ModulePBFun xFun)
+{
+    return NULL;
+}
+
+void  ModuleSendMsgPB(void * pHandle,const google::protobuf::Message * pmessage)
+{
+
+}
+
+}
+}

+ 27 - 0
src/common/modulecomm_pb/modulecomm_pb.h

@@ -0,0 +1,27 @@
+#ifndef MODULECOMM_PB_H
+#define MODULECOMM_PB_H
+
+#include <QtCore/qglobal.h>
+#include <functional>
+
+#include "google/protobuf/io/zero_copy_stream_impl.h"
+#include "google/protobuf/text_format.h"
+
+#if defined(MODULECOMM_PB_LIBRARY)
+#  define MODULECOMM_PB_EXPORT Q_DECL_EXPORT
+#else
+#  define MODULECOMM_PB_EXPORT Q_DECL_IMPORT
+#endif
+
+typedef std::function<void(google::protobuf::Message * pmessage)> ModulePBFun;
+
+
+namespace iv {
+namespace modulecomm {
+void * MODULECOMM_PB_EXPORT RegisterRecvPB(const char * strcommname,ModulePBFun xFun);
+void MODULECOMM_PB_EXPORT ModuleSendMsgPB(void * pHandle,const google::protobuf::Message * pmessage);
+}
+}
+
+
+#endif // MODULECOMM_PB_H

+ 31 - 0
src/common/modulecomm_pb/modulecomm_pb.pro

@@ -0,0 +1,31 @@
+QT -= gui
+
+TEMPLATE = lib
+DEFINES += MODULECOMM_PB_LIBRARY
+
+CONFIG += c++11
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    modulecomm_pb.cpp
+
+HEADERS += \
+    modulecomm_pb.h
+
+# Default rules for deployment.
+unix {
+    target.path = /usr/lib
+}
+!isEmpty(target.path): INSTALLS += target
+
+LIBS += -lprotobuf

+ 22 - 1
src/controller/adcapollompc/adcapollompc.pro

@@ -105,6 +105,7 @@ SOURCES += \
         ../../../thirdpartylib/apollo/modules/planning/proto/task_config.pb.cc \
         ../../../thirdpartylib/apollo/modules/routing/proto/routing.pb.cc \
         adc_mpc_controller.cc \
+        adcapollompc_impl.cpp \
         main.cpp
 
 # Default rules for deployment.
@@ -123,9 +124,29 @@ HEADERS += \
     ../../../thirdpartylib/apollo/modules/common/proto/vehicle_signal.pb.h \
     ../../../thirdpartylib/apollo/modules/control/controller/mpc_controller.h \
     ../../../thirdpartylib/apollo/modules/map/proto/map_rsu.pb.h \
-    ../../../thirdpartylib/apollo/modules/planning/proto/planning.pb.h
+    ../../../thirdpartylib/apollo/modules/planning/proto/planning.pb.h \
+    adcapollompc_impl.h
 
 
+
+INCLUDEPATH += $$PWD/../common
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+!include(../../../include/ivprotobuf.pri ) {
+    error( "Couldn't find the ivprotobuf.pri file!" )
+}
+
+!include(../../../include/ivboost.pri ) {
+    error( "Couldn't find the ivboost.pri file!" )
+}
+
+!include(../../../include/iveigen.pri ) {
+    error( "Couldn't find the iveigen.pri file!" )
+}
+
 INCLUDEPATH += /usr/include/eigen3
 INCLUDEPATH += $$PWD/../../../thirdpartylib/apollo
 

+ 18 - 0
src/controller/adcapollompc/adcapollompc_impl.cpp

@@ -0,0 +1,18 @@
+#include "adcapollompc_impl.h"
+
+adcapollompc_impl::adcapollompc_impl(std::string strconfpath)
+{
+    FLAGS_enable_map_reference_unify = false;
+    FLAGS_vehicle_config_path  = "/home/yuchuli/qt/modularization/thirdpartylib/apollo/modules/common/data/vehicle_param.pb.txt";
+
+    auto injector = std::make_shared<apollo::control::DependencyInjector>();
+    mvehicle_state = injector->vehicle_state();
+
+    apollo::control::ControlConf  xConf;
+
+
+    ACHECK(apollo::cyber::common::GetProtoFromFile(strconfpath, &xConf))
+        << "Failed to open file " << strconfpath;
+
+    mMPCController.Init(injector,&xConf);
+}

+ 30 - 0
src/controller/adcapollompc/adcapollompc_impl.h

@@ -0,0 +1,30 @@
+#ifndef ADCAPOLLOMPC_IMPL_H
+#define ADCAPOLLOMPC_IMPL_H
+
+#include "modules/control/controller/mpc_controller.h"
+
+#include "cyber/common/file.h"
+#include "cyber/common/log.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include "cyber/time/clock.h"
+#include "modules/common/vehicle_state/vehicle_state_provider.h"
+#include "modules/control/common/control_gflags.h"
+#include "modules/control/proto/control_conf.pb.h"
+#include "modules/localization/common/localization_gflags.h"
+#include "modules/planning/proto/planning.pb.h"
+
+#include "modules/common/configs/config_gflags.h"
+
+class adcapollompc_impl
+{
+public:
+    adcapollompc_impl(std::string strconfpath);
+
+private:
+    apollo::common::VehicleStateProvider * mvehicle_state;
+    apollo::control::MPCController mMPCController;
+};
+
+#endif // ADCAPOLLOMPC_IMPL_H

+ 8 - 2
src/controller/adcapollompc/main.cpp

@@ -194,13 +194,19 @@ void mpctest()
 
 
 }
+
+#include "adcapollompc_impl.h"
+
 int main(int argc, char *argv[])
 {
     QCoreApplication a(argc, argv);
 
-    testing::InitGoogleTest(&argc,argv);
+    adcapollompc_impl * pmpc;
+    pmpc = new adcapollompc_impl("/home/yuchuli/qt/modularization/thirdpartylib/apollo/modules/control/testdata/mpc_controller_test/control_conf.pb.txt");
+
+//    testing::InitGoogleTest(&argc,argv);
 
-    mpctest();
+//    mpctest();
 
 //    RUN_ALL_TESTS();
 

+ 148 - 0
src/tool/map_lanetoxodr/dialogparkingspacefromrtk.cpp

@@ -0,0 +1,148 @@
+#include "dialogparkingspacefromrtk.h"
+#include "ui_dialogparkingspacefromrtk.h"
+
+#include "xodrfunc.h"
+
+#include "mainwindow.h"
+
+extern MainWindow * gw;
+
+extern double glon0 ;
+extern double glat0;
+
+
+DialogParkingSpaceFromRTK::DialogParkingSpaceFromRTK(Road * pRoad,QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::DialogParkingSpaceFromRTK)
+{
+    ui->setupUi(this);
+
+    mpRoad = pRoad;
+
+    mLat0 = glat0;
+    mLon0 = glon0;
+
+    setWindowTitle("ParkingSpace From RTK");
+}
+
+DialogParkingSpaceFromRTK::~DialogParkingSpaceFromRTK()
+{
+    delete ui;
+}
+
+void DialogParkingSpaceFromRTK::on_pushButton_LoadData_clicked()
+{
+    QString strfilepath = QFileDialog::getOpenFileName(this,tr("Open RTK Data"),"",tr("RTK File(*.csv)"));
+    if(strfilepath.isEmpty())return;
+
+    QFile xFile;
+    xFile.setFileName(strfilepath);
+
+    std::vector<iv::rtkdata> xvectorrtkdata;
+    xvectorrtkdata.clear();
+
+    ui->plainTextEdit->clear();
+
+    if(xFile.open(QIODevice::ReadWrite))
+    {
+        QByteArray ba;
+        ba = xFile.read(xFile.size());
+        QList<QByteArray> strlinedata=  ba.split('\n');
+        int i;
+        int nsize = strlinedata.size();
+        const int nstartline = 1;
+        for(i=nstartline;i<nsize;i++)
+        {
+            double flat,flon,fheight,frelx,frely;
+            QList<QByteArray> strlistvalue = strlinedata.at(i).split(',');
+            int ncount = strlistvalue.size();
+            if(ncount>=4)
+            {
+                flon  = atof(strlistvalue.at(2).data());
+                flat = atof(strlistvalue.at(1).data());
+                QString strheight = strlistvalue.at(3);
+                strheight = strheight.left(strheight.size() -2);
+                fheight = strheight.toDouble();
+
+                DialogAddRoadFromRTK::calcrelxy(mLon0,mLat0,flon,flat,frelx,frely);
+
+                iv::rtkdata xdata;
+                xdata.mflat = flat;
+                xdata.mflon = flon;
+                xdata.mfrelx = frelx;
+                xdata.mfrely = frely;
+                xdata.mheight = fheight;
+                if(xvectorrtkdata.size() < 1)
+                {
+                    xdata.mfrels = 0;
+                }
+                else
+                {
+                    xdata.mfrels = xvectorrtkdata[xvectorrtkdata.size()-1].mfrels
+                            +sqrt(pow(xvectorrtkdata[xvectorrtkdata.size()-1].mfrelx - frelx,2)+pow(xvectorrtkdata[xvectorrtkdata.size()-1].mfrely - frely,2));
+                }
+                xvectorrtkdata.push_back(xdata);
+
+                QString strline = QString::number(flon,'f',7) + QString("\t")
+                        +QString::number(flat,'f',7)+QString("\t")
+                        +QString::number(fheight,'f',4)+QString("\t")
+                        +QString::number(frelx,'f',2) + QString("\t")
+                        +QString::number(frely,'f',2) + QString("\t");
+                ui->plainTextEdit->appendPlainText(strline);
+            }
+        }
+    }
+
+    mvectorrtkdata = xvectorrtkdata;
+
+    unsigned int nsize = mvectorrtkdata.size();
+    ui->comboBox_Center_From->clear();
+    ui->comboBox_Center_To->clear();
+    ui->comboBox_Heading_From->clear();
+    ui->comboBox_Heading_To->clear();
+    if(nsize >= 3)
+    {
+        unsigned int i;
+        for(i=0;i<nsize;i++)
+        {
+            ui->comboBox_Heading_From->addItem(QString::number(i));
+            ui->comboBox_Heading_To->addItem(QString::number(i));
+            ui->comboBox_Center_From->addItem(QString::number(i));
+            ui->comboBox_Center_To->addItem(QString::number(i));
+        }
+        ui->comboBox_Heading_From->setCurrentIndex(1);
+        ui->comboBox_Heading_To->setCurrentIndex(0);
+        ui->comboBox_Center_From->setCurrentIndex(0);
+        ui->comboBox_Center_To->setCurrentIndex(2);
+    }
+
+
+}
+
+void DialogParkingSpaceFromRTK::on_pushButton_Create_clicked()
+{
+    if(mvectorrtkdata.size()<3)
+    {
+        QMessageBox::warning(this,"Warning","At Least 3 Points.",QMessageBox::YesAll);
+        return;
+    }
+
+    int nHeadingFrom = ui->comboBox_Heading_From->currentIndex();
+    int nHeadingTo = ui->comboBox_Heading_To->currentIndex();
+    int nCenterFrom = ui->comboBox_Center_From->currentIndex();
+    int nCenterTo = ui->comboBox_Center_To->currentIndex();
+
+    double fHdg = xodrfunc::CalcHdg(QPointF(mvectorrtkdata[nHeadingFrom].mfrelx,mvectorrtkdata[nHeadingFrom].mfrely),
+                                    QPointF(mvectorrtkdata[nHeadingTo].mfrelx,mvectorrtkdata[nHeadingTo].mfrely));
+
+    double fCenter_x,fCenter_y;
+    fCenter_x = (mvectorrtkdata[nCenterFrom].mfrelx + mvectorrtkdata[nCenterTo].mfrelx)/2.0;
+    fCenter_y = (mvectorrtkdata[nCenterFrom].mfrely + mvectorrtkdata[nCenterTo].mfrely)/2.0;
+
+    double fLen = sqrt(pow(mvectorrtkdata[nHeadingFrom].mfrelx - mvectorrtkdata[nHeadingTo].mfrelx,2)
+                       +pow(mvectorrtkdata[nHeadingFrom].mfrely - mvectorrtkdata[nHeadingTo].mfrely,2));
+    double fWidth = sqrt(pow(mvectorrtkdata[nHeadingFrom].mfrelx - mvectorrtkdata[nCenterTo].mfrelx ,2)
+                         +pow(mvectorrtkdata[nHeadingFrom].mfrely - mvectorrtkdata[nCenterTo].mfrely,2));
+
+    qDebug("fhdg:%f flen:%f fwidth:%f",fHdg,fLen,fWidth);
+}

+ 37 - 0
src/tool/map_lanetoxodr/dialogparkingspacefromrtk.h

@@ -0,0 +1,37 @@
+#ifndef DIALOGPARKINGSPACEFROMRTK_H
+#define DIALOGPARKINGSPACEFROMRTK_H
+
+#include <QDialog>
+
+#include <OpenDrive/OpenDrive.h>
+
+#include "dialogaddroadfromrtk.h"
+
+namespace Ui {
+class DialogParkingSpaceFromRTK;
+}
+
+class DialogParkingSpaceFromRTK : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit DialogParkingSpaceFromRTK(Road * pRoad, QWidget *parent = nullptr);
+    ~DialogParkingSpaceFromRTK();
+
+private slots:
+    void on_pushButton_LoadData_clicked();
+
+    void on_pushButton_Create_clicked();
+
+private:
+    Ui::DialogParkingSpaceFromRTK *ui;
+
+    Road * mpRoad = NULL;
+
+    double mLat0,mLon0;
+
+    std::vector<iv::rtkdata> mvectorrtkdata;
+};
+
+#endif // DIALOGPARKINGSPACEFROMRTK_H

+ 160 - 0
src/tool/map_lanetoxodr/dialogparkingspacefromrtk.ui

@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogParkingSpaceFromRTK</class>
+ <widget class="QDialog" name="DialogParkingSpaceFromRTK">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>729</width>
+    <height>417</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QPushButton" name="pushButton_LoadData">
+   <property name="geometry">
+    <rect>
+     <x>50</x>
+     <y>30</y>
+     <width>131</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Load Data</string>
+   </property>
+  </widget>
+  <widget class="QPlainTextEdit" name="plainTextEdit">
+   <property name="geometry">
+    <rect>
+     <x>210</x>
+     <y>20</y>
+     <width>481</width>
+     <height>211</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>60</x>
+     <y>263</y>
+     <width>151</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Heading               From</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>340</x>
+     <y>269</y>
+     <width>51</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>To</string>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_Heading_From">
+   <property name="geometry">
+    <rect>
+     <x>240</x>
+     <y>263</y>
+     <width>71</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_Heading_To">
+   <property name="geometry">
+    <rect>
+     <x>410</x>
+     <y>263</y>
+     <width>71</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_3">
+   <property name="geometry">
+    <rect>
+     <x>60</x>
+     <y>314</y>
+     <width>151</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Center Point      From</string>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_Center_To">
+   <property name="geometry">
+    <rect>
+     <x>410</x>
+     <y>314</y>
+     <width>71</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_Center_From">
+   <property name="geometry">
+    <rect>
+     <x>240</x>
+     <y>314</y>
+     <width>71</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_4">
+   <property name="geometry">
+    <rect>
+     <x>340</x>
+     <y>320</y>
+     <width>51</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>To</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_Create">
+   <property name="geometry">
+    <rect>
+     <x>53</x>
+     <y>190</y>
+     <width>131</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Create</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_5">
+   <property name="geometry">
+    <rect>
+     <x>40</x>
+     <y>360</y>
+     <width>451</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>RTK顺序默认为左上、左下、右下、右上,否则调整From和To</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 102 - 0
src/tool/map_lanetoxodr/dialogroadobject_outline_cornerroad.cpp

@@ -82,11 +82,113 @@ void DialogRoadObject_Outline_cornerRoad::on_pushButton_Add_clicked()
 void DialogRoadObject_Outline_cornerRoad::on_pushButton_Delete_clicked()
 {
      if(mpoutline == NULL)return;
+
+     if(mntype == 0)
+     {
+         if(mpoutline->GetcornerRoadCount() == 0)
+         {
+             QMessageBox::warning(this,"Warning","No CornerRoad.",QMessageBox::YesAll);
+             return;
+         }
+
+         mpoutline->DeletecornerRoad(ui->comboBox_corner->currentIndex());
+     }
+     else
+     {
+         if(mpoutline->GetcornerLocalCount() == 0)
+         {
+             QMessageBox::warning(this,"Warning","No CornerLocal.",QMessageBox::YesAll);
+             return;
+         }
+
+        mpoutline->DeletecornerLocal(ui->comboBox_corner->currentIndex());
+     }
+
+     UpdateCB();
+
 }
 
 void DialogRoadObject_Outline_cornerRoad::on_pushButton_Change_clicked()
 {
      if(mpoutline == NULL)return;
+
+     Object_outlines_outline_cornerRoad * pcornerRoad = NULL;
+     Object_outlines_outline_cornerLocal * pcornerLocal = NULL;
+
+     if(mntype == 0)
+     {
+         if(mpoutline->GetcornerRoadCount() == 0)
+         {
+             QMessageBox::warning(this,"Warning","No CornerRoad.",QMessageBox::YesAll);
+             return;
+         }
+
+         pcornerRoad = mpoutline->GetcornerRoad(ui->comboBox_corner->currentIndex());
+         if(pcornerRoad == NULL)
+         {
+             QMessageBox::warning(this,"Warning","cornerRoad NULL.",QMessageBox::YesAll);
+             return;
+         }
+     }
+     else
+     {
+         if(mpoutline->GetcornerLocalCount() == 0)
+         {
+             QMessageBox::warning(this,"Warning","No CornerLocal.",QMessageBox::YesAll);
+             return;
+         }
+
+         pcornerLocal = mpoutline->GetcornerLocal(ui->comboBox_corner->currentIndex());
+         if(pcornerLocal == NULL)
+         {
+             QMessageBox::warning(this,"Warning","cornerLocal NULL.",QMessageBox::YesAll);
+             return;
+         }
+     }
+
+     if(mntype == 0)
+     {
+         if(ViewCreate::CheckLE(ui->lineEdit_s,"s",true,this) == false)return;
+         if(ViewCreate::CheckLE(ui->lineEdit_t,"t",true,this) == false)return;
+         if(ViewCreate::CheckLE(ui->lineEdit_dz,"dz",true,this) == false)return;
+     }
+     else
+     {
+         if(ViewCreate::CheckLE(ui->lineEdit_s,"u",true,this) == false)return;
+         if(ViewCreate::CheckLE(ui->lineEdit_t,"v",true,this) == false)return;
+         if(ViewCreate::CheckLE(ui->lineEdit_dz,"z",true,this) == false)return;
+     }
+     if(ViewCreate::CheckLE(ui->lineEdit_height,"height",true,this) == false)return;
+
+     if(mntype == 0)
+     {
+         pcornerRoad->Sets(ui->lineEdit_s->text().toDouble());
+         pcornerRoad->Sett(ui->lineEdit_t->text().toDouble());
+         pcornerRoad->Setdz(ui->lineEdit_dz->text().toDouble());
+         pcornerRoad->Setheight(ui->lineEdit_height->text().toDouble());
+         if(ViewCreate::CheckLE(ui->lineEdit_id,"id",false,this) == true)
+         {
+             pcornerRoad->Setid(ui->lineEdit_id->text().toInt());
+         }
+         QMessageBox::information(this,"Info","Change cornerRoad Successfully",QMessageBox::YesAll);
+
+     }
+     else
+     {
+         pcornerLocal->Setu(ui->lineEdit_s->text().toDouble());
+         pcornerLocal->Setv(ui->lineEdit_t->text().toDouble());
+         pcornerLocal->Setz(ui->lineEdit_dz->text().toDouble());
+         pcornerLocal->Setheight(ui->lineEdit_height->text().toDouble());
+         if(ViewCreate::CheckLE(ui->lineEdit_id,"id",false,this) == true)
+         {
+             pcornerLocal->Setid(ui->lineEdit_id->text().toInt());
+         }
+         QMessageBox::information(this,"Info","Change cornerLocal Successfully",QMessageBox::YesAll);
+
+     }
+     int index = ui->comboBox_corner->currentIndex();
+     UpdateCB();
+     ui->comboBox_corner->setCurrentIndex(index);
 }
 
 void DialogRoadObject_Outline_cornerRoad::UpdateCB()

+ 41 - 0
src/tool/map_lanetoxodr/dialogroadobject_outlines.cpp

@@ -1,6 +1,8 @@
 #include "dialogroadobject_outlines.h"
 #include "ui_dialogroadobject_outlines.h"
 
+#include "dialogroadobject_outline_cornerroad.h"
+
 static std::string gstr_e_outlineFillType[] ={"grass","concrete","cobble","asphalt",
                                              "pavement","gravel","soil"};
 
@@ -292,10 +294,49 @@ void DialogRoadObject_Outlines::UpdateStatus()
 
 void DialogRoadObject_Outlines::onClickcornerRoad()
 {
+    if(mpObject == 0)return;
+    Object * pObject = mpObject;
+
+    mpPBcornerLocal->setEnabled(false);
+    mpPBcornerRoad->setEnabled(false);
+
+    Object_outlines * pObject_outlines = pObject->Getoutlines();
+    if(pObject_outlines == NULL)
+    {
+        QMessageBox::warning(this,"Warning","No outlines.",QMessageBox::YesAll);
+    }
+
+    Object_outlines_outline xoutline;
+    if(pObject_outlines->GetObject_outlines_outline(xoutline) == 1)
+    {
+        DialogRoadObject_Outline_cornerRoad dlgcorner(&xoutline,0);
+        dlgcorner.exec();
+    }
+    pObject_outlines->SetObject_outlines_outline(xoutline);
 
+    UpdateStatus();
 }
 
 void DialogRoadObject_Outlines::onClickcornerLocal()
 {
+    if(mpObject == 0)return;
+    Object * pObject = mpObject;
+
+    mpPBcornerLocal->setEnabled(false);
+    mpPBcornerRoad->setEnabled(false);
 
+    Object_outlines * pObject_outlines = pObject->Getoutlines();
+    if(pObject_outlines == NULL)
+    {
+        QMessageBox::warning(this,"Warning","No outlines.",QMessageBox::YesAll);
+    }
+
+    Object_outlines_outline xoutline;
+    if(pObject_outlines->GetObject_outlines_outline(xoutline) == 1)
+    {
+        DialogRoadObject_Outline_cornerRoad dlgcorner(&xoutline,1);
+        dlgcorner.exec();
+    }
+    pObject_outlines->SetObject_outlines_outline(xoutline);
+    UpdateStatus();
 }

+ 3 - 0
src/tool/map_lanetoxodr/map_lanetoxodr.pro

@@ -39,6 +39,7 @@ SOURCES += \
     dialoglanefromrtk.cpp \
     dialoglaneoffset.cpp \
     dialogparkingspaceedit.cpp \
+    dialogparkingspacefromrtk.cpp \
     dialogroadborrow.cpp \
     dialogroadmerge.cpp \
     dialogroadmirror.cpp \
@@ -97,6 +98,7 @@ HEADERS += \
     dialoglanefromrtk.h \
     dialoglaneoffset.h \
     dialogparkingspaceedit.h \
+    dialogparkingspacefromrtk.h \
     dialogroadborrow.h \
     dialogroadmerge.h \
     dialogroadmirror.h \
@@ -149,6 +151,7 @@ FORMS += \
         dialoglanefromrtk.ui \
         dialoglaneoffset.ui \
         dialogparkingspaceedit.ui \
+        dialogparkingspacefromrtk.ui \
         dialogroadborrow.ui \
         dialogroadmerge.ui \
         dialogroadmirror.ui \

+ 13 - 1
src/tool/map_lanetoxodr/roadeditdialog.cpp

@@ -18,7 +18,7 @@ RoadEditDialog::RoadEditDialog(OpenDrive * pxodr,std::string strdefroad,QWidget
 
     myview = new MyView(this);
     myview->setObjectName(QStringLiteral("graphicsView"));
-    myview->setGeometry(QRect(30, 300, 900, 500));
+    myview->setGeometry(QRect(30, 350, 900, 500));
 
  //   connect(myview,SIGNAL(dbclickxy(double,double)),this,SLOT(onClickXY(double,double)));
 
@@ -682,3 +682,15 @@ void RoadEditDialog::on_pushButton_EditRoadType_clicked()
     DialogRoadType dlgroadtype(mpCurRoad,this);
     dlgroadtype.exec();
 }
+
+void RoadEditDialog::on_pushButton_ParkingSpaceFromRTK_clicked()
+{
+    if(mpCurRoad == 0)
+    {
+        QMessageBox::warning(this,"Warning","Not Select Road");
+        return;
+    }
+
+    DialogParkingSpaceFromRTK dlgparkrtk(mpCurRoad,this);
+    dlgparkrtk.exec();
+}

+ 3 - 0
src/tool/map_lanetoxodr/roadeditdialog.h

@@ -23,6 +23,7 @@
 #include "dialogroadobject.h"
 #include "dialogroadoptimize.h"
 #include "dialogroadtype.h"
+#include "dialogparkingspacefromrtk.h"
 
 #include "roaddigit.h"
 #include "xodrscenfunc.h"
@@ -75,6 +76,8 @@ private slots:
 
     void on_pushButton_EditRoadType_clicked();
 
+    void on_pushButton_ParkingSpaceFromRTK_clicked();
+
 private:
     bool IsDrawMark(double s);
 

+ 47 - 34
src/tool/map_lanetoxodr/roadeditdialog.ui

@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>1260</width>
-    <height>830</height>
+    <height>860</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -52,7 +52,7 @@
      <x>520</x>
      <y>100</y>
      <width>113</width>
-     <height>25</height>
+     <height>31</height>
     </rect>
    </property>
   </widget>
@@ -62,7 +62,7 @@
      <x>770</x>
      <y>100</y>
      <width>113</width>
-     <height>25</height>
+     <height>31</height>
     </rect>
    </property>
   </widget>
@@ -72,7 +72,7 @@
      <x>1040</x>
      <y>100</y>
      <width>113</width>
-     <height>25</height>
+     <height>31</height>
     </rect>
    </property>
   </widget>
@@ -80,9 +80,9 @@
    <property name="geometry">
     <rect>
      <x>770</x>
-     <y>150</y>
+     <y>145</y>
      <width>113</width>
-     <height>25</height>
+     <height>31</height>
     </rect>
    </property>
   </widget>
@@ -103,9 +103,9 @@
    <property name="geometry">
     <rect>
      <x>520</x>
-     <y>150</y>
+     <y>145</y>
      <width>113</width>
-     <height>25</height>
+     <height>31</height>
     </rect>
    </property>
   </widget>
@@ -152,7 +152,7 @@
    <property name="geometry">
     <rect>
      <x>430</x>
-     <y>154</y>
+     <y>149</y>
      <width>67</width>
      <height>17</height>
     </rect>
@@ -165,7 +165,7 @@
    <property name="geometry">
     <rect>
      <x>680</x>
-     <y>154</y>
+     <y>149</y>
      <width>67</width>
      <height>17</height>
     </rect>
@@ -178,9 +178,9 @@
    <property name="geometry">
     <rect>
      <x>530</x>
-     <y>40</y>
+     <y>34</y>
      <width>113</width>
-     <height>25</height>
+     <height>31</height>
     </rect>
    </property>
   </widget>
@@ -201,7 +201,7 @@
    <property name="geometry">
     <rect>
      <x>940</x>
-     <y>152</y>
+     <y>147</y>
      <width>67</width>
      <height>17</height>
     </rect>
@@ -214,7 +214,7 @@
    <property name="geometry">
     <rect>
      <x>1040</x>
-     <y>149</y>
+     <y>144</y>
      <width>111</width>
      <height>31</height>
     </rect>
@@ -224,9 +224,9 @@
    <property name="geometry">
     <rect>
      <x>54</x>
-     <y>210</y>
+     <y>195</y>
      <width>181</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -237,9 +237,9 @@
    <property name="geometry">
     <rect>
      <x>285</x>
-     <y>210</y>
+     <y>195</y>
      <width>181</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -250,9 +250,9 @@
    <property name="geometry">
     <rect>
      <x>726</x>
-     <y>210</y>
+     <y>195</y>
      <width>211</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -265,7 +265,7 @@
      <x>1013</x>
      <y>426</y>
      <width>181</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -278,7 +278,7 @@
      <x>1010</x>
      <y>499</y>
      <width>191</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -291,7 +291,7 @@
      <x>1010</x>
      <y>572</y>
      <width>191</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -304,7 +304,7 @@
      <x>1010</x>
      <y>647</y>
      <width>191</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -317,7 +317,7 @@
      <x>1010</x>
      <y>722</y>
      <width>191</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -328,9 +328,9 @@
    <property name="geometry">
     <rect>
      <x>500</x>
-     <y>210</y>
+     <y>195</y>
      <width>181</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -341,9 +341,9 @@
    <property name="geometry">
     <rect>
      <x>980</x>
-     <y>210</y>
+     <y>195</y>
      <width>211</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -356,7 +356,7 @@
      <x>1010</x>
      <y>345</y>
      <width>181</width>
-     <height>31</height>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
@@ -366,16 +366,29 @@
   <widget class="QPushButton" name="pushButton_EditRoadType">
    <property name="geometry">
     <rect>
-     <x>1010</x>
-     <y>278</y>
-     <width>181</width>
-     <height>31</height>
+     <x>980</x>
+     <y>261</y>
+     <width>211</width>
+     <height>41</height>
     </rect>
    </property>
    <property name="text">
     <string>Edit Road Type</string>
    </property>
   </widget>
+  <widget class="QPushButton" name="pushButton_ParkingSpaceFromRTK">
+   <property name="geometry">
+    <rect>
+     <x>726</x>
+     <y>261</y>
+     <width>221</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>ParkingSpace From RTK</string>
+   </property>
+  </widget>
  </widget>
  <resources/>
  <connections/>