Giter Site home page Giter Site logo

Comments (3)

Huguet57 avatar Huguet57 commented on August 25, 2024

Weird! As seen in lines 108-112 of the Accumulator initialization:

if (this->enough_imus()) {
this->set_initial_time();
Localizator::getInstance().initialize(this->initial_time);
return this->is_ready = true;
}

It's supposed to initialize when enough IMU samples have been gathered - and then set initial_time (which in turn, sets initial_state's time).

Making the first IMU trivially older than the first State. Weird that it happens... And I don't think you delete IMU data anywhere...

from limo-velo.

bertaveira avatar bertaveira commented on August 25, 2024

But upsample is called by the Compensator::path() which will only get a portion of IMUs and States.

If I am not mistaken this piece of code ensures that the oldest state passed to the Compensator::upsample() is older than the older IMU passed to it as well (when doing states.push_front(accum.get_prev_state(t1));). It also ensures that the latest IMU is later than the latest State

States Compensator::path(double t1, double t2) {
// Call Accumulator
Accumulator& accum = Accumulator::getInstance();
// Get states just before t1 to t2
States states = accum.get_states(t1, t2);
states.push_front(accum.get_prev_state(t1));
// Get imus from first state to just after t2
IMUs imus = accum.get_imus(states.front().time, t2);
imus.push_back(accum.get_next_imu(t2));
return this->upsample(states, imus);
}

It fells like this assert should have the first inequality changed from <= to >=

States Compensator::upsample(const States& states, const IMUs& imus) {
assert (imus.front().time <= states.front().time and states.back().time <= imus.back().time);

from limo-velo.

Huguet57 avatar Huguet57 commented on August 25, 2024

Now I see that the get method gets from t1 to t2 included:

if (t1 > cnt.time) break;

So, in principle, states.front().time and imus.front().time should be the same - if the state has been derived from an IMU timestamp (which I think always happens). Weird that it crashed your code.

I would vote against changing the inequality and more in favor of just removing (?) the first part. The idea was actually that the IMU stream spanned the State stream because then we can get a continuous upsampling (no large chunk from first state to first IMU).

It is more interesting to investigate why it's crashing the code. For now, commenting it doesn't seem to be dangerous.

from limo-velo.

Related Issues (20)

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.