Giter VIP home page Giter VIP logo

Comments (7)

chadrockey avatar chadrockey commented on May 10, 2024

This could be a result of the 'Tock' for REP 117 in Hokuyo_node:
ros-drivers/hokuyo_node@2218ce5

If the NaNs and Infs are not being filtered out correctly, the maps could be very large or have points in 'la la' land.

http://ros.org/wiki/rep_117/migration

Check to ensure that points are being filtered properly:
// Laserscans and Ranges
for(size_t i = 0; i < msg.ranges.size(); i++){
// NaNs and Infs will always return false on a comparison.
if(msg.min_range <= msg.ranges[i] && msg.ranges[i] <= msg.max_range){
// Accept this measurement
}
}

Even better... update the software to interpret -Inf and +Inf.

If this is the issue and becomes a time-critical blocker, you can set the 'use_rep_117' to false until Hydromedusa. The parameter is planned to stop working in Hydro.

from navigation.

ahendrix avatar ahendrix commented on May 10, 2024

Running the nav stack on the PR2 with use_rep_117 set to false doesn't seem to be helping.

from navigation.

hershwg avatar hershwg commented on May 10, 2024

I narrowed it down to change db18d56. Before that, motion was smooth. After that, very jerky.

It was not clear to me that the fuerte nav stack actually took 60-70% cpu. When I ran the fuerte nav stack in the groovy environment, it took similar CPU as the groovy version, like the 110% Austin mentioned, but the robot moved smoothly, worked fine.

I did a "git bisect" on the nav stack between fuerte and groovy versions and found that the above-mentioned commit was where the change occurred. It was not gradual... the revisions before that commit all ran smoothly with similar CPU usage and the revisions after were jerky-all-the-time.

I have not yet determined the mechanism causing the bug. The change itself looks like straightforward move of code from one place to another.

from navigation.

hershwg avatar hershwg commented on May 10, 2024

Well, I have discovered one major performance-related factor in the change.

That change introduces several calls to malloc() and free() during each call to lineCost(). The malloc() and free() are called because of the std::vector which is used to accumulate grid cell locations in FootprintHelper::getLineCells(). Looking into stl_vector.h you can see (eventually) that it starts at size 0, then goes to 1, then 2, then 4, 8, etc. Every time it re-allocates it has to copy all the previous contents into the new memory and then free the old memory.

from navigation.

chadrockey avatar chadrockey commented on May 10, 2024

I looked at the two uses and where vector is filled. It looks like the ideal data structure could just be iterable (the points are never accessed out of order.) That seems to be the only constraint, seeing as elements are never removed and you know the number of elements in the vector before assigning them (numpixels in FootprintHelper::getLineCells).

Does performance improve if you call reserve on the vector before the for loop?
http://www.cplusplus.com/reference/vector/vector/reserve/

pts.reserve(numpixels);
for (int curpixel = 0; curpixel <= numpixels; curpixel++){
...
}

If that does help, it's probably worth reserving space in the other 2 vectors in FootprintHelper. Line 123 and 188.

from navigation.

hershwg avatar hershwg commented on May 10, 2024

I am actively working on this. I've changed it to a LineIterator class which should have similar performance as the "before" code. First though I will test it with the change simply reverted. PRK is down right now so there's a bit of a delay in testing.

from navigation.

hershwg avatar hershwg commented on May 10, 2024

Fixed by 450ba60. Subsequent changes implement the LineIterator refactoring, which has also been tested on a PR2 and drives smoothly.

from navigation.

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.