ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

This is probably because occupancy_grid_map_ptr_->data is not a vector<int8_t> but int8[] data.

for(std::size_t i = 0; i < occupancy_grid_map_ptr_->data.size(); ++i) {
    std::cout << occupancy_grid_map_ptr_->data[i] << std::endl;
}

Or do the following

std::vector<int8_t> occupancy_grid_map_data_(std::begin(occupancy_grid_map_ptr_->data), std::end(occupancy_grid_map_ptr_->data));