| 152 | } |
| 153 | |
| 154 | void IteratorsDemo::demoLineIterator() |
| 155 | { |
| 156 | ROS_INFO("Running line iterator demo."); |
| 157 | map_.clearAll(); |
| 158 | publish(); |
| 159 | |
| 160 | Index start(18, 2); |
| 161 | Index end(2, 13); |
| 162 | |
| 163 | for (grid_map::LineIterator iterator(map_, start, end); |
| 164 | !iterator.isPastEnd(); ++iterator) { |
| 165 | map_.at("type", *iterator) = 1.0; |
| 166 | publish(); |
| 167 | ros::Duration duration(0.02); |
| 168 | duration.sleep(); |
| 169 | } |
| 170 | |
| 171 | ros::Duration duration(1.0); |
| 172 | duration.sleep(); |
| 173 | } |
| 174 | |
| 175 | void IteratorsDemo::demoPolygonIterator(const bool prepareForOtherDemos) |
| 176 | { |