Coder Social home page Coder Social logo

Comments (3)

prihex avatar prihex commented on July 28, 2024

in /uav_dynamics/inno_vtol_dynamics/src/dynamics/vtolDynamicsSim.cpp:701

void InnoVtolDynamicsSim::calculatePolynomialUsingTable(const Eigen::MatrixXd& table,
                                                        double airSpeedMod,
                                                        Eigen::VectorXd& polynomialCoeffs) const{
    size_t prevRowIdx = findRow(table, airSpeedMod);
    if(prevRowIdx + 2 <= table.rows()){
        size_t nextRowIdx = prevRowIdx + 1;
        Eigen::MatrixXd prevRow = table.row(prevRowIdx);
        Eigen::MatrixXd nextRow = table.row(nextRowIdx);
        double t = (airSpeedMod - prevRow(0, 0)) / (nextRow(0, 0) - prevRow(0, 0));
        for(size_t idx = 0; idx < 7; idx++){
            polynomialCoeffs[idx] = lerp(prevRow(0, idx + 1), nextRow(0, idx + 1), t); // This line
        }
    }else{
        for(size_t idx = 0; idx < 7; idx++){
            polynomialCoeffs[idx] = 0;
        }
    }
}

nextRow(0, idx + 1) couldn't be calculated because in function

    EIGEN_DEVICE_FUNC
    EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col)
    {
      eigen_internal_assert(row >= 0 && row < rows()
                         && col >= 0 && col < cols()); // This assertion fails
      return internal::evaluator<Derived>(derived()).coeffRef(row,col);
    }

Both col and cols() returns** 6 when armed in debug mode. Release and RelWithDebInfo doesn't evaluate assertions. Thus they never crash.

from innopolis_vtol_dynamics.

prihex avatar prihex commented on July 28, 2024

#define EIGEN_NO_DEBUG

before

#include "vtolDynamicsSim.hpp"

in vtolDynamicsSim.cpp

solved the problem

from innopolis_vtol_dynamics.

PonomarevDA avatar PonomarevDA commented on July 28, 2024

@hdbalyozsht Hi. Thanks for the issue. I tried it with DEBUG build type and I got the same error.
I modified tests a little bit and reproduce the problem in test workflow.
Then I fixed it in the next commit, so now it should be ok.

#define EIGEN_NO_DEBUG is not the solution. The actual problem was related to the fact that CDPolynomial matrix has the size (8, 6) less than other similar matrices (8, 8). calculatePolynomialUsingTable was hardcoded to handle only the (8, 8) size case. Now it is more robust.

I made fixes here: #12

from innopolis_vtol_dynamics.

Related Issues (7)

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.