Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/grow - Merged master into #174 #330

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stevencolinmartin
Copy link

Merged in current master to Grow feature.

Updates #174

@maximilianwulf
Copy link
Collaborator

Thank you, it has been imported.

@maximilianwulf maximilianwulf mentioned this pull request Dec 10, 2021
@romainreignier
Copy link

Thank you @raghavakumar8 and @SteveQUT
This is exactly the feature I was missing.
Using addDataFrom was taking too much time to grow the GridMap.

I have successfully used this PR. It works and works fast.

About the API, for my use case, I receive a new Position, if it is not inside the current GridMap, I need to grow it with a new length delta. Maybe we could provide a grow method that takes a position and a length delta and grows in the direction of that position?

size(0) = static_cast<int>(round(length(0) / resolution_));
size(1) = static_cast<int>(round(length(1) / resolution_));
conservativeResize(size, direction, value);
length_ = length;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to replace this line by this one to avoid alignment issues:

Suggested change
length_ = length;
length_ = (size_.cast<double>() * resolution_).matrix();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken from here:

length_ = (size_.cast<double>() * resolution_).matrix();

@kam3k
Copy link

kam3k commented Aug 23, 2023

Would it make sense to add the complementary shrink(...) function?

I personally have a use case where I want to regularly adjust the size of the map to contain some minimum amount of information. For example, keeping the smallest map possible that contains some minimum amount of obstacles. Here, it would be useful to grow the map when it is too sparse and shrink it if it is too dense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants