##

Dem.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_DEM_HH_
#define _GAZEBO_DEM_HH_
#include <ignition/math/Vector3.hh>
#include <ignition/math/Angle.hh>
#include <gazebo/gazebo_config.h>
#include <gazebo/util/system.hh>
#ifdef HAVE_GDAL
# include <string>
# include <vector>
# include "gazebo/common/HeightmapData.hh"
namespace gazebo
{
namespace common
{
class DemPrivate;
class GZ_COMMON_VISIBLE Dem : public HeightmapData
{
public: Dem();
public: virtual ~Dem();
public: int Load(const std::string &_filename="");
public: double GetElevation(double _x, double _y);
public: float GetMinElevation() const;
public: float GetMaxElevation() const;
public: void GetGeoReferenceOrigin(ignition::math::Angle &_latitude,
ignition::math::Angle &_longitude) const;
public: unsigned int GetHeight() const;
public: unsigned int GetWidth() const;
public: double GetWorldWidth() const;
public: double GetWorldHeight() const;
public: void FillHeightMap(const int _subSampling,
const unsigned int _vertSize,
const ignition::math::Vector3d &_size,
const ignition::math::Vector3d &_scale,
const bool _flipY,
std::vector<float> &_heights);
private: void GetGeoReference(double _x, double _y,
ignition::math::Angle &_latitude,
ignition::math::Angle &_longitude) const;
private: int LoadData();
private: DemPrivate *dataPtr;
};
}
}
#endif
#endif
gazebo::common::HeightmapData
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:39
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::common::Dem::GetHeight
unsigned int GetHeight() const
Get the terrain's height.
gazebo::common::Dem::FillHeightMap
void FillHeightMap(const int _subSampling, const unsigned int _vertSize, const ignition::math::Vector3d &_size, const ignition::math::Vector3d &_scale, const bool _flipY, std::vector< float > &_heights)
Create a lookup table of the terrain's height.
common
common
Definition: FuelModelDatabase.hh:37
gazebo::common::Dem::Dem
Dem()
Constructor.
gazebo::common::Dem::GetGeoReferenceOrigin
void GetGeoReferenceOrigin(ignition::math::Angle &_latitude, ignition::math::Angle &_longitude) const
Get the georeferenced coordinates (lat, long) of the terrain's origin in WGS84.
HeightmapData.hh
gazebo::common::Dem::Load
int Load(const std::string &_filename="")
Load a DEM file.
system.hh
gazebo::common::Dem::GetMaxElevation
float GetMaxElevation() const
Get the terrain's maximum elevation in meters.
gazebo::common::Dem::GetWidth
unsigned int GetWidth() const
Get the terrain's width.
gazebo::common::Dem::GetMinElevation
float GetMinElevation() const
Get the terrain's minimum elevation in meters.
gazebo::common::Dem::GetElevation
double GetElevation(double _x, double _y)
Get the elevation of a terrain's point in meters.
gazebo::common::Dem::~Dem
virtual ~Dem()
Destructor.
gazebo::common::Dem::GetWorldWidth
double GetWorldWidth() const
Get the real world width in meters.
gazebo::common::Dem
Definition: Dem.hh:44
gazebo::common::Dem::GetWorldHeight
double GetWorldHeight() const
Get the real world height in meters.