Skip to content

Commit

Permalink
reconstruct code.
Browse files Browse the repository at this point in the history
  • Loading branch information
YibinWu committed Oct 9, 2023
2 parents ce02de5 + e2e063c commit cd750d1
Show file tree
Hide file tree
Showing 2,279 changed files with 593,344 additions and 10 deletions.
39 changes: 39 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# clang-format configuration

# created by hailiang

# Base
BasedOnStyle: LLVM

# Indent
UseTab: Never
TabWidth: 4
IndentWidth: 4
ColumnLimit: 120
AccessModifierOffset: -4
ObjCBlockIndentWidth: 4
IndentWrappedFunctionNames: true
IndentCaseLabels: true

# Line
MaxEmptyLinesToKeep: 1
SpaceBeforeAssignmentOperators: true
SpacesInContainerLiterals: true
KeepEmptyLinesAtTheStartOfBlocks: true
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowAllParametersOfDeclarationOnNextLine: true
BreakConstructorInitializersBeforeComma: true

# Space
PointerAlignment: Right
SpacesInSquareBrackets: false
SpacesInParentheses: false
SpaceAfterCStyleCast: true

# Alignment
ObjCSpaceAfterProperty: true
AlignTrailingComments: true
AlignOperands: true
AlignConsecutiveDeclarations: None
AlignConsecutiveAssignments: Consecutive
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bin/
lib/
build/
.vscode/
.idea/
output/
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.10)
project(Wheel-INS)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_BUILD_TYPE RELEASE)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions( -D_USE_MATH_DEFINES=True)
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
else()
set(CMAKE_CXX_FLAGS "-Wno-unused-result")
endif()

file(GLOB_RECURSE SOURCE
src/main.cpp
src/fileio/fileloader.cpp
src/fileio/filesaver.cpp
src/wheel_ins/wheelins.cpp
src/wheel_ins/insmech.cpp)

include_directories(${PROJECT_SOURCE_DIR}/src)
add_executable(${PROJECT_NAME} ${SOURCE})

# Eigen3
include_directories(ThirdParty/eigen-3.3.9)

# yaml-cpp-0.7.0
add_subdirectory(ThirdParty/yaml-cpp-0.7.0)
target_link_libraries(${PROJECT_NAME} yaml-cpp)


set(ABSL_PROPAGATE_CXX_STD true)
add_subdirectory(ThirdParty/abseil-cpp-20220623.1)
target_link_libraries(${PROJECT_NAME}
absl::strings
absl::str_format)
67 changes: 57 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,62 @@
Unlike the conventional odometer-aided inertial navigation system (ODO/INS) where the IMU is always placed either on the vehicle body or in the coach, in Wheel-INS, the IMU is mounted on the wheel of the ground vehicle. There are two major advanatges by doing so: 1) the wheel velocity can be obtained by the Wheel-IMU thus replace the traditional odometer (or wheel encoder); 2) the rotation modulation can be leveraged to mitigate the error accumulation of INS. Particularly, the wheel velocity calculated by the gyroscope outputs and the wheel radius is treated as an external observation with non-holonomic constraint (NHC) to fuse with INS through an extended Kalman filter (EKF).

## :boom:News:boom:
:tada::tada: Oct. 2023 A completely new version of the code is released!

