yuchuli 2 жил өмнө
parent
commit
a16eef2150

+ 11 - 2
src/decition/decition_brain_localplan/brain_localplan_gpstype.cpp

@@ -5,10 +5,19 @@
 brain_localplan_gpstype::brain_localplan_gpstype(localplan_base * pplan)
 {
 
+    using std::placeholders::_1;
+    using std::placeholders::_2;
+    using std::placeholders::_3;
+    using std::placeholders::_4;
+    using std::placeholders::_5;
     mpplan = pplan;
 
-    ModuleFun funmap =std::bind(&brain_localplan_gpstype::UpadateMap,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
-    mpa_map = iv::modulecomm::RegisterRecvPlus("mapglobal",funmap);
+  //  std::shared_ptr<char> pstr_ptr = std::make_shared<char>(1000);
+
+
+//    ModuleFun funmap =std::bind(&brain_localplan_gpstype::UpadateMap,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
+//    mpa_map = iv::modulecomm::RegisterRecvPlus("mapglobal",funmap);
+     mpa_map = iv::modulecomm::RegisterRecvPlus("mapglobal",std::bind(&brain_localplan_gpstype::UpadateMap,this,_1,_2,_3,_4,_5));
 
     ModuleFun funfusion =std::bind(&brain_localplan_gpstype::UpadateFusion,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
     mpa_fusion = iv::modulecomm::RegisterRecvPlus("li_ra_fusion",funfusion);

+ 1 - 0
src/decition/decition_brain_localplan/main.cpp

@@ -24,6 +24,7 @@ int main(int argc, char *argv[])
     localplan_base * pplan = dynamic_cast<localplan_base * >(new localplan_follow()) ;
     gplocalplan = pplan;
 
+
     brain_localplan_gpstype * pplocalpan_gpstype = new brain_localplan_gpstype(pplan);
     gplocalplan_gpstype = pplocalpan_gpstype;
 

+ 64 - 0
src/map/lanelet2/autogen_lanelet2.sh

@@ -0,0 +1,64 @@
+#qtmake="/opt/qt/5.13.2/gcc_64/bin/qmake"
+
+qtmake=" "
+
+if [ ${#qtmake} -lt 5 ]; then
+  echo "now need find qmake "
+  optfiles=`find /opt -name 'qmake'` 
+  for entry in $optfiles
+  do
+     x=${entry:0-17:17}
+     if [ "$x" == "/gcc_64/bin/qmake" ];  then
+        qtmake="$entry"
+	echo "  -----find qmake"
+	echo "$qtmake"
+     fi
+  done
+fi
+
+if [ ${#qtmake} -lt 5 ]; then
+  echo "maybe agx,find qmake in usr folder "
+  optfiles=`find /usr -name 'qmake'` 
+  for entry in $optfiles
+  do
+     x=${entry:0-14:14}
+     if [ "$x" == "/qt5/bin/qmake" ];  then
+        qtmake="$entry"
+	echo "  -----find qmake"
+	echo "$qtmake"
+     fi
+  done
+fi
+
+echo -e "\e[33m qtmake: $qtmake \e[0m"
+
+MAKEOPT=-j8
+
+mkdir bin
+
+
+lanelet2_lib_name=(
+	lanelet2_core
+	lanelet2_io
+	lanelet2_matching
+	lanelet2_projection
+	lanelet2_routing
+	lanelet2_traffic_rules
+)
+
+for x in ${lanelet2_lib_name[@]}
+do
+	cd ${x}/
+	$qtmake ${x}.pro
+	make $MAKEOPT
+	make clean
+	cp lib${x}.so ./../bin/
+	rm Makefile
+	rm .qmake.stash
+	rm lib${x}.so
+	cd ../
+done
+
+
+
+

+ 0 - 0
src/map/lanelet2/lanelet2_pjojection/src/.gitignore


+ 0 - 81
src/map/lanelet2/lanelet2_pjojection/src/UTM.cpp

@@ -1,81 +0,0 @@
-#include "lanelet2_projection/UTM.h"
-
-#include <GeographicLib/UTMUPS.hpp>
-
-namespace lanelet {
-namespace projection {
-
-UtmProjector::UtmProjector(Origin origin, const bool useOffset, const bool throwInPaddingArea)
-    : Projector(origin), useOffset_{useOffset}, throwInPaddingArea_{throwInPaddingArea} {
-  double x = 0;
-  double y = 0;
-  GeographicLib::UTMUPS::Forward(this->origin().position.lat, this->origin().position.lon, zone_,
-                                 isInNorthernHemisphere_, x, y);
-  if (useOffset_) {
-    xOffset_ = x;
-    yOffset_ = y;
-  }
-}
-
-BasicPoint3d UtmProjector::forward(const GPSPoint& gps) const {
-  BasicPoint3d utm{0., 0., gps.ele};
-  int zone{};
-  bool northp{};
-  try {
-    GeographicLib::UTMUPS::Forward(gps.lat, gps.lon, zone, northp, utm.x(), utm.y());
-  } catch (GeographicLib::GeographicErr& e) {
-    throw ForwardProjectionError(e.what());
-  }
-
-  if (zone != zone_ || northp != isInNorthernHemisphere_) {
-    if (throwInPaddingArea_) {
-      throw ForwardProjectionError("You have left the UTM zone or changed the hemisphere!");
-    }
-    // try to transfer to the desired zone
-    double xAfterTransfer = 0;
-    double yAfterTransfer = 0;
-    int zoneAfterTransfer = 0;
-    try {
-      GeographicLib::UTMUPS::Transfer(zone, northp, utm.x(), utm.y(), zone_, isInNorthernHemisphere_, xAfterTransfer,
-                                      yAfterTransfer, zoneAfterTransfer);
-    } catch (GeographicLib::GeographicErr& e) {
-      throw ForwardProjectionError(e.what());
-    }
-
-    if (zoneAfterTransfer != zone_) {
-      throw ForwardProjectionError("You have left the padding area of the UTM zone!");
-    }
-    utm.x() = xAfterTransfer;
-    utm.y() = yAfterTransfer;
-  }
-
-  if (useOffset_) {
-    utm.x() -= xOffset_;
-    utm.y() -= yOffset_;
-  }
-
-  return utm;
-}
-
-GPSPoint UtmProjector::reverse(const BasicPoint3d& utm) const {
-  GPSPoint gps{0., 0., utm.z()};
-  try {
-    GeographicLib::UTMUPS::Reverse(zone_, isInNorthernHemisphere_, useOffset_ ? utm.x() + xOffset_ : utm.x(),
-                                   useOffset_ ? utm.y() + yOffset_ : utm.y(), gps.lat, gps.lon);
-  } catch (GeographicLib::GeographicErr& e) {
-    throw ReverseProjectionError(e.what());
-  }
-
-  if (throwInPaddingArea_) {
-    // for zone compliance testing:
-    try {
-      forward(gps);
-    } catch (ForwardProjectionError& e) {
-      throw ReverseProjectionError(e.what());
-    };
-  }
-  return gps;
-}
-
-}  // namespace projection
-}  // namespace lanelet

+ 73 - 0
src/test/testlanelet2/.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
+

+ 50 - 0
src/test/testlanelet2/main.cpp

@@ -0,0 +1,50 @@
+#include <QCoreApplication>
+
+#include "lanelet2_io/Io.h"
+
+using namespace lanelet;
+
+Lanelet buildTouchingTestCase(bool inverted) {
+  /*
+   * Shape:
+   * \__
+   *    \
+   * ----x
+   */
+  Id id{1};
+  Point3d p11(++id, 0, -3);
+  Point3d p12(++id, 1, 1);
+  Point3d p13(++id, 4, 0);
+  Point3d p21(++id, 0, 0);
+  Point3d p22(++id, 1, 0);
+  LineString3d left(++id, {p11, p12, p13});
+  left.setAttribute("type",lanelet::Attribute("line_thin"));
+  left.setAttribute("subtype",lanelet::Attribute("dashed"));
+
+  LineString3d right(++id, {p21, p22, p13});
+  return inverted ? Lanelet(++id, right.invert(), left.invert()) : Lanelet(++id, left, right);
+}
+
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+
+    lanelet::Origin origin({49, 8.4, 0});
+
+    std::string filename = "/home/yuchuli/qt/modularization/src/test/testlanelet2/test.osm";
+
+    lanelet::LaneletMapPtr laneletMap = lanelet::load(filename,origin);
+
+    lanelet::LaneletMapPtr laneletMap2  = std::make_shared<lanelet::LaneletMap>();
+
+    Lanelet let1 = buildTouchingTestCase(false);
+    laneletMap2->add(let1);
+
+
+    lanelet::Origin origin2({39, 117, 0});
+    lanelet::write("test2.osm",*laneletMap2,origin2);
+ //   lanelet::write("test2.osm",*laneletMap2,origin);
+
+    return a.exec();
+}

+ 8 - 24
src/map/lanelet2/lanelet2_pjojection/lanelet2_pjojection.pro → src/test/testlanelet2/testlanelet2.pro

@@ -1,18 +1,10 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2022-11-21T16:40:05
-#
-#-------------------------------------------------
+QT -= gui
 
-QT       -= core gui
-
-TARGET = lanelet2_pjojection
-TEMPLATE = lib
-
-DEFINES += LANELET2_PJOJECTION_LIBRARY
+CONFIG += c++14 console
+CONFIG -= app_bundle
 
 # The following define makes your compiler emit warnings if you use
-# any feature of Qt which has been marked as deprecated (the exact warnings
+# any feature of Qt which as 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
@@ -22,22 +14,14 @@ DEFINES += QT_DEPRECATED_WARNINGS
 # 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 += \
-    src/UTM.cpp
+SOURCES += main.cpp
 
-HEADERS +=
 
-unix {
-    target.path = /usr/lib
-    INSTALLS += target
-}
+INCLUDEPATH += $$PWD/../../map/lanelet2/include
 
-CONFIG += plugin
+LIBS += -L$$PWD/../../map/lanelet2/bin -llanelet2_core -llanelet2_io
 
-INCLUDEPATH += $$PWD/../include
+LIBS += -lboost_system -lboost_serialization  -lboost_filesystem -lpugixml
 
 unix:INCLUDEPATH += /usr/include/eigen3
 win32:INCLUDEPATH += D:\File\soft\eigen
-
-
-#sudo apt-get install libgeographic-dev

+ 4 - 0
src/tool/h264view_civetweb/h264view_civetweb.pro

@@ -37,6 +37,10 @@ LIBS += -lprotobuf
     error( "Couldn't find the common.pri file!" )
 }
 
+!include(../../../include/ivopencv.pri ) {
+    error( "Couldn't find the ivopencv.pri file!" )
+}
+
 HEADERS += \
     ../../../thirdpartylib/civetweb/CivetServer.h \
     ../../../thirdpartylib/civetweb/civetweb.h \

+ 1 - 1
src/tool/h264view_civetweb/main.cpp

@@ -75,7 +75,7 @@ void threadgetpic()
         cv::cvtColor(pbuf->myuvImg, rgbImg,  CV_YUV2BGR_I420);
         gph264decode->UnlockReadBuff(nindex);
         std::vector<int> param = std::vector<int>(2);
-        param[0] = CV_IMWRITE_JPEG_QUALITY;
+        param[0] = 1;//CV_IMWRITE_JPEG_QUALITY;
         param[1] = 95; // default(95) 0-100
         std::vector<unsigned char> buff;
         int64 time1 = std::chrono::system_clock::now().time_since_epoch().count();