Comments (8)
Are you using an image with a channel for the alpha layer? There's a round trip unit test that passes for the CV_8UC4
CV image type and I just added a nan-value/transparent pixel here.
If this does not solve your problem, could you please create a PR with a failing unit tests that shows the issue?
from grid_map.
Ah no, I forgot to mention that I am using a CV_8UC1
grayscale image, that is why, there is no other solution to translate a NaN
to a mid value between Free and Occupied.
from grid_map.
So is there anything you would like to see differently in the behavior of Grid Map or should I close this issue?
from grid_map.
What do you think about setting NaN
values to the mid value between lowerValue
and upperValue
?
from grid_map.
*if there is no alpha channel, of couse.
from grid_map.
I would keep the current behavior, since I feel it's the one with the least assumptions. Your use case is very special, and if I'm not mistaken, you could achieve your desired behavior by setting your empty/nan cells to the mid-value before converting it to the image format.
from grid_map.
Yes, of course, it is what I have done.
But for the map_server
for example, a unknown cell is a pixel with value 128 that is why I was surprised that grid_map
did not picked a middle value.
Anyway, as you said, my use case may be special for the grid_map
because I did not managed to find an easy way to convert pixels position to grid_map
coordinates then OccupancyGrid
coordinates. So I have ended up writing my own conversion methods.
Maybe you could add in the doc that the NaN
values are converted to the value 0 for images with no alpha layer.
from grid_map.
I have also encountered this problem.
The issue is that the output of SLAM algorithms for unknown area is -1 in occupancy grids, that gets transformed into NaN in Grid maps and finally that gets transformed into 0 in cv::Mat. That causes cv::Mats to make no difference between occupied cells and unknown cells.
I don't think changing NaN cells to a middle value before converting to grid map is a good solution because an occupancy grid is supposed to give a probability of occupancy of each cell and is not supposed to give a value to unknown space.
from grid_map.
Related Issues (20)
- Invoking "make -j16 -l16" failed when building the grid map HOT 1
- loadFromBag crashes in ROS2 when bag contains multiple topics HOT 3
- Efficient way to update an existing grid map object
- Superflous CMake Calls to old ament
- MedianFillFilter.cpp -> function cleanedMask() 's morphological operational question
- unable to build grid_map on ros2 humble HOT 1
- How do I access and test the costmap2Dconvertor ?
- Visualize multiple grid maps in rviz HOT 1
- Publish a Float32MultiArray in a GridMap message HOT 1
- Request to add maintainers for ROS 2 or transfer of ownership of ROS 2 to ethz-asl HOT 2
- grid_map_filters package fails during build HOT 1
- rolling: CI can't clone and all jobs fail HOT 4
- Deprecation of OgreVector3.h - Fix by ROS 2 Jazzy HOT 2
- grid_map_pcl and grid_map_sdf warnings with COMP0144 HOT 2
- Github CI on rolling/iron missing tests which causes build farm failures HOT 2
- There is a problem in grid_map_pcl config HOT 2
- Is there a simple way like apt to install grid_map package for ROS2? HOT 1
- Less than 4 points in a cell HOT 1
- Does polygonIterator support multi polygon ?
- README gives the false impression that conversion from Pointcloud2 to grid_map layers are available. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grid_map.