Skip to content

snt-arg/ecg2o

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECG2O

Equality-Constrained g2o – Extending g2o with Equality Constraint Support

ECG2O extends the open-source g2o (General Graph Optimization) framework by introducing equality constraints. This allows for the addition of equality edge factors, enabling constrained optimization within factor graphs. The library also includes an Augmented Lagrangian implementation as a benchmark for constrained optimization techniques.

Reference

ecg2o: A Seamless Extension of g2o for Equality-Constrained Factor Graph Optimization
Submitted to IEEE IROS.


📥 Clone the Repository

git clone https://github.com/snt-arg/ecg2o.git
cd ecg2o

🚀 Quickstart with Docker

1. Build the Docker image

docker build -t ecg2o -f docker/Dockerfile .

2. Run the container

docker run -it --rm ecg2o

3. Inside the container

cd /workspace
cmake .. 
make

4. Run the examples

./example_gn

or

./example_al

or

./example_soft

or

./oc_test

🔧 Manual Installation Without Docker

To set up the environment without Docker, follow these steps:

  1. Install Dependencies (Ubuntu 22.04)

    sudo apt update
    sudo apt install -y \
        git cmake build-essential libeigen3-dev libspdlog-dev \
        libsuitesparse-dev qtdeclarative5-dev qt5-qmake \
        libqglviewer-dev-qt5 libmetis-dev
  2. Clone and Build g2o with Patch

    cd /opt
    git clone https://github.com/RainerKuemmerle/g2o
    cd g2o
    git checkout master
  3. Apply Required Code Patch

    Edit the file g2o/core/sparse_optimizer.h:

    Find the line:

      void update(const double* update);

    Replace it with:

      virtual void update(const double* update);

    This change enables overriding the update method required by the BIPM extension.

  4. Build and Install g2o

    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release -DG2O_USE_OPENMP=ON -DCMAKE_CXX_FLAGS="-DEIGEN_USE_THREADS -DEIGEN_USE_OPENMP" ..
    make -j$(nproc)
    sudo make install
  5. Build Your Application

    Assuming you're in your app's build directory:

    cmake ..
    make
  6. **Usage

Once the library is successfully built, you can execute the provided functions for equality-constrained optimization.

./example_gn

or

./example_al

or

./example_soft

or

./oc_test

Ensure that all necessary input files or configurations are correctly set up before execution.


License

This project is open-source and distributed under GPL-3.0 .

About

Equality constrained g2o, which allows to add equality edge factors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages