Comments (3)
Ok, so I managed to make it work using
for (grid_map::GridMapIterator iterator(static_cut); !iterator.isPastEnd(); ++iterator) {
const grid_map::Index index(*iterator);
grid_map::Position position;
static_cut.getPosition(index, position);
grid_map::Index elev_index;
local_elevation_map_.getIndex(position, elev_index);
if ( std::abs( robot_elevation - elev_data(elev_index(0), elev_index(1)) ) > 0.38 ){
static_cut_data(index(0), index(1)) = 100.0;
}
}
I'd still be interested in a more elegant/efficient way of doing this however.
from grid_map.
Assuming you have the static and the local maps with following layers
GridMap static_map_({"occupancy"});
GridMap local_elevation_map_({"elevation", "occupancy"});
with different positions, sizes, and resolutions (hence, the grids are not aligned). Instead of the for
-loop, you can achieve the same directly with:
local_elevation_map_["occupancy"] = ((local_elevation_map_["elevation"].array() - robot_elevation).abs() > 0.38).cast<float>() * 100.0;
static_map_.addDataFrom(local_elevation_map_, true, true, false, {"occupancy"});
Good point about the documentation, I added a comment in e93d7aa. Thanks!
from grid_map.
Thanks for the quick answer, that indeed looks a good bit more elegant and efficient :)
from grid_map.
Related Issues (20)
- does the pcd file's points cloud need to align with gravity?
- Compilation bug in foxy-devel where variable outputColor is not initialzied in pkg grid_map_filters HOT 1
- Wrong parameter name in grid_map_pcl
- Build issue possibly related to Eigen add-on macros HOT 3
- How to convert grid map from Elevation Mapping to CostMap2D? HOT 3
- 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
- How do I access and test the costmap2Dconvertor ?
- Visualize multiple grid maps in rviz
- 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 1
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.