Repository: Navigine/Indoor-Positioning-And-Navigation-Algorithms
Branch: master
Commit: 67e11c4d398a
Files: 149
Total size: 418.2 KB
Directory structure:
gitextract_n3y_rmqw/
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── custom.md
│ │ └── feature_request.md
│ └── workflows/
│ ├── macos.yml
│ └── ubuntu.yml
├── .gitignore
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── include/
│ └── navigine/
│ └── navigation-core/
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── barriers_geometry_builder.h
│ ├── boost_geometry_adaptation.h
│ ├── declare_identifier.h
│ ├── geolevel.h
│ ├── graph.h
│ ├── graph_particle.h
│ ├── level.h
│ ├── level_collector.h
│ ├── level_geometry.h
│ ├── location_point.h
│ ├── logger.h
│ ├── motion_info.h
│ ├── navigation_client.h
│ ├── navigation_input.h
│ ├── navigation_output.h
│ ├── navigation_settings.h
│ ├── navigation_state.h
│ ├── point.h
│ ├── radiomap.h
│ ├── reference_point.h
│ ├── transmitter.h
│ ├── vector3d.h
│ ├── version.h
│ └── xy_particle.h
├── src/
│ ├── README
│ ├── barriers_geometry_builder.cpp
│ ├── device_properties.h
│ ├── geometry.cpp
│ ├── geometry.h
│ ├── knn/
│ │ ├── knn_utils.cpp
│ │ └── knn_utils.h
│ ├── level.cpp
│ ├── level_collector.cpp
│ ├── level_estimator/
│ │ ├── barometer.cpp
│ │ ├── barometer.h
│ │ ├── level_estimator.cpp
│ │ ├── level_estimator.h
│ │ ├── level_estimator_radiomap.cpp
│ │ ├── level_estimator_radiomap.h
│ │ ├── level_estimator_transmitters.cpp
│ │ ├── level_estimator_transmitters.h
│ │ ├── level_history.cpp
│ │ └── level_history.h
│ ├── level_geometry.cpp
│ ├── likelihood/
│ │ ├── likelihood.cpp
│ │ ├── likelihood.h
│ │ ├── likelihood_radiomap.cpp
│ │ └── likelihood_radiomap.h
│ ├── measurement_types.h
│ ├── measurements/
│ │ ├── measurement_preprocessor.cpp
│ │ └── measurement_preprocessor.h
│ ├── navigation_client_impl.cpp
│ ├── navigation_client_impl.h
│ ├── navigation_error_codes.h
│ ├── point.cpp
│ ├── position.h
│ ├── position_estimator/
│ │ ├── Readme.md
│ │ ├── docs/
│ │ │ └── KNN.md
│ │ ├── position_estimator.h
│ │ ├── position_estimator_knn.cpp
│ │ ├── position_estimator_knn.h
│ │ ├── position_estimator_outdoor.cpp
│ │ ├── position_estimator_outdoor.h
│ │ ├── position_estimator_zone.cpp
│ │ └── position_estimator_zone.h
│ ├── position_postprocessor/
│ │ ├── navigation_time_smoother.cpp
│ │ ├── navigation_time_smoother.h
│ │ ├── polynomial_fit.cpp
│ │ ├── polynomial_fit.h
│ │ ├── position_postprocessor.cpp
│ │ ├── position_postprocessor.h
│ │ ├── position_smoother.h
│ │ ├── position_smoother_ab.cpp
│ │ ├── position_smoother_ab.h
│ │ ├── position_smoother_lstsq.cpp
│ │ └── position_smoother_lstsq.h
│ ├── radiomap.cpp
│ ├── sensor_fusion/
│ │ ├── complementary_filter.cpp
│ │ ├── complementary_filter.h
│ │ ├── pedometer.cpp
│ │ ├── pedometer.h
│ │ ├── quaternion.cpp
│ │ ├── quaternion.h
│ │ ├── sensor_fusion.cpp
│ │ └── sensor_fusion.h
│ ├── triangulation.cpp
│ ├── triangulation.h
│ ├── trilateration.cpp
│ ├── trilateration.h
│ └── vector3d.cpp
├── standalone_algorithms/
│ ├── README.md
│ ├── System description.md
│ ├── complementary_filter/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── examples/
│ │ │ └── main.cpp
│ │ ├── helpers/
│ │ │ └── plot_angles.py
│ │ ├── include/
│ │ │ ├── complementary_filter.h
│ │ │ ├── quaternion.h
│ │ │ └── vector3d.h
│ │ ├── src/
│ │ │ ├── complementary_filter.cpp
│ │ │ ├── quaternion.cpp
│ │ │ └── vector3d.cpp
│ │ └── tests/
│ │ └── complementary_filter_test.cpp
│ ├── pedometer/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── examples/
│ │ │ └── main.cpp
│ │ ├── include/
│ │ │ ├── pedometer.h
│ │ │ └── vector3d.h
│ │ ├── src/
│ │ │ ├── pedometer.cpp
│ │ │ └── vector3d.cpp
│ │ └── tests/
│ │ └── pedometer_test.cpp
│ ├── position_estimation/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── examples/
│ │ │ └── main.cpp
│ │ ├── helpers/
│ │ │ └── plot_positions.py
│ │ ├── include/
│ │ │ ├── measurement_preprocessor.h
│ │ │ ├── navigation_structures.h
│ │ │ ├── nearest_transmitter_estimator.h
│ │ │ ├── position_smoother.h
│ │ │ └── transmitter.h
│ │ ├── logs/
│ │ │ └── transmitters.txt
│ │ └── src/
│ │ ├── measurement_preprocessor.cpp
│ │ ├── nearest_transmitter_estimator.cpp
│ │ └── position_smoother.cpp
│ └── trilateteration/
│ ├── CMakeLists.txt
│ ├── README.md
│ └── src/
│ ├── beacon.cpp
│ ├── beacon.h
│ ├── test_trilateration.cpp
│ ├── test_trilateration.h
│ ├── trilateration.cpp
│ └── trilateration.h
├── tests/
│ └── navigation_test.cpp
└── tools/
└── verification/
├── helpers.cpp
└── helpers.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/custom.md
================================================
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''
---
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/workflows/macos.yml
================================================
name: macOS
on:
push:
branches:
- dev
- master
pull_request:
jobs:
xcode:
runs-on: macos-10.15
strategy:
matrix:
xcode: [12.4, 12.3, 12.2, 12.1.1, 12.1, 12]
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- uses: actions/checkout@v2
# install dependencies
- name: boost
run: brew install boost
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
================================================
FILE: .github/workflows/ubuntu.yml
================================================
name: Ubuntu
on:
push:
branches:
- dev
- master
pull_request:
jobs:
ci_test_clang:
runs-on: ubuntu-latest
steps:
# install dependencies
- name: boost
run: sudo apt-get update && sudo apt-get install libboost-all-dev
- uses: actions/checkout@v2
- name: install_ninja
run: |
sudo apt update
sudo apt install ninja-build
shell: bash
- name: install_clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
sudo apt-get install clang-tools-11
shell: bash
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build
ci_test_gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# install dependencies
- name: boost
run: sudo apt-get update && sudo apt-get install libboost-all-dev
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build
================================================
FILE: .gitignore
================================================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
*.sdf
*.pdb
*.sbr
*.obj
*.tlog
*.ilk
*.log
*.idb
*.bsc
*.opensdf
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
[Bb][Uu][Ii][Ll][Dd]/
.vscode/
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.7)
project(Navigation-core)
include(FetchContent)
FetchContent_Declare(json
GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git
GIT_TAG v3.10.3)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_Declare(
Eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG master
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)
set(EIGEN_BUILD_DOC OFF)
set(BUILD_TESTING OFF)
set(EIGEN_BUILD_PKGCONFIG OFF)
set( OFF)
FetchContent_MakeAvailable(Eigen)
set(BOOST_ENABLE_CMAKE ON)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED)
IF (Boost_FOUND)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
message(${Boost_INCLUDE_DIR})
include_directories(${Boost_SOURCE_DIR})
ENDIF ()
#tests:navigation_test
set("target" "navigation_test")
list(APPEND "${target}__cxx_srcs"
"tests/navigation_test.cpp"
"tools/verification/helpers.cpp")
add_executable("${target}" ${${target}__cxx_srcs})
target_include_directories("${target}" PRIVATE
"tests/include/"
"tests/build/"
"include/")
set_property(TARGET "${target}" PROPERTY CXX_STANDARD 17)
set_target_properties("${target}" PROPERTIES COMPILE_DEFINITIONS "BUILD_FOR_LINUX;_DEBUG;")
set_target_properties("${target}" PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -funwind-tables -fPIC -pipe -m64 -march=x86-64 -fstack-protector-strong -pthread -O3 -fno-omit-frame-pointer -g2 -fvisibility-inlines-hidden -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++17 -frtti -fexceptions ")
target_link_libraries("${target}" PRIVATE
"navigation-core"
nlohmann_json::nlohmann_json
Eigen3::Eigen)
#navigation-core:copy_public_include_dir
set("target" "navigation-core_copy_public_include_dir")
set("${target}__other_srcs" "include")
set("${target}__output" "tests/build/obj/include")
add_custom_command(OUTPUT ${${target}__output}
COMMAND ${CMAKE_COMMAND} -E copy_directory "include" "tests/build/obj/include"
DEPENDS ${${target}__other_srcs}
WORKING_DIRECTORY "tests/build/"
COMMENT "Copy ${target}"
VERBATIM)
add_custom_target("${target}" SOURCES ${${target}__other_srcs} DEPENDS ${${target}__output})
#navigation-core:navigation-core
set("target" "navigation-core")
list(APPEND "${target}__cxx_srcs"
"src/geometry.cpp"
"src/triangulation.cpp"
"src/knn/knn_utils.cpp"
"src/likelihood/likelihood.cpp"
"src/likelihood/likelihood_radiomap.cpp"
"src/measurements/measurement_preprocessor.cpp"
"src/position_estimator/position_estimator_knn.cpp"
"src/position_estimator/position_estimator_zone.cpp"
"src/position_estimator/position_estimator_outdoor.cpp"
"src/position_postprocessor/navigation_time_smoother.cpp"
"src/position_postprocessor/polynomial_fit.cpp"
"src/position_postprocessor/position_postprocessor.cpp"
"src/position_postprocessor/position_smoother_ab.cpp"
"src/position_postprocessor/position_smoother_lstsq.cpp"
"src/sensor_fusion/complementary_filter.cpp"
"src/sensor_fusion/quaternion.cpp"
"src/sensor_fusion/pedometer.cpp"
"src/sensor_fusion/sensor_fusion.cpp"
"src/level_estimator/barometer.cpp"
"src/level_estimator/level_estimator.cpp"
"src/level_estimator/level_estimator_radiomap.cpp"
"src/level_estimator/level_estimator_transmitters.cpp"
"src/level_estimator/level_history.cpp"
"src/navigation_client_impl.cpp"
"src/barriers_geometry_builder.cpp"
"src/level.cpp"
"src/point.cpp"
"src/level_collector.cpp"
"src/level_geometry.cpp"
"src/radiomap.cpp"
"src/vector3d.cpp"
"tools/verification/helpers.cpp"
"src/trilateration.cpp")
add_library("${target}" STATIC ${${target}__cxx_srcs})
# add_dependencies("${target}" boost_geometry)
target_include_directories("${target}" PRIVATE
"include/"
"tests/build/")
set_property(TARGET "${target}" PROPERTY CXX_STANDARD 17)
set_target_properties("${target}" PROPERTIES COMPILE_DEFINITIONS "BUILD_FOR_LINUX;_DEBUG;")
set_target_properties("${target}" PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -funwind-tables -fPIC -pipe -m64 -march=x86-64 -fstack-protector-strong -pthread -O3 -fno-omit-frame-pointer -g2 -fvisibility-inlines-hidden -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++17 -frtti -fexceptions ")
target_link_libraries("${target}" PRIVATE nlohmann_json::nlohmann_json
Eigen3::Eigen)
================================================
FILE: CODE_OF_CONDUCT.md
================================================
#
Navigine Open Source Code of Conduct
This code of conduct provides guidance on participation in Navigine-managed open source communities and denotes the process for reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all. People violating this code of conduct may be banned from the community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
- Advocating for or encouraging any of the above behaviors
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at info@navigine.com. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Navigine Routing Library
The easiest way to help out is to submit bug reports and feature requests on our [issues](https://github.com/Navigine/Indoor-Routing-Library/issues) page.
When submitting a bug report, please include:
- The device and operating system version that produced the bug
- The version or commit of Routing Library that produced the bug
- Steps required to recreate the issue
- What happened
- What you expected to happen
Thanks!
## Development
To develop for the library, it is usually easiest to build and test your changes using either the Mac OS X or Ubuntu desktop targets.
## Code Style
In general, code changes should follow the style of the surrounding code.
When in doubt, you can use the provided clang-format style file for automatic styling.
Install clang-format (available through brew or apt-get):
```
brew install clang-format
```
or
```
sudo apt-get install clang-format
```
Run clang-format with specified style (use -i to modify the contents of the specified file):
```
clang-format -i -style=file [file]
```
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2021 Navigine Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
Indoor-navigation-algorithms
[](https://github.com/Navigine/Indoor-Navigation-Algorithms/actions/workflows/ubuntu.yml) [](https://github.com/Navigine/Indoor-Navigation-Algorithms/actions/workflows/macos.yml)
============================
## Useful Links
- Refer to the [Navigine official website](https://navigine.com/) for complete list of downloads, useful materials, information about the company, and so on.
- [Get started](http://locations.navigine.com/login) with Navigine to get full access to Navigation services, SDKs, and applications.
- Refer to the Navigine [User Manual](http://docs.navigine.com/) for complete product usage guidelines.
- Find company contact information at the official website under [Contacts](https://navigine.com/contacts/) tab.
- Get support, contribute feedback, and connect with developers—visit [the Navigine Community](https://community.navigine.com/t/indoor-positioning-and-navigation-algorithms/173).
## Contents
This repository consists of the following components
* [src](https://github.com/Navigine/Indoor-Positioning-And-Navigation-Algorithms/tree/master/src) - the source code of Navigine positioning algorithms
* [standalone_algorithms](https://github.com/Navigine/Indoor-Positioning-And-Navigation-Algorithms/tree/master/standalone_algorithms) - set of algorithms used in navigation
* [tests](https://github.com/Navigine/Indoor-Positioning-And-Navigation-Algorithms/tree/master/tests) - test and utilities for the evaluation of source code quality
* [tools](https://github.com/Navigine/Indoor-Positioning-And-Navigation-Algorithms/tree/master/tools/verification) - utilities for data extraction from map and settings
## Creating Navigation Client
Here are some examples to give you an idea how to use [Navigation Client](https://github.com/Navigine/Indoor-Positioning-And-Navigation-Algorithms/blob/master/include/navigine/navigation-core/navigation_client.h).
First, create variables that will store your data.
```c++
// variables for storing location elements
navigine::navigation_core::GeoLevel geoLevel;
std::shared_ptr levelCollector;
navigine::navigation_core::NavigationSettings navigationSettings;
std::shared_ptr navClient;
```
Add transmitters (Beacon, Eddystone, WIFI, WIFI-RTT, etc.) as `GeoTransmitters` from your location.
Then they will be converted to `XYTransmitters` for internal evaluations
Parameters:
- id - identifier of transmitter like (major,minor,uuid) for beacon, (namespaceId,instanceId) for eddystone, mac for WIFI;
- point - latitude and longitude as GeoPoint;
- pathlossModel - A, B and power of transmitter as `PathlossModel` struct variable;
- type - type of transmitter, like Beacon, Eddystone, WIFI, WIFI-RTT, etc..
Inside for loop add all the transmitters from your location. Here is an example of adding one element
```c++
geoLevel.transmitters.emplace_back(transmitterId,
navigine::navigation_core::GeoPoint(latitude, longitude),
navigine::navigation_core::PathlossModel{A, B, power},
navigine::navigation_core::TransmitterType::BEACON);
```
Create geometry of the level using method `getGeometry` from [barriers_geometry_builder.h](https://github.com/Navigine/Indoor-Positioning-And-Navigation-Algorithms/blob/master/include/navigine/navigation-core/barriers_geometry_builder.h) file. Geometry could be created using the barriers and the size of the level
Parameters:
- barrierList - list of polygons, where each polygon describes the barrier of the level;
- allowedArea - polygon, which is created using width and height of the map;
Create the list of Polygons which will describe all the barriers
```c++
std::list barriersList;
for (size_t i = 0; i < barriers.size(); ++i)
{
auto coords = barriers.at(i);
navigine::navigation_core::Polygon barrier;
for (const auto& coord : coords)
boost::geometry::append(barrier, navigine::navigation_core::Point(coord.first, coord.second));
barriersList.push_back(barrier);
}
```
Create the polygon of allowed area
```c++
navigine::navigation_core::Polygon levelArea;
auto boundingBox = navigation_core::Box(
navigation_core::Point(leftMin.latitude, leftMin.longitude),
navigation_core::Point(rightMax.latitude, rightMax.longitude));
boost::geometry::convert(boundingBox, allowedArea);
geoLevel.geometry = navigine::navigation_core::getGeometry(barriersList, levelArea);
```
Create `LevelCollector` using method `createLevelCollector` and add all available geo levels.
```c++
levelCollector = navigine::navigation_core::createLevelCollector();
levelCollector->addGeoLevel(geoLevel);
```
Create `NavigationSettings`, with two parameters - level settings and common settings. (You can find them in navigation.xml i.e.)
Create `NavigationClient` using method `createNavigationClient` which will take as arguments level collector and navigation settings.
```c++
navClient = navigine::navigation_core::createNavigationClient(levelCollector, navigationSettings);
```
## Navigation test
The example of navigation is presented in a file [Navigation Test](https://github.com/Navigine/Indoor-Positioning-And-Navigation-Algorithms/blob/master/tests/navigation_test.cpp).
The test application takes 3 parameters:
- path to the file of the location in` geojson` format
- path to the file of logs gathered in this location in `json` format
- path to the settings file in `json` format in which parameters of the algorithm are specified
### Build
In order to build the test application go to the root directory of the repository and execute the following commands
``` sh
cmake -H. -Bbuild
cmake --build build
```
To run the tests
``` sh
cd build/
./navigation_test location.geojson log.json settings.json
```
## Evaluate the navigation
Quality of navigation can be evaluated via calculation of different navigational errors.
The most important among them are presented in the following table
| Error | Description |
| :--- | :---- |
| `nav_err` | Average navigation error in meters |
| `q_75_err` | 75% quantile of all the measurements have navigation error less than the value of `nav_75_err` |
| `avr_fi` | Average angle error in degrees |
| `level_err` | Percentage of wrongly determined levels |
| `exec_time` | Execution time in seconds |
## Navigation Algorithms explanation
Here are lectures on navigational algorithms used in this repository
- [Navigine's demo of WIFI-RTT](https://www.youtube.com/watch?v=VAzMhld3bH0&t)
- [Pedometer Algorithm Explained](https://www.youtube.com/watch?v=cpwrwPTqMac&t)
- [Complementary Filter](https://www.youtube.com/watch?v=49mJcFc2xXw)
- [Particle Filter](https://www.youtube.com/watch?v=JFZ-HARdZA8)
================================================
FILE: include/navigine/navigation-core/CHANGELOG.md
================================================
# Backlog of changes in navigation protocol
## Version 1.0
* Added first version of the navigation protocol
## Version 1.1
* Deleted accuracy
* Deleted battery
* Deleted height from LOCATION
================================================
FILE: include/navigine/navigation-core/README.md
================================================
Message format
============================
Each message consists of one line of json format and describes an individual measurement.
The line types are shown below.
### Type 101 - ACCELEROMETER
```{“timestamp”: , “type”: 101, “values”: [value_x, value_y, value_z]}```
### Type 102 - GYROSCOPE
```{“timestamp”: , “type”: 102, “values”: [value_x, value_y, value_z]}```
### Type 103 - MAGNETOMETER
```{“timestamp”: , “type”: 103, “values”: [value_x, value_y, value_z]}```
### Type 104 - BAROMETER
```{“timestamp”: , “type”: 104, “values”: [pressure, pressure, pressure]}```
### Type 105 - ORIENTATION
```{“timestamp”: , “type”: 105, “values”: [value_x, value_y, value_z]}```
### Type 106 - LOCATION
```{“timestamp”: , “type”: 106, “values”: [lat, lon, accuracy]}```
### Type 201 - WIFI
```{“timestamp”: , “type”: 201, “bssid”: , “rssi”: }```
### Type 202 - BLE
```{“timestamp”: , “type”: 202, “bssid”: , “rssi”: }```
### Type 203 - BEACON
```{“timestamp”: , “type”: 203, “bssid”: , “rssi”: , “power”: }```
### Type 204 - EDDYSTONE
```{“timestamp”: , “type”: 204, “bssid”: , “rssi”: , “power”: }```
### Type 205 - WIFI RTT
```{“timestamp”: , “type”: 205, “bssid”: , “distance”: , “stddev”: }```
### Type 300 - NMEA
```{“timestamp”: , “type”: 300, “sentence_number”: , “num_sats”: }```
### Type 900 - Comment
```{“timestamp”: , “type”: 900, “comment”: }```
================================================
FILE: include/navigine/navigation-core/barriers_geometry_builder.h
================================================
/** barriers_geometry_builder.h
*
* Copyright (c) 2019 Navigine.
*
*/
#ifndef NAVIGINE_BARRIERS_GEOMETRY_BUILDER_H
#define NAVIGINE_BARRIERS_GEOMETRY_BUILDER_H
#include "level_geometry.h"
namespace navigine {
namespace navigation_core {
LevelGeometry getGeometry(const std::list& allowedArea);
} } // namespace geometry::navigine::navigation_core
#endif // NAVIGINE_BARRIERS_GEOMETRY_BUILDER_H
================================================
FILE: include/navigine/navigation-core/boost_geometry_adaptation.h
================================================
#pragma once
#include
#include
#include
#include
#include
#include "xy_particle.h"
BOOST_GEOMETRY_REGISTER_POINT_2D(navigine::navigation_core::XYPoint, double, boost::geometry::cs::cartesian, x, y);
BOOST_GEOMETRY_REGISTER_POINT_2D(navigine::navigation_core::XYParticle, double, boost::geometry::cs::cartesian, x, y);
namespace navigine {
namespace navigation_core {
using Point = boost::geometry::model::d2::point_xy;
using Box = boost::geometry::model::box;
using Ring = boost::geometry::model::ring;
using Polygon = boost::geometry::model::polygon;
using Multipolygon = boost::geometry::model::multi_polygon;
using Linestring = boost::geometry::model::linestring;
using Multilinestring = boost::geometry::model::multi_linestring;
using BoxIdx = std::pair;
using RTree = boost::geometry::index::rtree>;
inline std::pair getWidthHeightPair(const Box& box)
{
double width = box.max_corner().x() - box.min_corner().x();
double height = box.max_corner().y() - box.min_corner().y();
return std::make_pair(width, height);
}
} } //namespace navigine::navigation_core
================================================
FILE: include/navigine/navigation-core/declare_identifier.h
================================================
#pragma once
#include
#define DECLARE_IDENTIFIER(IdentifierType) \
struct IdentifierType { \
std::string value; \
inline IdentifierType() = default; \
inline explicit IdentifierType(const std::string& value): value(value) {} \
inline bool isValid() const { return !value.empty(); } \
inline bool operator< (const IdentifierType& _id)const { return value < _id.value; } \
inline bool operator!= (const IdentifierType& _id)const { return value != _id.value; } \
inline bool operator== (const IdentifierType& _id)const { return value == _id.value; } \
}; \
\
struct Hasher##IdentifierType \
{ \
std::size_t operator()(const IdentifierType& k) const \
{ \
return std::hash()(k.value); \
} \
};
================================================
FILE: include/navigine/navigation-core/geolevel.h
================================================
/** geolevel.h
*
* Copyright (c) 2019 Navigine.
*
*/
#ifndef NAVIGINE_GEOLEVEL_H
#define NAVIGINE_GEOLEVEL_H
#include
#include
#include