Code Monkey home page Code Monkey logo

minkindr's Introduction

Transformations simple. A minimal library for transformations, following the kindr interface. Uses active quaternions of rotation in Hamilton notation.

Licensed under the 3-clause BSD license ("New BSD").

Copyright (c) 2015, Autonomous Systems Lab, ETH Zurich
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

minkindr's People

Contributors

bkueng avatar cfo avatar fabianbl avatar furgalep avatar gawela avatar hannessommer avatar helenol avatar huberya avatar magehrig avatar markusachtelik avatar mbuerki avatar mikebosse avatar othlu avatar rdube avatar simonlynen avatar tcies avatar zacharytaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minkindr's Issues

minkindr_python Error

hi, frist thank you so much to check my issue. Issue description as follows:

Device: Nvidia Jetson Nano
System: Ubuntu18.04

I did following operations to meet the issue:
1、catkin build -> svo . URL: https://github.com/uzh-rpg/rpg_svo_pro_open
minkindr_python is a package to be build in the svo project.
2、 Error appears

Errors << minkindr_python:cmake /home/xxx/svo_ws/logs/minkindr_python/build.cmake.002.log
CMake Error at /home/xxx/svo_ws/devel/share/catkin_simple/cmake/catkin_simple-extras.cmake:38 (find_package):
By not providing "Findcatkin_boost_python_buildtool.cmake" in
CMAKE_MODULE_PATH this project has asked CMake to find a package
configuration file provided by "catkin_boost_python_buildtool", but CMake
did not find one.

Could not find a package configuration file provided by
"catkin_boost_python_buildtool" with any of the following names:

catkin_boost_python_buildtoolConfig.cmake
catkin_boost_python_buildtool-config.cmake

Add the installation prefix of "catkin_boost_python_buildtool" to
CMAKE_PREFIX_PATH or set "catkin_boost_python_buildtool_DIR" to a directory
containing one of the above files. If "catkin_boost_python_buildtool"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:5 (catkin_simple)

Support vectorized transformations/rotations

Something like:

Eigen::Matrix<double, 3, Eigen::Dynamic> W_landmarks;
Transformation T_B_W;
// ... fill in.

Eigen::Matrix<double, 3, Eigen::Dynamic> B_landmarks(T_B_W.transform(W_landmarks));

Build Error

CMake Error at eigen_checks/build/devel/share/eigen_checks/cmake/eigen_checksConfig.cmake:173 (message):
Project 'minkindr' tried to find library 'eigen_checks'. The library is
neither a target nor built/installed properly. Did you compile project
'eigen_checks'? Did you find_package() it before the subdirectory
containing its code is included?
Call Stack (most recent call first):
catkin_simple/build/devel/share/catkin_simple/cmake/catkin_simple-extras.cmake:38 (find_package)
CMakeLists.txt:5 (catkin_simple)

I already downloaded and build all it's dependencies so why cant it build?

Can we split away minkindr_gtsam?

most of our tools rely just on minkindr, not minkindr_gtsam, which brings in a ton of heavy dependencies. --> can we split this? in my understanding, "min*" should also mean minimal dependencies ;)

Schweizer Messer Dependency

This seems like a fairly heavy dependency to me, especially since the vast majority of people (I assume) are using this as a C++ library only.

Any opinions?

CMAKE_MODULE_PATH

When I was building the minkindr_python, there are some errors and I couldn't handle them. The errors are as follows:

Errors << minkindr_python:cmake /home/michael/dslam_ws/logs/minkindr_python/build.cmake.021.log
CMake Error at /home/michael/dslam_ws/devel/share/catkin_simple/cmake/catkin_simple-extras.cmake:38 (find_package):

By not providing "Findcatkin_boost_python_buildtool.cmake" in
CMAKE_MODULE_PATH this project has asked CMake to find a package
configuration file provided by "catkin_boost_python_buildtool", but CMake
did not find one.
Could not find a package configuration file provided by
"catkin_boost_python_buildtool" with any of the following names:

catkin_boost_python_buildtoolConfig.cmake
catkin_boost_python_buildtool-config.cmake

Add the installation prefix of "catkin_boost_python_buildtool" to
CMAKE_PREFIX_PATH or set "catkin_boost_python_buildtool_DIR" to a directory
containing one of the above files. If "catkin_boost_python_buildtool"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:5 (catkin_simple)

@HannesSommer @mbuerki @alexmillane @michaelpantic @mfehr

multiplication of rotations can fail due to reduced precision of output

A minimal piece of code that will cause this issue is as follows:

kindr::minimal::RotationQuaternion q1(0.014005508273839951, 0, 0, 0.99987637996673584);
kindr::minimal::RotationQuaternion q2(0.018121428787708282, 0, 0,-0.99981027841567993);
q1*q2;

