MCPcopy Create free account
hub / github.com/ANYbotics/grid_map / demoGridMapIterator

Method demoGridMapIterator

grid_map_demos/src/IteratorsDemo.cpp:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46IteratorsDemo::~IteratorsDemo() {}
47
48void IteratorsDemo::demoGridMapIterator()
49{
50 ROS_INFO("Running grid map iterator demo.");
51 map_.clearAll();
52 publish();
53
54 // Note: In this example we locally store a reference to the map data
55 // for improved performance. See `iterator_benchmark.cpp` and the
56 // README.md for a comparison and more information.
57 grid_map::Matrix& data = map_["type"];
58 for (grid_map::GridMapIterator iterator(map_); !iterator.isPastEnd(); ++iterator) {
59 const int i = iterator.getLinearIndex();
60 data(i) = 1.0;
61 publish();
62 ros::Duration duration(0.01);
63 duration.sleep();
64 }
65
66 ros::Duration duration(1.0);
67 duration.sleep();
68}
69
70void IteratorsDemo::demoSubmapIterator()
71{

Callers

nothing calls this directly

Calls 2

clearAllMethod · 0.80
isPastEndMethod · 0.45

Tested by

no test coverage detected