# The MultiBody State Estimation (MBSE) C++ library

A library for multibody forward and inverse dynamics, state estimation, and parameter identification.

Related papers and approaches implemented in this repository:

## Paradigm #1: Based on factor-graphs

Forward and inverse dynamics, closed kinematic chains constraints solved as factors in a factor graphs, and more.

For the theory behinds this work, refer to :

- J.L. Blanco, A. Leanza, G. Reina, "A general framework for modeling and dynamic simulation of multibody systems using factor graphs", 2021. (ArXiV)

## Paradigm #2: Particle filter estimator

A Bayesian filter has been implemented as a particle filter. Only planar dynamics models have been tested. For the theory behinds this work, refer to :

- J.L. Blanco, J.L. Torres, A. Gimenez-Fernandez, "Multibody dynamic systems as Bayesian Networks: applications to robust state estimation of mechanisms", Multibody System Dynamics, vol. 34, no. 2, pp. 103-128, 2015. (Draft PDF, PDF, BibTeX)

Open video
## Compiling

Dependencies:

- A C++ compiler
- CMake
- SuiteSparse
- MRPT (>=2.0.0)
- GTSAM

In Ubuntu, install dependencies with:

sudo apt-get install build-essential cmake libsuitesparse-dev libmrpt-dev libgtsam-dev

To build:

mkdir build
cd build
cmake ..
# If you see no errors, go on, otherwise fix them!
make # To compile the library and examples
make test_legacy # To run unit tests

You should also be able to compile this project under Windows and Visual Studio.

## Using mbse as a library in a user program

In your CMake project, add:

find_package(mbse REQUIRED)
# then in your target:
target_link_libraries(${PROJECT_NAME} mbse::mbse)

For CMake to find the library, in `cmake-gui`

or `ccmake`

, set the variable `mbse_DIR`

to `BUILD_DIR/cmake`

, where `BUILD_DIR`

is the compilation directory where you built MBSE.