The first two lines create quaternions and are sufficiently close to 1 that no errors occur.
However, when the third line is run the following error is encountered

WARNING: Logging before InitGoogleLogging() is written to STDERR
F0111 13:23:33.874274 17251 rotation-quaternion-inl.h:77] Check failed: (squaredNorm()) >= (static_cast(1.0))-(static_cast(1e-4)) (0.999898 vs. 0.9999)
*** Check failure stack trace: ***

This is because the result of the multiplication has reduced the precision enough to fail the check.

One possible solution to this would be to renormalize the result of quaternion multiplications, though I am unsure if this would be the best approach. Does anyone have any thoughts as how to prevent this issue occurring? It seems like quite a problem as currently the wrong inputs will crash any program that uses minkindr multiplication.

add .getRotationQuaternion() to minkindr transform?

Eigen::Quaterniond q_odom_map = T_odom_map_.getRotation().toImplementation();

is a hassle every time you need the rotation component of this transformation, which is all the time.

Any objections to adding a convenience method?

Please split minkindr_python into separate repo!

Currently mindkindr_python is in this repo, which is meant to be as minimal implementation of a transformation library as possible. It brings in huge dependencies like numpy_eigen, which takes ~20-30 minutes to build on a normal machine and forces everyone using minkindr (again, designed as an absolutely minimal transformation package) to install numpy_eigen and catkin_boost_python_buildtool. It's breaking default installation instructions of packages such as voxblox, as it now adds many additional dependencies that don't allow an entire workspace to build.
This is also an issue for setting up continuous integration pipelines, as again, many dependencies are introduced and the entire workspace can no longer be built without them.

Great work on introducing python bindings, but please put them outside this repo.

@HannesSommer @mbuerki @alexmillane @michaelpantic @mfehr

test transform failed to die

In our workspace we run: catkin build --verbose minkindr --catkin-make-args run_tests. This test is failing:

EXPECT_DEATH(T.transform(vempty), "^");

with the following error

ws/src/minkindr/minkindr/test/test-transformation.cc:84: Failure
Death test: T.transform(vempty)
    Result: failed to die.
 Error msg:
[  DEATH   ] 
[  FAILED  ] MinKindrTests.testTransform (0 ms)

meaning that T.transform(vempty) is expected to crash, but it doesn't.

To investigate I changed the test to the following:

  EXPECT_DEATH({
     std::cout << "Before transform" << std::endl;
     auto test = T.transform(vempty);
     std::cout << "After transform" << std::endl;
     std::cout << test << std::endl;
     std::cout << "After print";
  }, "^");

and it outputs this:

[ RUN      ] MinKindrTests.testTransform
Before transform
[       OK ] MinKindrTests.testTransform (85 ms)

Meaning that T.transform(vempty); crashed! Just as the original test expected.

So my theory is that the compiler (or Eigen?) does optimization that causes T.transform(vempty) not to execute. Maybe because the result of T.transform(vempty) is not used anyway? Does anyone have an idea what's going on here?

Setup:

Ubuntu clang version 14.0.6-++20220622053019+f28c006a5895-1~exp1~20220622173056.159
Target: x86_64-pc-linux-gnu
std=c++11
libeigen3-dev 3.3.4-4

Must check for testing flag

You have to wrap the _add_gtest stuff in a condition on testing. The Catkin error message otherwise is:

() is not available when tests are not enabled.  The CMake code should only
use it inside a conditional block which checks that testing is enabled:

if(CATKIN_ENABLE_TESTING)

  (...)

endif()

rotation-quaternion-inl.h:115] Check failed: isValidRotationMatrix(matrix)

When running voxblox_pybind on my own dataset, minkindr is used as a 3rd party module.
If i run it on my own dataset, I get the error as follows.
Nowhere in configuration files is this rotation matrix specified, and all of the inputted poses use orthogonal rotation matrices. Is there a default transformation matrix somewhere that is causing this error?
INFO - 2022-12-05 11:52:14,048 - utils - Note: NumExpr detected 16 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8. INFO - 2022-12-05 11:52:14,048 - utils - NumExpr defaulting to 8 threads. 0%| | 0/631 [00:00<?, ? frames/s]WARNING: Logging before InitGoogleLogging() is written to STDERR F20221205 11:52:14.533803 213233 rotation-quaternion-inl.h:115] Check failed: isValidRotationMatrix(matrix) -0.999833 -0.99952 -0.999484 -0.999703 -0.998442 -0.998706 -0.997548 -0.999331 -0.997702 *** Check failure stack trace: *** Aborted (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.