Code Monkey home page Code Monkey logo

Comments (4)

pfankhauser avatar pfankhauser commented on May 15, 2024

Thanks for reporting this! We have a unit test for the case where both start and end point are outside the map, so I'm unsure what happens in your case.

Could I ask you to recreate the erroneous behavior from your description in a unit test and create a PR?

from grid_map.

jinkunw avatar jinkunw commented on May 15, 2024

I met the same problem. When both getIndexLimitedToMapRange failed, iCell_ and nCells_ were not initialized. The problem is solved if I simply set them to zero in the constructor.

from grid_map.

mkhayatian avatar mkhayatian commented on May 15, 2024

The problem with current implementation is that if the start and end points are outside of the gridmap size and the (start,end) line doesn't intersect with the grid_map, it will throw std::invalid_argument("Failed to construct LineIterator.");
(line 24 of LineIterator.cpp). This is because the getIndexLimitedToMapRange() function starts from start points and moves towards the end point and if no point inside the gridmap is found (index), then it will return false.

from grid_map.

mkhayatian avatar mkhayatian commented on May 15, 2024

Also, a better implementation for getIndexLimitedToMapRange() is finding the intersection between two lines (start,end) and (gridmapEdge[i], gridmapEdge[i+1]) instead of a while loop.

from grid_map.

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.