artivis / kalmanif

A small collection of Kalman Filters on Lie groups

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test and examples building and running problems.

joansola opened this issue · comments

If BUILD_TESTS = ON, I get this

CMake Error at test/CMakeLists.txt:35 (add_dependencies):
  The dependency target "gtest" of target "gtest_demo_se2" does not exist.
Call Stack (most recent call first):
  test/CMakeLists.txt:55 (kalmanif_add_gtest)


CMake Error at test/CMakeLists.txt:35 (add_dependencies):
  The dependency target "gtest" of target "gtest_demo_se3" does not exist.
Call Stack (most recent call first):
  test/CMakeLists.txt:56 (kalmanif_add_gtest)


CMake Error at test/CMakeLists.txt:35 (add_dependencies):
  The dependency target "gtest" of target "gtest_demo_se_2_3" does not exist.
Call Stack (most recent call first):
  test/CMakeLists.txt:57 (kalmanif_add_gtest)

If I switch them OFF, the errors disappear. However, I have no examples being compiled:

cd examples
ls

CMakeFiles  cmake_install.cmake  Makefile

Examples do get compiled if I compile with make instead of cmake --build.

jsola@prades:~/dev/kalmanif/build$ ls examples/
CMakeFiles  cmake_install.cmake  demo_se2  demo_se_2_3  demo_se3  Makefile

Demo demo_se2 works.

Demos demo_se3 and demo_se_2_3 get stuck at 100% CPU of one core, and never finish.

Hi @joansola,

I'll need a little more info about your setup. Indeed I've just successfully followed the instructions in a clean Ubuntu 22.04 container. Both the tests and examples are compiled fine.

This being said, the SE3 and SE_2_3 demo do take a while to run. That's because they are compiled in DEBUG. There is a note about that in the instructions: to summarize, add the following CMake flags -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -O3 -DNDEBUG -mtune=native -mavx2 -mfma".

The difference is quite obvious,

  • DEBUG
$ time ./demo_se_2_3
...
real	3m9.371s
user	3m5.015s
sys	0m0.472s
$ ctest --output-on-failure
Test project /home/ubuntu/workspace/src/kalmanif/build
    Start 1: gtest_demo_se2
1/3 Test #1: gtest_demo_se2 ...................   Passed    4.77 sec
    Start 2: gtest_demo_se3
2/3 Test #2: gtest_demo_se3 ...................   Passed   16.84 sec
    Start 3: gtest_demo_se_2_3
3/3 Test #3: gtest_demo_se_2_3 ................   Passed   48.11 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =  69.72 sec
  • RELEASE
$ time ./demo_se_2_3
...
real	0m2.903s
user	0m2.442s
sys	0m0.156s
$ ctest --output-on-failure
Test project /home/ubuntu/workspace/src/kalmanif/build
    Start 1: gtest_demo_se2
1/3 Test #1: gtest_demo_se2 ...................   Passed    0.04 sec
    Start 2: gtest_demo_se3
2/3 Test #2: gtest_demo_se3 ...................   Passed    0.10 sec
    Start 3: gtest_demo_se_2_3
3/3 Test #3: gtest_demo_se_2_3 ................   Passed    0.30 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   0.45 sec

In release, the SE_2_3 EKF even runs on a Raspberry Pi Pico so your computer should be more than capable ^^.

I am on Ubuntu 20-04. Toolkit is unclear, but it is NOT a fresh Ubuntu 20-04.

I-ll try tomorrow with RELEASE. However, my first error in this issue is a Cmake error.

If there-s any way for me to get relevant info from my system, please tell me how to and I can post it here.

I think I found the issue. Most probably you have the package libgtest-dev installed. This package ships only the gtest sources and must be built locally (have a look at this article). From there, you can either remove the package,

sudo apt remove --purge libgtest-dev

or provide the path to the manually compiled gtest directory to CMake.

Thanks @artivis I-ll check it out asap!

OK I got the following:

  • removing libgtest-dev did nothing and I still get the cmake errors indicated above
  • compiling in release effectively allowed me to finish the se3 and se_2_3 demos

I still think that CMake finds gtest somewhere on your machine but can't figure out the gtest target.

One last issue, about gnuplot. This is what I get

image

I cannot scale it up nicely, everything gets big and there's nothing I can do to modify the appearance. Is this normal?

Yeah this visualizer is less than ideal and really meant to give a quick visual peak at what's going on.

OK! I just saw the renders in the instructions were better than mine. Thanks for the help! Closing