Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::array over raw array for transforms #48

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/grid_map_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include "grid_map_geo/grid_map_geo.hpp"

#include <array>
#include <grid_map_core/GridMapMath.hpp>
#include <grid_map_core/iterators/CircleIterator.hpp>
#include <grid_map_core/iterators/GridMapIterator.hpp>
Expand Down Expand Up @@ -66,8 +67,8 @@ bool GridMapGeo::initializeFromGeotiff(const std::string &path, bool align_terra
std::cout << std::endl << "Loading GeoTIFF file for gridmap" << std::endl;

double originX, originY, pixelSizeX, pixelSizeY;
double geoTransform[6];
if (dataset->GetGeoTransform(geoTransform) == CE_None) {
std::array<double, 6> geoTransform;
if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) {
originX = geoTransform[0];
originY = geoTransform[3];
pixelSizeX = geoTransform[1];
Expand Down Expand Up @@ -157,8 +158,8 @@ bool GridMapGeo::addColorFromGeotiff(const std::string &path) {
std::cout << std::endl << "Loading color layer from GeoTIFF file for gridmap" << std::endl;

double originX, originY, pixelSizeX, pixelSizeY;
double geoTransform[6];
if (dataset->GetGeoTransform(geoTransform) == CE_None) {
std::array<double, 6> geoTransform;
if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) {
originX = geoTransform[0];
originY = geoTransform[3];
pixelSizeX = geoTransform[1];
Expand Down Expand Up @@ -218,8 +219,8 @@ bool GridMapGeo::addLayerFromGeotiff(const std::string &layer_name, const std::s
std::cout << std::endl << "Loading color layer from GeoTIFF file for gridmap" << std::endl;

double originX, originY, pixelSizeX, pixelSizeY;
double geoTransform[6];
if (dataset->GetGeoTransform(geoTransform) == CE_None) {
std::array<double, 6> geoTransform;
if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) {
originX = geoTransform[0];
originY = geoTransform[3];
pixelSizeX = geoTransform[1];
Expand Down
Loading