:tada::tada: Nov. 2022 Our paper on one wheel-mounted IMU-based SLAM ([Wheel-SLAM](https://arxiv.org/pdf/2211.03174.pdf)) has been accepted to IEEE Robotics and Automation Letters. The [source code](https://github.com/i2Nav-WHU/Wheel-SLAM) is released. Check it out!

:tada::tada: Nov. 2022 Our paper on multiple IMUs-based wheeled robot localization ([Wheel-INS2](https://ieeexplore.ieee.org/document/9950438)) has been accepted to IEEE Transactions on Intelligent Transportation Systems. Check it out!

## Introduction
The source code is in the ***Wheel-INS*** folder. It is very consice and light-weight which can be run easily in Windows (Some incompatibility issues should be solved for running in Linux). It does not rely on any third-party libraries.(We only use OpenCV to read configure file.)
## Run it
### 1. Linux
We recommend you to use g++ compiler with Ubuntu 20.04. The build-essential libraries should be installed first:
```shell
sudo apt-get install cmake
sudo apt-get install build-essential
```

Two sets of example data with ground truth are also provided (see ***Data*** folder). Please refer to the ***ReadMe.pdf*** for details. If *git clone* is too slow, please try to download the *.zip* file directly.
After preparing the compilation environment, you can clone the repository and run it as follows:

## Related Papers
*Based on the study of Wheel-IMU, we have published three papers. 1) The original Wheel-INS paper where we proposed a wheel-mounted IMU-based dead reckoning system and investigated its characteristics. 2) A thorough and complete comparison on three different measurement models (vehicle velocity information obtained from the Wwheel-IMU) in Wheel-INS with both theoretical analysis and experimental illustration. 3) A multiple IMUs-based localization system for wheeled robots by obtaining different dynamic information of the vhehicle and taking advantage of the relative spatial constraints among the inertial sensors with a comparison on different configurations.*
```shell
# Clone the repository
git clone git@github.com:i2Nav-WHU/Wheel-INS.git ~/

- X. Niu, Y. Wu and J. Kuang, "Wheel-INS: A Wheel-mounted MEMS IMU-based Dead Reckoning System," IEEE Transactions on Vehicular Technology, doi: 10.1109/TVT.2021.3108008, 2021. ([pdf](http://i2nav.cn/ueditor/jsp/upload/file/20210905/1630804325780076093.pdf)) ([IEEE Xplore](https://ieeexplore.ieee.org/document/9524467))
# Build Wheel-INS
cd ~/Wheel-INS
mkdir build && cd build

- Y. Wu, X. Niu and J. Kuang, "A Comparison of Three Measurement Models for the Wheel-mounted MEMS IMU-based Dead Reckoning System," IEEE Transactions on Vehicular Technology, doi: 10.1109/TVT.2021.3102409, 2021. ([pdf](http://i2nav.cn/ueditor/jsp/upload/file/20210905/1630804728655046341.pdf)) ([IEEE Xplore](https://ieeexplore.ieee.org/document/9508199))
cmake ..
make -j10

- Y. Wu, J. Kuang and X. Niu, "Wheel-INS2: Multiple MEMS IMU-based Dead Reckoning System for Wheeled Robots with Evaluation of Different IMU Configurations," IEEE Transactions on Intelligent Transportation Systems, 2022. ([pdf](https://arxiv.org/abs/2012.10593))([IEEE Xplore](https://ieeexplore.ieee.org/document/9950438))
# Run demo dataset
cd ~/Wheel-INS
./bin/Wheel-INS config/robot.yaml
```
### 2. Windows
Here we show how to run the code with [Visual Studio Code (VSCode)](https://code.visualstudio.com/), but you can also use other IDEs, e.g., [Visual Studio](https://visualstudio.microsoft.com/).

- Install VSCode and the extensions: **C/C++**, **C/C++ Extension Pack**, **CMake**, and **CMake Tools**
- Install [CMake](https://cmake.org/download/) and [Microsoft Visual C/C++ Build Tools](https://visualstudio.microsoft.com/downloads/).
- Open Wheel-INS with VSCode.
- Set compiler: open the Command Palette (Ctrl+Shift+P) and type "CMake: Select a Kit", select the correct build tool according to your system.
- Configure CMake: type "CMake: Configure" in the Command Palette
- Compile Project: type "CMake: Build" in the Command Palette

Once a execuble file **Wheel-INS.exe** is generated, the compilation is done. Then, you can run it via the terminal in VSCode as following:

```shell
.\bin\Release\Wheel-INS.exe config/robot.yaml
```
You can then run **plot.py** in utils to plot the trajectory estimated by Wheel-INS as well as the raw Wheel-IMU data.
## Datasets
Two sets of example data with ground truth are also provided (see ***dtaset***). Please refer to the ***ReadMe.pdf*** for details. If *git clone* is too slow, please try to download the *.zip* file directly.

If you find our study helpful to your academic research, please consider citing the related papers.
## Related Papers
*Based on the study of Wheel-IMU, we have published three papers. 1) The original Wheel-INS paper where we proposed a wheel-mounted IMU-based dead reckoning system and investigated its characteristics. 2) A thorough and complete comparison on three different measurement models in Wheel-INS with both theoretical analysis and experimental illustration. 3) A multiple IMUs-based localization system for wheeled robots by obtaining different dynamic information of the vhehicle and taking advantage of the relative spatial constraints among the inertial sensors.*

If you find our studies helpful to your academic research, please consider citing the related papers.

