├── .gitattributes
├── .gitignore
├── Docs
├── Architecture.md
├── General UML.jpg
├── TextMaps.png
├── afterinj.png
├── beforeinj.png
├── motivtraj.png
└── vision_opencv Issues.md
├── LICENSE
├── README.md
├── ncore
├── CMakeLists.txt
├── data
│ ├── 8
│ │ ├── VOSet.txt
│ │ ├── YouBotMap.pgm
│ │ ├── YouBotMap.yaml
│ │ └── optitrack.yaml
│ ├── 8_high_res
│ │ ├── YouBotMap.pgm
│ │ ├── YouBotMap.yaml
│ │ └── optitrack.yaml
│ ├── config
│ │ ├── cam0.config
│ │ ├── front_laser.config
│ │ ├── front_laser.yaml
│ │ ├── rear_laser.config
│ │ ├── rear_laser.yaml
│ │ └── textspotting.config
│ ├── floor
│ │ ├── 2021_10_27
│ │ │ ├── YouBotMap.pgm
│ │ │ ├── YouBotMap.yaml
│ │ │ ├── YouBotMapRoomSeg.png
│ │ │ ├── editor.xml
│ │ │ ├── floor.config
│ │ │ ├── nmcl.config
│ │ │ └── textspotting.json
│ │ ├── Faro
│ │ │ ├── FMap.pgm
│ │ │ ├── FMap.png
│ │ │ ├── FMap.yaml
│ │ │ ├── FMapRoomSeg.png
│ │ │ ├── TextMaps
│ │ │ │ ├── Room 1.png
│ │ │ │ ├── Room 10.png
│ │ │ │ ├── Room 2.png
│ │ │ │ ├── Room 3.png
│ │ │ │ ├── Room 4.png
│ │ │ │ ├── Room 5.png
│ │ │ │ ├── Room 6.png
│ │ │ │ ├── Room 7.png
│ │ │ │ ├── Room 8.png
│ │ │ │ └── Room 9.png
│ │ │ ├── editor.xml
│ │ │ ├── floor.config
│ │ │ ├── nmcl.config
│ │ │ └── textspotting.json
│ │ ├── GMap
│ │ │ ├── GMap.png
│ │ │ ├── GMap.yaml
│ │ │ ├── GMapRoomSeg.png
│ │ │ ├── TextMaps
│ │ │ │ ├── Room 1.png
│ │ │ │ ├── Room 10.png
│ │ │ │ ├── Room 2.png
│ │ │ │ ├── Room 3.png
│ │ │ │ ├── Room 4.png
│ │ │ │ ├── Room 5.png
│ │ │ │ ├── Room 6.png
│ │ │ │ ├── Room 7.png
│ │ │ │ ├── Room 8.png
│ │ │ │ └── Room 9.png
│ │ │ ├── editor.xml
│ │ │ ├── floor.config
│ │ │ └── nmcl.config
│ │ └── test
│ │ │ ├── YouBotMap.pgm
│ │ │ ├── YouBotMap.yaml
│ │ │ ├── YouBotMapRoomSeg.png
│ │ │ ├── editor.xml
│ │ │ ├── floor.config
│ │ │ ├── floor_seeds.xml
│ │ │ └── nmcl.config
│ ├── json
│ │ └── nmcl.config
│ └── text
│ │ ├── lebron.jpg
│ │ └── test.jpg
├── ndl
│ ├── CMakeLists.txt
│ ├── include
│ │ ├── ImageUtils.h
│ │ └── TextSpotting.h
│ ├── src
│ │ ├── CMakeLists.txt
│ │ ├── ImageUtils.cpp
│ │ ├── TextRecoFromFolder.cpp
│ │ ├── TextRecoFromFolder2.cpp
│ │ └── TextSpotting.cpp
│ └── tst
│ │ ├── CMakeLists.txt
│ │ └── NDLUnitTests.cpp
├── nengine
│ ├── CMakeLists.txt
│ ├── include
│ │ ├── DataFrameLoader.h
│ │ └── NMCLEngine.h
│ ├── src
│ │ ├── CMakeLists.txt
│ │ ├── DataFrameLoader.cpp
│ │ ├── NMCLEngine.cpp
│ │ └── df_loader.py
│ └── tst
│ │ ├── CMakeLists.txt
│ │ ├── EngineBenchmark.cpp
│ │ └── main.cpp
├── nmap
│ ├── CMakeLists.txt
│ ├── data
│ │ ├── YouBotMap.pgm
│ │ ├── YouBotMap.yaml
│ │ └── YouBotMapRoomSeg.png
│ ├── include
│ │ ├── FloorMap.h
│ │ ├── GMap.h
│ │ ├── IMap2D.h
│ │ ├── Lift.h
│ │ ├── Object.h
│ │ └── Room.h
│ ├── src
│ │ ├── CMakeLists.txt
│ │ ├── FloorMap.cpp
│ │ ├── GMap.cpp
│ │ ├── Lift.cpp
│ │ ├── Object.cpp
│ │ ├── Room.cpp
│ │ └── RoomSegmentation.cpp
│ └── tst
│ │ ├── CMakeLists.txt
│ │ └── NMapUnitTests.cpp
├── nmcl
│ ├── CMakeLists.txt
│ ├── include
│ │ ├── AggressiveLowVarianceResampling.h
│ │ ├── BeamEnd.h
│ │ ├── FSR.h
│ │ ├── GaussianPredictStrategy.h
│ │ ├── LidarData.h
│ │ ├── LowVarianceResampling.h
│ │ ├── MixedFSR.h
│ │ ├── MotionModel.h
│ │ ├── NMCL.h
│ │ ├── NMCLFactory.h
│ │ ├── Particle.h
│ │ ├── PlaceRecognition.h
│ │ ├── PredictStrategy.h
│ │ ├── ReNMCL.h
│ │ ├── Resampling.h
│ │ ├── SensorData.h
│ │ ├── SensorModel.h
│ │ ├── SetStatistics.h
│ │ └── UniformPredictStrategy.h
│ ├── src
│ │ ├── AggressiveLowVarianceResampling.cpp
│ │ ├── BeamEnd.cpp
│ │ ├── CMakeLists.txt
│ │ ├── FSR.cpp
│ │ ├── GaussianPredictStrategy.cpp
│ │ ├── LowVarianceResampling.cpp
│ │ ├── MixedFSR.cpp
│ │ ├── NMCL.cpp
│ │ ├── NMCLFactory.cpp
│ │ ├── Particle.cpp
│ │ ├── PlaceRecognition.cpp
│ │ ├── ReNMCL.cpp
│ │ ├── SetStatistics.cpp
│ │ └── UniformPredictStrategy.cpp
│ └── tst
│ │ ├── CMakeLists.txt
│ │ ├── NMCLUnitTests.cpp
│ │ └── verifyInit.py
└── nsensors
│ ├── CMakeLists.txt
│ ├── include
│ ├── Camera.h
│ ├── Lidar2D.h
│ ├── OptiTrack.h
│ └── Utils.h
│ ├── src
│ ├── CMakeLists.txt
│ ├── Camera.cpp
│ ├── Lidar2D.cpp
│ ├── OptiTrack.cpp
│ └── Utils.cpp
│ └── tst
│ ├── CMakeLists.txt
│ └── NSensorsUnitTests.cpp
└── ros1_ws
└── src
├── CMakeLists.txt
├── data_processing
├── CMakeLists.txt
├── launch
│ ├── allsync.launch
│ ├── amcleval.launch
│ ├── gtviz.launch
│ ├── syncgtrs.launch
│ └── synclidar.launch
├── package.xml
├── rviz
│ ├── amcl.rviz
│ └── gtviz.rviz
├── src
│ ├── AMCLEval.py
│ ├── AddPredictions.py
│ ├── CameraDumpNode.py
│ ├── ExtractTextPoses (copy).py
│ ├── ExtractTextPoses.py
│ ├── GMAP.py
│ ├── GTpickle.py
│ ├── OdomDumpNode.py
│ ├── PickleBroadcastNode.py
│ ├── PlotBBox.py
│ ├── SyncGPandRSNode.py
│ ├── SyncLidarNode.py
│ ├── VizBBoxNode.py
│ ├── checkPickle.py
│ ├── computeMetrics.py
│ ├── computeMetricsStatic.py
│ ├── computeMetricsdynamic.py
│ ├── evalutils.py
│ ├── mergepickles.py
│ ├── plotResults.py
│ ├── ploterrorvsparticlenum.py
│ └── ploterrorvstime.py
└── srv
│ └── NoArguments.srv
├── evaluation
├── CMakeLists.txt
├── package.xml
└── src
│ ├── GMAP.py
│ ├── converge.py
│ ├── convplot.py
│ ├── evaluation.py
│ ├── evalutils.py
│ ├── ploterrorAVG.py
│ ├── ploterrorpartnumAVG.py
│ ├── ploterrorvsparticlenumConv.py
│ ├── plotgttrajectoryandprediction.py
│ └── plottextmaps.py
├── nmcl_msgs
├── CMakeLists.txt
├── msg
│ ├── LidarScanMask.msg
│ ├── MergedLaserScan.msg
│ └── TextArray.msg
└── package.xml
└── nmcl_ros
├── CMakeLists.txt
├── config
├── 480x640
│ ├── cam0.config
│ ├── cam1.config
│ ├── cam2.config
│ └── cam3.config
├── cam0.config
├── cam1.config
├── cam2.config
├── cam3.config
├── front_laser.config
├── front_laser.yaml
├── rear_laser.config
└── rear_laser.yaml
├── include
└── RosUtils.h
├── launch
├── camerasync.launch
├── confignmcl.launch
└── textrec.launch
├── package.xml
├── rviz
├── calib.rviz
├── confignmcl.rviz
├── humanmask.rviz
├── nmcl.rviz
├── panopticnmcl.rviz
└── vonmcl.rviz
└── src
├── CMakeLists.txt
├── ConfigNMCLNode.cpp
├── RosUtils.cpp
├── ScanMergeNode.cpp
└── TextRecoNode.cpp
/.gitattributes:
--------------------------------------------------------------------------------
1 | data/*.yaml filter=lfs diff=lfs merge=lfs -text
2 | data/*.bin filter=lfs diff=lfs merge=lfs -text
3 | data/*.pgm filter=lfs diff=lfs merge=lfs -text
4 | *.bin filter=lfs diff=lfs merge=lfs -text
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.cmake
2 | CMakeCache.txt
3 | ros1_ws/src/legdetector_pyros/*
4 | ros1_ws/src/odom_eval/*
5 | nmcl/src/CMakeFiles/
6 | nmcl/tst/CMakeFiles/
7 | nmcl/CMakeFiles/
8 | ros1_ws/build/
9 | ncore/build/
10 | *__pycache__/
11 | *Makefile
12 |
--------------------------------------------------------------------------------
/Docs/Architecture.md:
--------------------------------------------------------------------------------
1 | # Software Architecture
2 |
3 | There are a few main concepts that drove the development of the system.
4 |
5 | ### Core-ROS Separation
6 | The core C++ library that runs the NMCL algorithm does not include ROS code. That was done because it's good practice, and because I knew we would develop for ROS1 initially and then transition to ROS2 when the code is more mature.
7 |
8 | ### Modularity
9 | The [NMCL](nmcl/include/NMCL.h) class can be seen as an engine driving the MCL-type algorithm. The [motion model](nmcl/include/MotionModel.h) and [sensor model](nmcl/include/SensorModel.h) are abstracted through an interface, allowing the developer to change these models easily, without adjusting the localization engine. This enables quick evaluation of different models, isolating their impact.
10 |
11 | ### Data Source Abstraction
12 | A certain interface was defined for localization engine, and preprocessing is done depending on the source of the data. On the highest level, the functions and the order in which they are called remain the same whether the data is read from a binary/text files or received through ROS topics. On a lower level, the localization engine only knows it is receiving a scan in a form of heading angles and ranges. The developer may painlessly adjust the algorithm to receive scans from one or more range-finding devices.
13 | Example for a standard localization process:
14 | * Initialize the NMCL class with the motion and sensor models
15 | * Predict method with an input that is appropriate for your motion model
16 | * Correct method with an input that is appropriate for your sensor model. This step also includes that sampling strategy - I might change the sampling to be a class you can pass to the engine
17 | * Stats method will return the prediction with covariance
18 |
19 | ## Design Intro
20 | In our ROS wrappers, we imlemented two motion models, for odometry sources:
21 | * [FSR](nmcl/include/FSR.h) - one odometry source
22 | * [MixedFSR](nmcl/include/MixedFSR.h) - two odometry sources that we consider in equal probability
23 | They both target omnidirectional platforms.
24 |
25 | Our sensor model, [BeamEnd](nmcl/include/BeamEnd.h), requires that the range scans are converted to 3D points, in the coordinate frame of the base link. In our ROS wrapper, we combine scans from the front and rear lidars to a "virtual scan", centring both scans around the base link which is set to be the origin (0, 0, 0). This preprocessing step can be adjusted to suit the needs, e.g. processing only one lidar scan (or more than 2). The sensor (and motion) model can also be replaced in its entirety, provided that it complies with the interface.
26 |
27 | ## UML
28 |
29 | 
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Docs/General UML.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/Docs/General UML.jpg
--------------------------------------------------------------------------------
/Docs/TextMaps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/Docs/TextMaps.png
--------------------------------------------------------------------------------
/Docs/afterinj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/Docs/afterinj.png
--------------------------------------------------------------------------------
/Docs/beforeinj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/Docs/beforeinj.png
--------------------------------------------------------------------------------
/Docs/motivtraj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/Docs/motivtraj.png
--------------------------------------------------------------------------------
/Docs/vision_opencv Issues.md:
--------------------------------------------------------------------------------
1 | The reason things don't compile might be that vision_opencv still compiles with OpenCV 4.2.
2 | To force compilation with OpenCV 4.5, you can edit two CMakeLists.txt files.
3 | For [cv_bridge](https://github.com/ros-perception/vision_opencv/blob/noetic/cv_bridge/CMakeLists.txt), edit lines 20-25 as follows
4 |
5 | ```bash
6 | set(_opencv_version 4.5)
7 | find_package(OpenCV 4.5 QUIET)
8 | if(NOT OpenCV_FOUND)
9 | message(STATUS "Did not find OpenCV 4.5")
10 | endif()
11 | ```
12 |
13 | For [image_geometry](https://github.com/ros-perception/vision_opencv/blob/noetic/image_geometry/CMakeLists.txt), edit line 5
14 |
15 | ```bash
16 | find_package(OpenCV 4.5 REQUIRED)
17 | ```
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Nicky Zimmerman and Cyrill Stachniss, Photogrammetry & Robotics Bonn, University of Bonn
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ncore/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0.2)
2 | project(ncore)
3 |
4 | set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall ${CMAKE_CXX_FLAGS}")
5 |
6 |
7 | set(CMAKE_CXX_STANDARD 14)
8 |
9 |
10 |
11 | find_package(Eigen3 REQUIRED)
12 | find_package(OpenCV 4.5 REQUIRED)
13 | if(OpenCV_FOUND)
14 | message(STATUS "Found OpenCV version ${OpenCV_VERSION}")
15 | message(STATUS "OpenCV directories: ${OpenCV_INCLUDE_DIRS}")
16 | include_directories(${OpenCV_INCLUDE_DIRS})
17 | else()
18 | message(FATAL_ERROR "OpenCV not found, please read the README.md")
19 | endif(OpenCV_FOUND)
20 |
21 |
22 | find_package(Boost COMPONENTS serialization system filesystem)
23 | if(Boost_FOUND)
24 | message(STATUS "Found Boost version ${Boost_VERSION}")
25 | message(STATUS "Boost directories: ${Boost_INCLUDE_DIRS}")
26 | include_directories(${Boost_INCLUDE_DIRS})
27 | else()
28 | message(FATAL_ERROR "Boost not found, please read the README.md")
29 | endif(Boost_FOUND)
30 |
31 | find_package(nlohmann_json 3.2.0 REQUIRED)
32 | if(nlohmann_json_FOUND)
33 | message(STATUS "Found nlohmann_json")
34 | else()
35 | message(FATAL_ERROR "nlohmann_json not found, please read the README.md")
36 | endif(nlohmann_json_FOUND)
37 |
38 | if(BUILD_TESTING)
39 | enable_testing()
40 | find_package(GTest REQUIRED)
41 | if(GTEST_FOUND)
42 | message(STATUS "GTest directories: ${GTEST_INCLUDE_DIRS}")
43 | include_directories(${GTEST_INCLUDE_DIRS})
44 | else()
45 | message(FATAL_ERROR "GTEST_FOUND not found, please read the README.md")
46 | endif(GTEST_FOUND)
47 | endif()
48 |
49 | #add_subdirectory(nlohmann_json)
50 | add_subdirectory(nsensors)
51 | add_subdirectory(nmap)
52 | add_subdirectory(nmcl)
53 | add_subdirectory(ndl)
54 | add_subdirectory(nengine)
55 |
--------------------------------------------------------------------------------
/ncore/data/8/YouBotMap.pgm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/8/YouBotMap.pgm
--------------------------------------------------------------------------------
/ncore/data/8/YouBotMap.yaml:
--------------------------------------------------------------------------------
1 | image: YouBotMap.pgm
2 | resolution: 0.050000
3 | origin: [-12.200000, -17.000000, 0.000000]
4 | negate: 0
5 | occupied_thresh: 0.65
6 | free_thresh: 0.196
7 |
8 |
--------------------------------------------------------------------------------
/ncore/data/8/optitrack.yaml:
--------------------------------------------------------------------------------
1 | origin: [1.3097140789031982, 0.5226072072982788, -3.138]
2 |
--------------------------------------------------------------------------------
/ncore/data/8_high_res/YouBotMap.pgm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/8_high_res/YouBotMap.pgm
--------------------------------------------------------------------------------
/ncore/data/8_high_res/YouBotMap.yaml:
--------------------------------------------------------------------------------
1 | image: YouBotMap.pgm
2 | resolution: 0.010000
3 | origin: [-11.240000, -15.720000, 0.000000]
4 | negate: 0
5 | occupied_thresh: 0.65
6 | free_thresh: 0.196
7 |
8 |
--------------------------------------------------------------------------------
/ncore/data/8_high_res/optitrack.yaml:
--------------------------------------------------------------------------------
1 | origin: [1.3097140789031982, 0.5226072072982788, -3.138]
2 |
--------------------------------------------------------------------------------
/ncore/data/config/cam0.config:
--------------------------------------------------------------------------------
1 | {
2 | "id": 0,
3 | "yaw" : 0,
4 | "k" : [614.6570434570312, 0.0, 326.6780090332031, 0.0, 614.308349609375, 242.25645446777344, 0.0, 0.0, 1.0],
5 | "t" : [0, 0, 1, -1, 0, 0, 0, -1, 0]
6 | }
--------------------------------------------------------------------------------
/ncore/data/config/front_laser.config:
--------------------------------------------------------------------------------
1 | {
2 | "name": "front_laser",
3 | "angle_max" : 2.268928050994873,
4 | "angle_min" : -2.268928050994873,
5 | "num_beams" : 1041,
6 | "origin" : [0.25, 0.155, 0.785]
7 | }
8 |
--------------------------------------------------------------------------------
/ncore/data/config/front_laser.yaml:
--------------------------------------------------------------------------------
1 | name: front_laser
2 | angle_max: 2.268928050994873
3 | angle_min: -2.268928050994873
4 | num_beams: 1041
5 | origin: [0.25, 0.155, 0.785]
6 |
--------------------------------------------------------------------------------
/ncore/data/config/rear_laser.config:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rear_laser",
3 | "angle_max" : 2.268928050994873,
4 | "angle_min" : -2.268928050994873,
5 | "num_beams" : 1041,
6 | "origin" : [-0.25, -0.155, -2.356]
7 | }
8 |
--------------------------------------------------------------------------------
/ncore/data/config/rear_laser.yaml:
--------------------------------------------------------------------------------
1 | name: rear_laser
2 | angle_max: 2.268928050994873
3 | angle_min: -2.268928050994873
4 | num_beams: 1041
5 | origin: [-0.25, -0.155, -2.356]
6 |
--------------------------------------------------------------------------------
/ncore/data/config/textspotting.config:
--------------------------------------------------------------------------------
1 | {
2 | "detModelPath": "/home/nickybones/Code/OmniNMCL/ncore/data/text/DB_IC15_resnet18.onnx",
3 | "recModelPath": "/home/nickybones/Code/OmniNMCL/ncore/data/text/crnn_cs.onnx",
4 | "vocPath": "/home/nickybones/Code/OmniNMCL/ncore/data/text/alphabet_94.txt",
5 | "height": 480,
6 | "width": 640,
7 | "binThresh": 0.3,
8 | "polyThresh" : 0.5,
9 | "maxCandidates" : 50,
10 | "unclipRatio" : 2.0
11 | }
12 |
--------------------------------------------------------------------------------
/ncore/data/floor/2021_10_27/YouBotMap.pgm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/2021_10_27/YouBotMap.pgm
--------------------------------------------------------------------------------
/ncore/data/floor/2021_10_27/YouBotMap.yaml:
--------------------------------------------------------------------------------
1 | image: YouBotMap.pgm
2 | resolution: 0.050000
3 | origin: [-17.000000, -12.200000, 0.000000]
4 | negate: 0
5 | occupied_thresh: 0.65
6 | free_thresh: 0.196
7 |
8 |
--------------------------------------------------------------------------------
/ncore/data/floor/2021_10_27/YouBotMapRoomSeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/2021_10_27/YouBotMapRoomSeg.png
--------------------------------------------------------------------------------
/ncore/data/floor/2021_10_27/editor.xml:
--------------------------------------------------------------------------------
1 | 22 serialization::archive 17 0 0 0 0 13 0 0 0 9 Not$Valid 7 general 0 0 0 0 0 6 Room 1 7 general 1 0 0 6 Room 2 7 general 2 0 0 6 Room 3 7 general 3 0 0 6 Room 4 7 general 4 0 0 6 Room 5 7 general 5 0 0 6 Room 6 7 general 6 0 0 6 Room 7 7 general 7 0 0 6 Room 8 7 general 8 0 0 6 Room 9 7 general 9 0 0 7 Room 10 7 general 10 0 0 7 Room 11 7 general 11 0 0 7 Room 12 7 general 12 0 0 0 0 13 0 0 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 -4.800000191e+00 1.950000000e+01 0.000000000e+00 -4.599999428e+00 1.604999924e+01 0.000000000e+00 -6.649999619e+00 6.650000572e+00 0.000000000e+00 -4.050000191e+00 6.250000954e+00 0.000000000e+00 -6.800000191e+00 4.550000191e+00 0.000000000e+00 -2.449999809e+00 4.000005722e-01 0.000000000e+00 -2.849999428e+00 5.100001335e+00 0.000000000e+00 -3.050000191e+00 8.900000572e+00 0.000000000e+00 -3.199999809e+00 1.265000057e+01 0.000000000e+00 -3.899999619e+00 2.225000000e+01 0.000000000e+00 -4.099999428e+00 1.355000019e+01 0.000000000e+00 -3.349999428e+00 8.500003815e-01 0.000000000e+00
--------------------------------------------------------------------------------
/ncore/data/floor/2021_10_27/floor.config:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "0",
3 | "editor" : "editor.xml",
4 | "roomSeg" : "YouBotMapRoomSeg.png",
5 | "map": {
6 | "type" : "GMap",
7 | "image": "YouBotMap.pgm",
8 | "resolution" : 0.050000,
9 | "origin" : [-17.000000, -12.200000, 0.000000],
10 | "negate" : 0,
11 | "occupied_thresh" : 0.65,
12 | "free_thresh" : 0.196
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/ncore/data/floor/2021_10_27/nmcl.config:
--------------------------------------------------------------------------------
1 | {
2 | "injRatio": 1.0,
3 | "floorMapPath": "/home/nickybones/Code/YouBotMCL/ncore/data/floor/2021_10_27/floor.config",
4 | "motionModel": "MixedFSR",
5 | "numParticles": 10000,
6 | "predictStrategy": "Uniform",
7 | "resampling": "LowVarianceResampling",
8 | "sensorModel": {
9 | "likelihoodSigma": 2,
10 | "maxRange": 15,
11 | "type": "BeamEnd",
12 | "weightingScheme": 3
13 | },
14 | "tracking": false
15 | }
16 |
--------------------------------------------------------------------------------
/ncore/data/floor/2021_10_27/textspotting.json:
--------------------------------------------------------------------------------
1 | {
2 | "detModelPath": "/home/nickybones/Code/YouBotMCL/ncore/data/text/DB_IC15_resnet18.onnx",
3 | "recModelPath": "/home/nickybones/Code/YouBotMCL/ncore/data/text/crnn_cs.onnx",
4 | "vocPath": "/home/nickybones/Code/YouBotMCL/ncore/data/text/alphabet_94.txt",
5 | "height": 480,
6 | "width": 640,
7 | "binThresh": 0.3,
8 | "polyThresh" : 0.5,
9 | "maxCandidates" : 50,
10 | "unclipRatio" : 2.0
11 | }
12 |
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/FMap.pgm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/FMap.pgm
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/FMap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/FMap.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/FMap.yaml:
--------------------------------------------------------------------------------
1 | image: FMap.pgm
2 | resolution: 0.05
3 | origin:
4 | - -13.9155
5 | - -10.99537
6 | - 0.0
7 | negate: 0
8 | occupied_thresh: 0.65
9 | free_thresh: 0.196
10 |
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/FMapRoomSeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/FMapRoomSeg.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 1.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 10.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 2.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 3.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 4.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 5.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 6.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 7.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 8.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/TextMaps/Room 9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/Faro/TextMaps/Room 9.png
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/editor.xml:
--------------------------------------------------------------------------------
1 | 22 serialization::archive 17 0 0 0 0 13 0 0 0 8 NotValid 7 general 0 0 0 0 0 6 Room 1 7 general 1 0 0 6 Room 2 7 general 2 0 0 6 Room 3 7 general 3 0 0 6 Room 4 7 general 4 0 0 6 Room 5 7 general 5 0 0 6 Room 6 7 general 6 0 0 6 Room 7 7 general 7 0 0 6 Room 8 7 general 8 0 0 6 Room 9 7 general 9 0 0 7 Room 10 7 general 10 0 0 7 Room 11 7 general 11 0 0 7 Room 12 7 general 12 0 0 0 0 13 0 0 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 7.934500694e+00 -2.795370102e+00 0.000000000e+00 4.334500313e+00 -2.995369911e+00 0.000000000e+00 -6.015499592e+00 -8.453693390e-01 0.000000000e+00 -5.715499878e+00 -3.095369816e+00 0.000000000e+00 -7.815499783e+00 -2.453699112e-01 0.000000000e+00 -1.136549950e+01 -4.195369720e+00 0.000000000e+00 -7.265499592e+00 -4.295369625e+00 0.000000000e+00 -3.665499687e+00 -4.345369816e+00 0.000000000e+00 9.845008850e-01 -4.045369625e+00 0.000000000e+00 9.134501457e+00 -3.945369720e+00 0.000000000e+00 8.345003128e-01 -3.545369625e+00 0.000000000e+00 -1.096549988e+01 -3.995369911e+00 0.000000000e+00
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/floor.config:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "0",
3 | "editor" : "editor.xml",
4 | "roomSeg" : "FMapRoomSeg.png",
5 | "map": {
6 | "type" : "GMap",
7 | "image": "FMap.pgm",
8 | "resolution" : 0.050000,
9 | "origin" : [-13.9155, -10.99537, 0.0],
10 | "negate" : 0,
11 | "occupied_thresh" : 0.65,
12 | "free_thresh" : 0.196
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/nmcl.config:
--------------------------------------------------------------------------------
1 | {
2 | "injRatio": 0.5,
3 | "floorMapPath": "/home/nickybones/Code/OmniNMCL/ncore/data/floor/Faro/floor.config",
4 | "motionModel": "MixedFSR",
5 | "numParticles": 10000,
6 | "predictStrategy": "Uniform",
7 | "resampling": "LowVarianceResampling",
8 | "sensorModel": {
9 | "likelihoodSigma": 2,
10 | "maxRange": 15,
11 | "type": "BeamEnd",
12 | "weightingScheme": 3
13 | },
14 | "tracking": false
15 | }
16 |
--------------------------------------------------------------------------------
/ncore/data/floor/Faro/textspotting.json:
--------------------------------------------------------------------------------
1 | {
2 | "detModelPath": "/home/nickybones/Code/YouBotMCL/ncore/data/text/DB_IC15_resnet18.onnx",
3 | "recModelPath": "/home/nickybones/Code/YouBotMCL/ncore/data/text/crnn_cs.onnx",
4 | "vocPath": "/home/nickybones/Code/YouBotMCL/ncore/data/text/alphabet_94.txt",
5 | "height": 480,
6 | "width": 640,
7 | "binThresh": 0.3,
8 | "polyThresh" : 0.5,
9 | "maxCandidates" : 50,
10 | "unclipRatio" : 2.0
11 | }
12 |
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/GMap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/GMap.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/GMap.yaml:
--------------------------------------------------------------------------------
1 | image: GMap.png
2 | resolution: 0.05
3 | origin:
4 | - -13.90309
5 | - -10.82778
6 | - 0.0
7 | negate: 0
8 | occupied_thresh: 0.65
9 | free_thresh: 0.196
10 |
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/GMapRoomSeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/GMapRoomSeg.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 1.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 10.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 2.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 3.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 4.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 5.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 6.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 7.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 8.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/TextMaps/Room 9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/GMap/TextMaps/Room 9.png
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/editor.xml:
--------------------------------------------------------------------------------
1 | 22 serialization::archive 17 0 0 0 0 13 0 0 0 8 NotValid 7 general 0 0 0 0 0 6 Room 1 7 general 1 0 0 6 Room 2 7 general 2 0 0 6 Room 3 7 general 3 0 0 6 Room 4 7 general 4 0 0 6 Room 5 7 general 5 0 0 6 Room 6 7 general 6 0 0 6 Room 7 7 general 7 0 0 6 Room 8 7 general 8 0 0 6 Room 9 7 general 9 0 0 7 Room 10 7 general 10 0 0 7 Room 11 7 general 11 0 0 7 Room 12 7 general 12 0 0 0 0 13 0 0 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00 0.000000000e+00
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/floor.config:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "0",
3 | "editor" : "editor.xml",
4 | "roomSeg" : "GMapRoomSeg.png",
5 | "map": {
6 | "type" : "GMap",
7 | "image": "GMap.png",
8 | "resolution" : 0.050000,
9 | "origin" : [-13.90309, -10.82778, 0.0],
10 | "negate" : 0,
11 | "occupied_thresh" : 0.65,
12 | "free_thresh" : 0.196
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/ncore/data/floor/GMap/nmcl.config:
--------------------------------------------------------------------------------
1 | {
2 | "injRatio": 0.5,
3 | "floorMapPath": "/home/nickybones/Code/YouBotMCL/ncore/data/floor/GMap/floor.config",
4 | "motionModel": "MixedFSR",
5 | "numParticles": 10000,
6 | "predictStrategy": "Uniform",
7 | "resampling": "LowVarianceResampling",
8 | "sensorModel": {
9 | "likelihoodSigma": 2,
10 | "maxRange": 15,
11 | "type": "BeamEnd",
12 | "weightingScheme": 3
13 | },
14 | "tracking": false
15 | }
16 |
--------------------------------------------------------------------------------
/ncore/data/floor/test/YouBotMap.pgm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/test/YouBotMap.pgm
--------------------------------------------------------------------------------
/ncore/data/floor/test/YouBotMap.yaml:
--------------------------------------------------------------------------------
1 | image: YouBotMap.pgm
2 | resolution: 0.050000
3 | origin: [-17.000000, -12.200000, 0.000000]
4 | negate: 0
5 | occupied_thresh: 0.65
6 | free_thresh: 0.196
7 |
8 |
--------------------------------------------------------------------------------
/ncore/data/floor/test/YouBotMapRoomSeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/floor/test/YouBotMapRoomSeg.png
--------------------------------------------------------------------------------
/ncore/data/floor/test/editor.xml:
--------------------------------------------------------------------------------
1 | 22 serialization::archive 17 0 0 0 0 13 0 0 0 9 Not$Valid 7 general 0 0 0 0 0 6 Room 1 7 general 1 0 0 6 Room 2 7 general 2 0 0 6 Room 3 7 general 3 0 0 6 Room 4 7 general 4 0 0 6 Room 5 7 general 5 0 0 6 Room 6 7 general 6 0 0 6 Room 7 7 general 7 0 0 6 Room 8 7 general 8 0 0 6 Room 9 7 general 9 0 0 7 Room 10 7 general 10 0 0 7 Room 11 7 general 11 0 0 7 Room 12 7 general 12 0 0 0 0 13 0 0 0 0.000000000e+00 0.000000000e+00 0.000000000e+00 -4.800000191e+00 1.950000000e+01 0.000000000e+00 -4.599999428e+00 1.604999924e+01 0.000000000e+00 -6.649999619e+00 6.650000572e+00 0.000000000e+00 -4.050000191e+00 6.250000954e+00 0.000000000e+00 -6.800000191e+00 4.550000191e+00 0.000000000e+00 -2.449999809e+00 4.000005722e-01 0.000000000e+00 -2.849999428e+00 5.100001335e+00 0.000000000e+00 -3.050000191e+00 8.900000572e+00 0.000000000e+00 -3.199999809e+00 1.265000057e+01 0.000000000e+00 -3.899999619e+00 2.225000000e+01 0.000000000e+00 -4.099999428e+00 1.355000019e+01 0.000000000e+00 -3.349999428e+00 8.500003815e-01 0.000000000e+00
--------------------------------------------------------------------------------
/ncore/data/floor/test/floor.config:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "0",
3 | "editor" : "editor.xml",
4 | "roomSeg" : "YouBotMapRoomSeg.png",
5 | "map": {
6 | "type" : "GMap",
7 | "image": "YouBotMap.pgm",
8 | "resolution" : 0.050000,
9 | "origin" : [-17.000000, -12.200000, 0.000000],
10 | "negate" : 0,
11 | "occupied_thresh" : 0.65,
12 | "free_thresh" : 0.196
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/ncore/data/floor/test/floor_seeds.xml:
--------------------------------------------------------------------------------
1 | 22 serialization::archive 17 0 0 0 0 13 0 0 0 1 0 7 general 0 0 0 0 0 1 1 7 general 1 0 0 1 2 7 general 2 0 0 1 3 7 general 3 0 0 1 4 7 general 4 0 0 1 5 7 general 5 0 0 1 6 7 general 6 0 0 1 7 7 general 7 0 0 1 8 7 general 8 0 0 1 9 7 general 9 0 0 2 10 7 general 10 0 0 2 11 7 general 11 0 0 2 12 7 general 12 0 0 0 0 13 0 0 0 -1.700000000e+01 3.579999924e+01 0.000000000e+00 0.000000000e+00 1.580000019e+01 0.000000000e+00 1.000000000e+00 1.230000019e+01 0.000000000e+00 2.000000000e+00 3.300000191e+00 0.000000000e+00 5.000000000e+00 3.300000191e+00 0.000000000e+00 3.000000000e+00 8.000001907e-01 0.000000000e+00 8.000000000e+00 -1.699999809e+00 0.000000000e+00 6.000000000e+00 2.800000191e+00 0.000000000e+00 4.500000000e+00 5.800000191e+00 0.000000000e+00 3.000000000e+00 9.800000191e+00 0.000000000e+00 -5.000000000e-01 1.879999924e+01 0.000000000e+00 1.830000000e+02 1.080000019e+01 0.000000000e+00 7.000000000e+00 -1.699999809e+00 0.000000000e+00
--------------------------------------------------------------------------------
/ncore/data/floor/test/nmcl.config:
--------------------------------------------------------------------------------
1 | {
2 | "injRatio": 1.0,
3 | "floorMapPath": "../data/floor/2021_10_27/floor.config",
4 | "motionModel": "MixedFSR",
5 | "numParticles": 10000,
6 | "predictStrategy": "Uniform",
7 | "resampling": "LowVarianceResampling",
8 | "sensorModel": {
9 | "likelihoodSigma": 2,
10 | "maxRange": 15,
11 | "type": "BeamEnd",
12 | "weightingScheme": 3
13 | },
14 | "tracking": false
15 | }
16 |
--------------------------------------------------------------------------------
/ncore/data/json/nmcl.config:
--------------------------------------------------------------------------------
1 | {
2 | "injRatio": 0.5,
3 | "floorMapPath": "/home/nickybones/Code/YouBotMCL/ncore/data/floor/2021_10_27/floor.config",
4 | "motionModel": "MixedFSR",
5 | "numParticles": 10000,
6 | "predictStrategy": "Uniform",
7 | "resampling": "LowVarianceResampling",
8 | "sensorModel": {
9 | "likelihoodSigma": 8,
10 | "maxRange": 15,
11 | "type": "BeamEnd",
12 | "weightingScheme": 2
13 | },
14 | "tracking": false
15 | }
16 |
--------------------------------------------------------------------------------
/ncore/data/text/lebron.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/text/lebron.jpg
--------------------------------------------------------------------------------
/ncore/data/text/test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/data/text/test.jpg
--------------------------------------------------------------------------------
/ncore/ndl/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0.2)
2 | project(ndl)
3 |
4 | ## Specify additional locations of header files
5 | ## Your package locations should be listed before other locations
6 |
7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
8 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/)
9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
10 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nlohmann_json/include/)
11 |
12 | set(RESULTS_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../build)
13 | file(MAKE_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY})
14 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/lib)
15 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/lib)
16 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/bin)
17 |
18 |
19 | add_subdirectory("src")
20 |
21 |
22 | # After all are setup is done, we can go to our src/ directory to build our
23 | # files
24 | if(BUILD_TESTING)
25 | add_subdirectory("tst")
26 | endif()
27 |
--------------------------------------------------------------------------------
/ncore/ndl/include/ImageUtils.h:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: ImageUtils.h #
9 | # ##############################################################################
10 | **/
11 |
12 | #ifndef IMAGEUTILS
13 | #define IMAGEUTILS
14 |
15 | #include "opencv2/opencv.hpp"
16 | #include
17 |
18 | template
19 | std::vector Unique(cv::Mat img)
20 | {
21 | assert(img.channels() == 1 && "This implementation is only for single-channel images");
22 | cv::Mat in = img.clone();
23 | auto begin = in.begin(), end = in.end();
24 | auto last = std::unique(begin, end); // remove adjacent duplicates to reduce size
25 | std::sort(begin, last); // sort remaining elements
26 | last = std::unique(begin, last); // remove duplicates
27 | return std::vector(begin, last);
28 | }
29 |
30 | cv::Mat ThresholdSingleValue(const cv::Mat& img, int val);
31 |
32 |
33 | //std::vector BoundingBox(const cv::Mat& mask);
34 |
35 | cv::Rect BoundingBox(const cv::Mat& mask);
36 |
37 | cv::Mat DrawRects(const cv::Mat& mask, std::vector bboxes);
38 |
39 |
40 |
41 | #endif
--------------------------------------------------------------------------------
/ncore/ndl/include/TextSpotting.h:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: TextSpotting.h #
9 | # ##############################################################################
10 | **/
11 |
12 | #ifndef TEXTSPOTTING
13 | #define TEXTSPOTTING
14 |
15 | #include
16 | #include
17 | #include "opencv2/opencv.hpp"
18 | #include
19 |
20 |
21 |
22 |
23 | class TextSpotting
24 | {
25 | public:
26 |
27 | TextSpotting(std::string detModelPath, std::string recModelPath, std::string vocPath,
28 | int height = 480, int width = 640, float binThresh = 0.3, float polyThresh = 0.5,
29 | uint maxCandidates = 50, double unclipRatio = 2.0);
30 |
31 | TextSpotting(std::string jsonPath);
32 |
33 | std::vector Infer(const cv::Mat& img);
34 |
35 |
36 | private:
37 |
38 | void fourPointsTransform(const cv::Mat& frame, const cv::Point2f vertices[], cv::Mat& result);
39 | bool sortPts(const cv::Point& p1, const cv::Point& p2);
40 |
41 |
42 | std::shared_ptr o_detector;
43 | std::shared_ptr o_recognizer;
44 |
45 |
46 | };
47 |
48 | #endif
49 |
50 |
51 |
--------------------------------------------------------------------------------
/ncore/ndl/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | add_executable(TextRecoFromFolder TextRecoFromFolder.cpp TextSpotting.cpp)
3 | target_link_libraries(TextRecoFromFolder ${OpenCV_LIBS} ${Boost_LIBRARIES} )
4 |
5 | add_executable(TextRecoFromFolder2 TextRecoFromFolder2.cpp TextSpotting.cpp)
6 | target_link_libraries(TextRecoFromFolder2 ${OpenCV_LIBS} ${Boost_LIBRARIES} )
7 |
8 |
9 | add_library(NDL TextSpotting.cpp ImageUtils.cpp)
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ncore/ndl/src/ImageUtils.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: ImageUtils.cpp #
9 | # ##############################################################################
10 | **/
11 |
12 | #include "ImageUtils.h"
13 |
14 |
15 | cv::Mat ThresholdSingleValue(const cv::Mat& img, int val)
16 | {
17 | cv::Mat mask;
18 | cv::threshold( img, mask, val, 255, 4 );
19 | cv::threshold( mask, mask, val - 1, 255, 0 );
20 |
21 | return mask;
22 | }
23 |
24 | /*
25 | std::vector BoundingBox(const cv::Mat& mask)
26 | {
27 | std::vector bboxes;
28 | std::vector > contours;
29 | std::vector hierarchy;
30 | cv::findContours(mask, contours, hierarchy, cv::RETR_TREE, cv::CHAIN_APPROX_SIMPLE, cv::Point(0, 0));
31 |
32 | for( size_t i = 0; i < contours.size(); i++ )
33 | {
34 | cv::Rect bb = cv::boundingRect(contours[i]);
35 | bboxes.push_back(bb);
36 | }
37 |
38 | return bboxes;
39 | }*/
40 |
41 |
42 | cv::Rect BoundingBox(const cv::Mat& mask)
43 | {
44 | std::vector locations;
45 | cv::findNonZero(mask, locations);
46 | cv::Rect bb = cv::boundingRect(locations);
47 |
48 | return bb;
49 | }
50 |
51 |
52 |
53 | cv::Mat DrawRects(const cv::Mat& mask, std::vector bboxes)
54 | {
55 | cv::RNG rng(12345);
56 | cv::Mat drawing = mask.clone();
57 | cv::cvtColor(drawing,drawing,cv::COLOR_GRAY2BGR);
58 |
59 | for( size_t i = 0; i < bboxes.size(); i++ )
60 | {
61 | cv::Scalar color = cv::Scalar( rng.uniform(0, 256), rng.uniform(0,256), rng.uniform(0,256) );
62 | rectangle(drawing, bboxes[i], color);
63 | }
64 |
65 | return drawing;
66 | }
67 |
--------------------------------------------------------------------------------
/ncore/ndl/src/TextRecoFromFolder.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: TextRecoFromFolder.cpp #
9 | # ##############################################################################
10 | **/
11 |
12 |
13 |
14 | #include "TextSpotting.h"
15 | #include
16 | #include
17 | #include
18 |
19 | int main(int argc, char** argv)
20 | {
21 | std::string jsonPath = "/home/nickybones/Code/YouBotMCL/ncore/data/text/textspotting.config";
22 |
23 | for(int c = 0; c < 4; ++c)
24 | {
25 | std::string ImgDirPath = "/home/nickybones/data/MCL/Dump/camera" + std::to_string(c) + "/";
26 | std::string outputPath = "/home/nickybones/data/MCL/Dump/predictions" + std::to_string(c) + ".txt";
27 | TextSpotting ts = TextSpotting(jsonPath);
28 | std::vector filenames;
29 |
30 | std::ofstream output;
31 | output.open(outputPath);
32 |
33 | for (const auto & entry : boost::filesystem::directory_iterator(ImgDirPath))
34 | {
35 | std::string imgPath = entry.path().string();
36 | std::string extension = boost::filesystem::extension(imgPath);
37 | if(extension == ".png") filenames.push_back(imgPath);
38 | else std::cout << extension << std::endl;
39 | }
40 |
41 | std::sort(filenames.begin(), filenames.end());
42 |
43 | for (int f = 0; f < filenames.size(); ++f)
44 | {
45 | std::string imgPath = filenames[f];
46 | std::cout << imgPath << std::endl;
47 | cv::Mat img = cv::imread(imgPath);
48 | try
49 | {
50 | std::vector recRes = ts.Infer(img);
51 | for (int i = 0; i < recRes.size(); ++i)
52 | {
53 | output << recRes[i] + ", ";
54 | }
55 | }
56 | catch(...)
57 | {
58 | std::cerr << "failed to infer" << std::endl;
59 |
60 | }
61 | output << "\n";
62 |
63 | }
64 |
65 | output.close();
66 | }
67 |
68 | return 0;
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/ncore/ndl/src/TextRecoFromFolder2.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: TextRecoFromFolder.cpp #
9 | # ##############################################################################
10 | **/
11 |
12 |
13 |
14 | #include "TextSpotting.h"
15 | #include
16 | #include
17 | #include
18 |
19 | int main(int argc, char** argv)
20 | {
21 | std::string jsonPath = "/home/nickybones/Code/YouBotMCL/ncore/data/text/textspotting.config";
22 |
23 |
24 | std::string ImgDirPath = "/home/nickybones/data/MCL/Dump/camera/";
25 | std::string outputPath = "/home/nickybones/data/MCL/Dump/predictions.txt";
26 | TextSpotting ts = TextSpotting(jsonPath);
27 | std::vector filenames;
28 |
29 | std::ofstream output;
30 | output.open(outputPath);
31 |
32 | for (const auto & entry : boost::filesystem::directory_iterator(ImgDirPath))
33 | {
34 | std::string imgPath = entry.path().string();
35 | std::string extension = boost::filesystem::extension(imgPath);
36 | if(extension == ".png") filenames.push_back(imgPath);
37 | else std::cout << extension << std::endl;
38 | }
39 |
40 | std::sort(filenames.begin(), filenames.end());
41 |
42 | for (int f = 0; f < filenames.size(); ++f)
43 | {
44 | std::string imgPath = filenames[f];
45 | std::cout << imgPath << std::endl;
46 | cv::Mat img = cv::imread(imgPath);
47 | try
48 | {
49 | std::vector recRes = ts.Infer(img);
50 | for (int i = 0; i < recRes.size(); ++i)
51 | {
52 | output << recRes[i] + ", ";
53 | }
54 | }
55 | catch(...)
56 | {
57 | std::cerr << "failed to infer" << std::endl;
58 | }
59 | output << "\n";
60 |
61 | }
62 |
63 | output.close();
64 |
65 |
66 | return 0;
67 | }
68 |
69 |
--------------------------------------------------------------------------------
/ncore/ndl/tst/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | add_executable(NDLUnitTests NDLUnitTests.cpp)
5 | target_link_libraries(NDLUnitTests ${OpenCV_LIBS} NDL GTest::GTest gtest_main )
6 | target_compile_definitions(NDLUnitTests PRIVATE PROJECT_TEST_DATA_DIR="${PROJECT_SOURCE_DIR}/../data")
7 | add_test(AllTestsInTests NDLUnitTests)
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ncore/ndl/tst/NDLUnitTests.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: NDLUnitTests.cpp #
9 | # ##############################################################################
10 | **/
11 |
12 | #include "gtest/gtest.h"
13 | #include "TextSpotting.h"
14 | #include "ImageUtils.h"
15 | #include
16 |
17 | std::string textDataPath = PROJECT_TEST_DATA_DIR + std::string("/text/");
18 |
19 |
20 |
21 | TEST(TextSpotting, test1) {
22 |
23 | std::string imgPath = textDataPath + "test.jpg";
24 | cv::Mat frame = cv::imread(imgPath);
25 | TextSpotting ts = TextSpotting(textDataPath + "textspotting.config");
26 | std::vector texts = ts.Infer(frame);
27 | /* for(int i = 0; i < texts.size(); ++i)
28 | {
29 | std::cout << texts[i] << std::endl;
30 | }*/
31 | ASSERT_EQ("JAMES", texts[1]);
32 | }
33 |
34 |
35 | int main(int argc, char **argv) {
36 | ::testing::InitGoogleTest(&argc, argv);
37 | return RUN_ALL_TESTS();
38 | }
39 |
40 |
41 |
--------------------------------------------------------------------------------
/ncore/nengine/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0.2)
2 | project(nengine)
3 |
4 | ## Specify additional locations of header files
5 | ## Your package locations should be listed before other locations
6 |
7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
8 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/)
9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
10 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nsensors/include/)
11 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nmap/include/)
12 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nlohmann_json/include/)
13 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nmcl/include/)
14 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../ndl/include/)
15 |
16 |
17 | set(PYTHON_INCLUDE_DIR "/usr/include/python3.8")
18 |
19 | find_package (Python COMPONENTS Interpreter Development)
20 | if(Python_FOUND)
21 | message(STATUS "Found Python version ${Python_VERSION}")
22 | include_directories(${PYTHON_INCLUDE_DIR})
23 | endif(Python_FOUND)
24 |
25 | set(RESULTS_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../build)
26 | file(MAKE_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY})
27 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/lib)
28 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/lib)
29 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/bin)
30 |
31 |
32 |
33 |
34 | add_subdirectory("src")
35 | #add_library(NSENSORS STATIC IMPORTED)
36 | set_target_properties(NSENSORS PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../build/lib/libNSENSORS.a)
37 | set_target_properties(NMAP PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../build/lib/libNMAP.a)
38 | set_target_properties(NMAP PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../build/lib/libNMCL.a)
39 | set_target_properties(NMAP PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../build/lib/libNDL.a)
40 |
41 |
42 | # After all are setup is done, we can go to our src/ directory to build our
43 | # files
44 | if(BUILD_TESTING)
45 | add_subdirectory("tst")
46 | endif()
47 |
--------------------------------------------------------------------------------
/ncore/nengine/include/DataFrameLoader.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include "Python.h"
3 | #include
4 | #include
5 | #include
6 |
7 | #include
8 |
9 |
10 |
11 | enum FrameTypes
12 | {
13 | CAMERA0 = 0,
14 | CAMERA1 = 1,
15 | CAMERA2 = 2,
16 | CAMERA3 = 3,
17 | SEM0 = 4,
18 | SEM1 = 5,
19 | SEM2 = 6,
20 | SEM3 = 7,
21 | TEXT0 = 8,
22 | TEXT1 = 9,
23 | TEXT2 = 10,
24 | TEXT3 = 11,
25 | LIDAR = 12,
26 | ODOM = 13,
27 | GT = 14
28 | };
29 |
30 |
31 |
32 | struct FrameData
33 | {
34 | FrameTypes type;
35 | unsigned long stamp;
36 | Eigen::Vector3f gt;
37 | std::string path;
38 | Eigen::Vector3f odom;
39 | std::vector scan;
40 | std::vector places;
41 | std::vector boxes;
42 | };
43 |
44 |
45 |
46 | class DataFrameLoader
47 | {
48 | public:
49 | DataFrameLoader(const std::string& moduleFolder, const std::string& moduleName);
50 |
51 | void Load(const std::string& picklePath);
52 |
53 | FrameData GetData(unsigned long index);
54 |
55 | int GetNumFrames();
56 |
57 |
58 | ~DataFrameLoader();
59 |
60 |
61 | private:
62 |
63 | const char * get_type(unsigned long ind);
64 | unsigned long get_stamp(unsigned long ind);
65 | PyObject * get_data(unsigned long ind);
66 | static std::vector listTupleToVector_Float(PyObject* incoming);
67 |
68 |
69 | PyObject *pDict;
70 | PyObject *dfObject;
71 |
72 | };
73 |
74 |
--------------------------------------------------------------------------------
/ncore/nengine/include/NMCLEngine.h:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #include "ReNMCL.h"
5 | #include "TextSpotting.h"
6 | #include "PlaceRecognition.h"
7 | #include "Camera.h"
8 | #include
9 |
10 |
11 |
12 | class NMCLEngine
13 | {
14 | public:
15 |
16 | NMCLEngine(const std::string& nmclConfigPath, const std::string& sensorConfigFolder, const std::string& textMapDir);
17 |
18 | void Predict(Eigen::Vector3f odom);
19 |
20 | int Correct(const std::vector& scan);
21 |
22 | void TextMask(const cv::Mat& img, int camID);
23 |
24 | void TextMask(std::vector& places, int camID);
25 |
26 |
27 | SetStatistics PoseEstimation() const
28 | {
29 | return o_renmcl->Stats();
30 | }
31 |
32 | std::vector Particles() const
33 | {
34 | return o_renmcl->Particles();
35 | }
36 |
37 | std::vector ScanMask() const
38 | {
39 | return o_scanMask;
40 | }
41 |
42 |
43 | private:
44 |
45 |
46 |
47 | std::shared_ptr o_textSpotter;
48 | std::shared_ptr o_renmcl;
49 | std::shared_ptr o_placeRec;
50 | Eigen::Vector3f o_wheelPrevPose = Eigen::Vector3f(0, 0, 0);
51 | std::vector o_scanMask;
52 | bool o_first = true;
53 | int o_dsFactor = 1;
54 | Eigen::Vector3f o_odomNoise = Eigen::Vector3f(0.02, 0.02, 0.02);
55 | std::vector o_odomWeights = {1.0};
56 | float o_triggerDist = 0.05;
57 | float o_triggerAngle = 0.05;
58 | bool o_step = false;
59 | bool o_initPose = true;
60 |
61 |
62 | std::vector> o_cameras;
63 | //std::vector textMaps;
64 | std::vector o_textBBs;
65 | std::vector o_textOrientations;
66 | int o_lastDetectedCamera = -1;
67 | int o_lastDetectedMatch = -1;
68 | };
69 |
--------------------------------------------------------------------------------
/ncore/nengine/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(NEGNINE NMCLEngine.cpp DataFrameLoader.cpp)
--------------------------------------------------------------------------------
/ncore/nengine/src/df_loader.py:
--------------------------------------------------------------------------------
1 | import pandas as pd
2 |
3 |
4 | def load_pickle(picklePth):
5 | df = pd.read_pickle(picklePth)
6 | print(df.head(10))
7 | return df
8 |
9 |
10 | def get_type(df, ind):
11 | row = df.iloc[ind]
12 | strg = row['type']
13 | return strg
14 |
15 | def get_stamp(df, ind):
16 | row = df.iloc[ind]
17 | t = row['t']
18 | return t
19 |
20 | def get_data(df, ind):
21 | row = df.iloc[ind]
22 | d = row['data']
23 | if type(d) is tuple:
24 | return d
25 | elif type(d) is str:
26 | return d
27 | elif type(d) is list:
28 | return d
29 | else:
30 | d = d.tolist()
31 | return d
32 |
33 | def num_frames(df):
34 | num = len(df.index)
35 | return num
--------------------------------------------------------------------------------
/ncore/nengine/tst/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_executable(NEngineTests main.cpp)
2 | target_link_libraries(NEngineTests NEGNINE ${Python_LIBRARIES} ${OpenCV_LIBS} NSENSORS NMAP NMCL NDL nlohmann_json::nlohmann_json ${Boost_LIBRARIES})
3 |
4 | add_executable(EngineBenchmark EngineBenchmark.cpp)
5 | target_link_libraries(EngineBenchmark NEGNINE ${Python_LIBRARIES} ${OpenCV_LIBS} NSENSORS NMAP NMCL NDL nlohmann_json::nlohmann_json ${Boost_LIBRARIES})
6 |
--------------------------------------------------------------------------------
/ncore/nengine/tst/EngineBenchmark.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include "NMCLEngine.h"
9 | #include "Utils.h"
10 | #include
11 | #include
12 |
13 | #include "DataFrameLoader.h"
14 |
15 | std::vector GenerateRandomScan()
16 | {
17 | std::vector scan;
18 | int max_dist = 10;
19 | for(int i = 0; i < 2082; ++i)
20 | {
21 | float x = drand48() * (2 * max_dist) - max_dist;
22 | float y = drand48() * (2 * max_dist) - max_dist;
23 | float theta = drand48() * 2 * M_PI - M_PI;
24 | scan.push_back(Eigen::Vector3f(x, y, theta));
25 | }
26 | return scan;
27 | }
28 |
29 |
30 |
31 |
32 |
33 | int main(int argc, char** argv)
34 | {
35 | std::string moduleFolder = "/home/nuc20/Code/YouBotMCL/ncore/nengine/src";
36 | std::string moduleName = "df_loader";
37 | std::string sensorConfigFolder = "/home/nuc20/Code/YouBotMCL/ros1_ws/src/nmcl_ros/config/480x640/";
38 | std::string nmclConfigFile = "/home/nuc20/Code/YouBotMCL/ncore/data/floor/Faro/nmcl.config";
39 | std::string textMapDir = "/home/nuc20/Code/YouBotMCL/ncore/data/floor/Faro/TextMaps/";
40 | std::string dataFolder = "/home/nuc20/data/MCL/2022_01_14/Run2/";
41 | std::string pickleName = "textgtmerged.pickle";
42 |
43 | DataFrameLoader df(moduleFolder, moduleName);
44 | df.Load(dataFolder + pickleName);
45 | int numFrames = df.GetNumFrames();
46 |
47 | int count = 0;
48 | srand48(1);
49 | NMCLEngine engine(nmclConfigFile, sensorConfigFolder, textMapDir);
50 | auto millis = 0;
51 | for(int i = 0; i < numFrames; ++i)
52 | {
53 | FrameData fd = df.GetData(i);
54 | // std::vector scan = GenerateRandomScan();
55 |
56 | if (fd.type == FrameTypes::LIDAR)
57 | {
58 | std::vector scan = fd.scan;
59 | auto start = std::chrono::system_clock::now();
60 | int ret = engine.Correct(scan);
61 | auto end = std::chrono::system_clock::now();
62 | std::chrono::duration duration = end - start;
63 | if(ret)
64 | {
65 | if (count > 499) break;
66 | ++count;
67 | millis += std::chrono::duration_cast(duration).count();
68 | std::cout << std::chrono::duration_cast(duration).count() << std::endl;
69 | }
70 | }
71 |
72 | }
73 |
74 | std::cout << "finished computation at " << millis/500 << std::endl;
75 |
76 |
77 |
78 | return 0;
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/ncore/nmap/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0.2)
2 | project(nmap)
3 |
4 |
5 |
6 |
7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
8 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/)
9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
10 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nsensors/include/)
11 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nlohmann_json/include/)
12 |
13 | set(RESULTS_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../build)
14 | file(MAKE_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY})
15 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/lib)
16 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/lib)
17 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RESULTS_OUTPUT_DIRECTORY}/bin)
18 |
19 |
20 |
21 | add_subdirectory("src")
22 | #add_library(NSENSORS STATIC IMPORTED)
23 | #set_target_properties(NSENSORS PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../build/lib/libNSENSORS.a)
24 |
25 |
26 | # After all are setup is done, we can go to our src/ directory to build our
27 | # files
28 | if(BUILD_TESTING)
29 | add_subdirectory("tst")
30 | endif()
31 |
--------------------------------------------------------------------------------
/ncore/nmap/data/YouBotMap.pgm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/nmap/data/YouBotMap.pgm
--------------------------------------------------------------------------------
/ncore/nmap/data/YouBotMap.yaml:
--------------------------------------------------------------------------------
1 | image: YouBotMap.pgm
2 | resolution: 0.050000
3 | origin: [-15.400000, -33.000000, 0.000000]
4 | negate: 0
5 | occupied_thresh: 0.65
6 | free_thresh: 0.196
7 |
8 |
--------------------------------------------------------------------------------
/ncore/nmap/data/YouBotMapRoomSeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PRBonn/tmcl/cce63cdd278a37a77599b8c3b2c2aa4bf112b150/ncore/nmap/data/YouBotMapRoomSeg.png
--------------------------------------------------------------------------------
/ncore/nmap/include/FloorMap.h:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: FloorMap.h #
9 | # ##############################################################################
10 | **/
11 |
12 | #ifndef FLOORMAP
13 | #define FLOORMAP
14 | #pragma once
15 |
16 | #include
17 | #include
18 |
19 | #include "GMap.h"
20 | #include "Room.h"
21 | #include "Lift.h"
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | class FloorMap
28 | {
29 | public:
30 |
31 | FloorMap(std::shared_ptr gmap, cv::Mat& roomSeg, std::string name = "0");
32 |
33 | FloorMap(std::string jsonPath);
34 |
35 |
36 | int GetRoomID(float x, float y);
37 |
38 | std::string Name() const
39 | {
40 | return o_name;
41 | }
42 |
43 | Room& GetRoom(int id)
44 | {
45 | return o_rooms[id];
46 | }
47 |
48 | std::vector& GetRooms()
49 | {
50 | return o_rooms;
51 | }
52 |
53 | std::vector GetRoomNames();
54 |
55 | const std::vector>& Neighbors()
56 | {
57 | return o_neighbors;
58 | }
59 |
60 | // returned seeds in world coordinates
61 | const std::vector& Seeds() const
62 | {
63 | return o_seeds;
64 | }
65 |
66 | // returned seed in world coordinates
67 | const Eigen::Vector3f& Seed(int id) const
68 | {
69 | return o_seeds[id];
70 | }
71 |
72 | // input seed in world coordinates
73 | void Seed(int id, const Eigen::Vector3f& seed)
74 | {
75 | o_seeds[id] = seed;
76 | }
77 |
78 | // input seed in map ccordinates
79 | void Seed(int id, const Eigen::Vector2f& seed);
80 |
81 | // input seeds in world coordinates
82 | void Seeds(std::vector seeds)
83 | {
84 | o_seeds = seeds;
85 | }
86 |
87 | const std::shared_ptr& Map() const
88 | {
89 | return o_map;
90 | }
91 |
92 |
93 |
94 | cv::Mat ColorizeRoomSeg();
95 | void findNeighbours();
96 |
97 |
98 | private:
99 |
100 | friend class boost::serialization::access;
101 | template
102 | void serialize(Archive & ar, const unsigned int version)
103 | {
104 | ar & o_rooms;
105 | ar & o_seeds;
106 | }
107 |
108 | void extractRoomSegmentation();
109 | std::vector extractRoomIDs();
110 | //void fingNeighbours();
111 |
112 |
113 | std::string o_name = "0";
114 | std::shared_ptr o_map;
115 | cv::Mat o_roomSeg;
116 | std::vector o_rooms;
117 | //std::vector o_lifts;
118 | std::vector> o_neighbors;
119 | std::vector o_seeds;
120 |
121 |
122 | };
123 |
124 | #endif // !FLOORMAP
125 |
126 |
--------------------------------------------------------------------------------
/ncore/nmap/include/GMap.h:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: GMap.h #
9 | # ##############################################################################
10 | **/
11 |
12 |
13 | #ifndef GMAP
14 | #define GMAP
15 |
16 | #include "opencv2/opencv.hpp"
17 | #include
18 | #include "IMap2D.h"
19 |
20 | class GMap : public IMap2D
21 | {
22 | public:
23 |
24 | //! A constructor for handling the output of Gmapping, which include a metadata yaml and a .pgm map
25 | /*!
26 | \param origin is the 2D pose of the bottom right corner of the map (found in the yaml)
27 | \param resolution is the map resolution - distance in meters corresponding to 1 pixel (found in the yaml)
28 | \param gridMap is occupancy map built according to the scans
29 | */
30 | GMap(cv::Mat& gridMap, Eigen::Vector3f origin, float resolution);
31 |
32 |
33 | //! A constructor for handling the output of Gmapping, which include a metadata yaml and a .pgm map
34 | /*!
35 | \param yamlPath is the path to the metadata yaml file produced by gmapping
36 | */
37 | GMap(std::string yamlPath);
38 |
39 |
40 | //! A getter top left corner of the actual occupied area, as the map usually has wide empty margins
41 | /*!
42 | \return Eigen::Vector2f = (u, v) pixel coordinates for the gridmap
43 | */
44 | Eigen::Vector2f TopLeft()
45 | {
46 | return o_topLeft;
47 | }
48 |
49 |
50 | //! A getter bottom right corner of the actual occupied area, as the map usually has wide empty margins
51 | /*!
52 | \return Eigen::Vector2f = (u, v) pixel coordinates for the gridmap
53 | */
54 | Eigen::Vector2f BottomRight()
55 | {
56 | return o_bottomRight;
57 | }
58 |
59 |
60 | //! Converts (x, y) from the map frame to the pixels coordinates
61 | /*!
62 | \param (x, y) position in map frame
63 | \return (u, v) pixel coordinates for the gridmap
64 | */
65 | Eigen::Vector2f World2Map(Eigen::Vector2f xy);
66 |
67 |
68 | std::vector World2Map(std::vector xyPoints);
69 |
70 |
71 | //! Converts (u, v) pixel coordinates to map frame (x, y)
72 | /*!
73 | \param (u, v) pixel coordinates for the gridmap
74 | \return (x, y) position in map frame
75 | */
76 | Eigen::Vector2f Map2World(Eigen::Vector2f uv);
77 |
78 |
79 | const cv::Mat& Map() const
80 | {
81 | return o_gridmap;
82 | }
83 |
84 |
85 | private:
86 |
87 | //std::shared_ptr o_gridmap;
88 | cv::Mat o_gridmap;
89 | float o_resolution = 0;
90 | int o_maxy = 0;
91 | Eigen::Vector3f o_origin;
92 | Eigen::Vector2f o_bottomRight;
93 | Eigen::Vector2f o_topLeft;
94 |
95 | void getBorders();
96 |
97 | };
98 |
99 | #endif //GMap
100 |
101 |
--------------------------------------------------------------------------------
/ncore/nmap/include/IMap2D.h:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: IMap2D.h #
9 | # ##############################################################################
10 | **/
11 |
12 | #ifndef IMAP2D_H
13 | #define IMAP2D_H
14 |
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | class IMap2D
21 | {
22 | public:
23 |
24 |
25 | //! Converts (x, y) from the map frame to the pixels coordinates
26 | /*!
27 | \param (x, y) position in map frame
28 | \return (u, v) pixel coordinates for the gridmap
29 | */
30 | virtual Eigen::Vector2f World2Map(Eigen::Vector2f xy) = 0;
31 |
32 |
33 | //! Converts a vector of (x, y) from the map frame to the pixels coordinates
34 | /*!
35 | \param vector of (x, y) positions in map frame
36 | \return vector of (u, v) pixel coordinates for the gridmap
37 | */
38 | virtual std::vector World2Map(std::vector xyPoints) = 0;
39 |
40 |
41 | //! Converts (u, v) pixel coordinates to map frame (x, y)
42 | /*!
43 | \param (u, v) pixel coordinates for the gridmap
44 | \return (x, y) position in map frame
45 | */
46 | virtual Eigen::Vector2f Map2World(Eigen::Vector2f uv) = 0;
47 |
48 |
49 | virtual ~IMap2D() {};
50 |
51 |
52 | virtual const cv::Mat& Map() const = 0;
53 |
54 |
55 | };
56 |
57 | #endif // IMap2D
--------------------------------------------------------------------------------
/ncore/nmap/include/Lift.h:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | # ##############################################################################
4 | # Copyright (c) 2021- University of Bonn #
5 | # All rights reserved. #
6 | # #
7 | # Author: Nicky Zimmerman #
8 | # #
9 | # File: Lift.h #
10 | # ##############################################################################
11 | **/
12 |
13 |
14 | #ifndef LIFT
15 | #define LIFT
16 |
17 |
18 | #pragma once
19 | class Lift
20 | {
21 | };
22 |
23 | #endif // !LIFT
24 |
25 |
--------------------------------------------------------------------------------
/ncore/nmap/include/Object.h:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: Object.h #
9 | # ##############################################################################
10 | **/
11 |
12 |
13 | #ifndef OBJECT
14 | #define OBJECT
15 |
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 |
22 | #pragma once
23 | class Object
24 | {
25 |
26 | public:
27 |
28 |
29 | Object(int semLabel, Eigen::Vector3f pose = Eigen::Vector3f(), std::string modelPath = "");
30 |
31 | Object();
32 |
33 |
34 | int ID() const
35 | {
36 | return o_id;
37 | }
38 |
39 | int SemLabel() const
40 | {
41 | return o_semLabel;
42 | }
43 |
44 | void SemLabel(int semLabel)
45 | {
46 | o_semLabel = semLabel;
47 | }
48 |
49 | Eigen::Vector3f Pose() const
50 | {
51 | return o_pose;
52 | }
53 |
54 | void Pose(Eigen::Vector3f pose)
55 | {
56 | o_pose = pose;
57 | }
58 |
59 | std::string ModelPath() const
60 | {
61 | return o_modelPath;
62 | }
63 |
64 | void ModelPath(std::string modelPath)
65 | {
66 | o_modelPath = modelPath;
67 | //loadModel();
68 | }
69 |
70 | private:
71 |
72 | friend class boost::serialization::access;
73 | template
74 | void serialize(Archive & ar, const unsigned int version)
75 | {
76 | ar & o_id;
77 | ar & o_semLabel;
78 | ar & o_pose;
79 | ar & o_modelPath;
80 | }
81 |
82 | static int generateID();
83 | void loadModel();
84 |
85 | int o_id;
86 | int o_semLabel;
87 | Eigen::Vector3f o_pose;
88 | std::string o_modelPath;
89 | };
90 |
91 |
92 | namespace boost {
93 | namespace serialization {
94 |
95 | template
96 | void serialize(Archive & ar, Eigen::Vector3f & pose, const unsigned int version)
97 | {
98 | ar & pose(0);
99 | ar & pose(1);
100 | ar & pose(2);
101 | }
102 |
103 | } // namespace serialization
104 | } // namespace boost
105 |
106 |
107 | #endif // !OBJECT
108 |
109 |
110 |
--------------------------------------------------------------------------------
/ncore/nmap/include/Room.h:
--------------------------------------------------------------------------------
1 | /**
2 | # ##############################################################################
3 | # Copyright (c) 2021- University of Bonn #
4 | # All rights reserved. #
5 | # #
6 | # Author: Nicky Zimmerman #
7 | # #
8 | # File: Room.h #
9 | # ##############################################################################
10 | **/
11 |
12 | #ifndef ROOM
13 | #define ROOM
14 |
15 | #pragma once
16 |
17 | #include
18 | #include
19 | #include "Object.h"
20 |
21 | #include
22 | #include
23 | #include
24 |
25 |
26 | class Room
27 | {
28 | public:
29 |
30 | Room(std::string name, int id, std::string purpose = "general");
31 |
32 | Room() {};
33 |
34 | std::string Name() const
35 | {
36 | return o_name;
37 | }
38 |
39 |
40 | void Name(std::string name)
41 | {
42 | o_name = name;
43 | }
44 |
45 | std::string Purpose() const
46 | {
47 | return o_purpose;
48 | }
49 |
50 | int ID() const
51 | {
52 | return o_id;
53 | }
54 |
55 | const std::vector