- X. Niu, Y. Wu and J. Kuang, "Wheel-INS: A Wheel-mounted MEMS IMU-based Dead Reckoning System," IEEE Transactions on Vehicular Technology, doi: 10.1109/TVT.2021.3108008, 2021. ([pdf](http://i2nav.cn/ueditor/jsp/upload/file/20210905/1630804325780076093.pdf)) ([IEEE Xplore](https://ieeexplore.ieee.org/document/9524467))
```bibtex
@ARTICLE{niu2021tvt,
author={Niu, Xiaoji and Wu, Yibin and Kuang, Jian},
Expand All @@ -34,6 +71,8 @@ If you find our study helpful to your academic research, please consider citing
doi={10.1109/TVT.2021.3108008}
}
```

- Y. Wu, X. Niu and J. Kuang, "A Comparison of Three Measurement Models for the Wheel-mounted MEMS IMU-based Dead Reckoning System," IEEE Transactions on Vehicular Technology, doi: 10.1109/TVT.2021.3102409, 2021. ([pdf](http://i2nav.cn/ueditor/jsp/upload/file/20210905/1630804728655046341.pdf)) ([IEEE Xplore](https://ieeexplore.ieee.org/document/9508199))
```bibtex
@ARTICLE{wu2021tvt,
author={Wu, Yibin and Niu, Xiaoji and Kuang, Jian},
Expand All @@ -45,6 +84,8 @@ If you find our study helpful to your academic research, please consider citing
pages={11193-11203},
doi={10.1109/TVT.2021.3102409}}
```

- Y. Wu, J. Kuang and X. Niu, "Wheel-INS2: Multiple MEMS IMU-based Dead Reckoning System for Wheeled Robots with Evaluation of Different IMU Configurations," IEEE Transactions on Intelligent Transportation Systems, 2022. ([pdf](https://arxiv.org/abs/2012.10593))([IEEE Xplore](https://ieeexplore.ieee.org/document/9950438))
```bibtex
@ARTICLE{wu2022tits,
author={Wu, Yibin and Kuang, Jian and Niu, Xiaoji},
Expand All @@ -55,4 +96,10 @@ If you find our study helpful to your academic research, please consider citing
doi={10.1109/TITS.2022.3220508}
}
```
For any questions, please feel free to contact Mr. Yibin Wu (ybwu@whu.edu.cn) or Dr. Jian Kuang (kuang@whu.edu.cn).
## License
The code is released under GPLv3 license.

## Acknowledgement
We would like to thank i2Nav group for sharing [KF-GINS](https://github.com/i2Nav-WHU/KF-GINS), which is referenced by this code.

For any questions, please feel free to contact Mr. Yibin Wu (ybwu at whu.edu.cn) or Dr. Jian Kuang (kuang at whu.edu.cn).
4 changes: 4 additions & 0 deletions ThirdParty/abseil-cpp-20220623.1/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
Language: Cpp
BasedOnStyle: Google
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''
---

**Describe the bug**

Include a clear and concise description of what the problem is, including what
you expected to happen, and what actually happened.

**Steps to reproduce the bug**

It's important that we are able to reproduce the problem that you are
experiencing. Please provide all code and relevant steps to reproduce the
problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links
to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the
problem are also helpful.

**What version of Abseil are you using?**

**What operating system and version are you using**

If you are using a Linux distribution please include the name and version of the
distribution as well.

**What compiler and version are you using?**

Please include the output of `gcc -v` or `clang -v`, or the equivalent for your
compiler.

**What build system are you using?**

Please include the output of `bazel --version` or `cmake --version`, or the
equivalent for your build system.

**Additional context**

Add any other context about the problem here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Question
about: Have a question? Ask us anything! :-)
title: ''
labels: 'question'
assignees: ''
---
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
15 changes: 15 additions & 0 deletions ThirdParty/abseil-cpp-20220623.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Ignore all bazel-* symlinks.
/bazel-*
# Ignore Bazel verbose explanations
--verbose_explanations
# Ignore CMake usual build directory
build
# Ignore Vim files
*.swp
# Ignore QtCreator Project file
CMakeLists.txt.user
# Ignore VS Code files
.vscode/*
# Ignore generated python artifacts
*.pyc
copts/__pycache__/
22 changes: 22 additions & 0 deletions ThirdParty/abseil-cpp-20220623.1/ABSEIL_ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Please submit a new Abseil Issue using the template below:

## [Short title of proposed API change(s)]

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

## Background

[Provide the background information that is required in order to evaluate the
proposed API changes. No controversial claims should be made here. If there are
design constraints that need to be considered, they should be presented here
**along with justification for those constraints**. Linking to other docs is
good, but please keep the **pertinent information as self contained** as
possible in this section.]

## Proposed API Change (s)

[Please clearly describe the API change(s) being proposed. If multiple changes,
please keep them clearly distinguished. When possible, **use example code
snippets to illustrate before-after API usages**. List pros-n-cons. Highlight
the main questions that you want to be answered. Given the Abseil project compatibility requirements, describe why the API change is safe.]
6 changes: 6 additions & 0 deletions ThirdParty/abseil-cpp-20220623.1/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is the list of Abseil authors for copyright purposes.
#
# This does not necessarily list everyone who has contributed code, since in
# some cases, their employer may be the copyright holder. To see the full list
# of contributors, see the revision history in source control.
Google Inc.
25 changes: 25 additions & 0 deletions ThirdParty/abseil-cpp-20220623.1/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright 2020 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0

# Expose license for external usage through bazel.
exports_files([
"AUTHORS",
"LICENSE",
])
Loading

0 comments on commit cd750d1

Please sign in to comment.