Holds the height and slope of the terrain. More...
#include <height_map.h>
Public Types | |
enum | Direction { Normal, Tangent1, Tangent2 } |
Public Member Functions | |
double | GetDerivativeOfHeightWrt (Dim2D dim, double x, double y) const |
How the height value changes at a 2D position in direction dim. | |
Vector3d | GetDerivativeOfNormalizedBasisWrt (Direction direction, Dim2D dim, double x, double y) const |
How the terrain normal/tangent vectors change when moving in x or y. | |
double | GetFrictionCoeff () const |
virtual double | GetHeight (double x, double y) const =0 |
Vector3d | GetNormalizedBasis (Direction direction, double x, double y) const |
Returns either the vector normal or tangent to the terrain patch. | |
HeightMap () | |
virtual | ~HeightMap () |
Protected Attributes | |
double | friction_coeff_ = 0.5 |
Private Member Functions | |
Vector3d | GetBasis (Direction direction, double x, double y, const DimDerivs &dim_deriv={}) const |
< dimensional derivatives | |
Vector3d | GetDerivativeOfNormalizedVectorWrtNonNormalizedIndex (const Vector3d &non_normalized, int index) const |
virtual double | GetHeightDerivWrtX (double x, double y) const |
virtual double | GetHeightDerivWrtXX (double x, double y) const |
virtual double | GetHeightDerivWrtXY (double x, double y) const |
virtual double | GetHeightDerivWrtY (double x, double y) const |
virtual double | GetHeightDerivWrtYX (double x, double y) const |
virtual double | GetHeightDerivWrtYY (double x, double y) const |
Vector3d | GetNormal (double x, double y, const DimDerivs &={}) const |
double | GetSecondDerivativeOfHeightWrt (Dim2D dim1, Dim2D dim2, double x, double y) const |
Vector3d | GetTangent1 (double x, double y, const DimDerivs &={}) const |
Vector3d | GetTangent2 (double x, double y, const DimDerivs &={}) const |
Holds the height and slope of the terrain.
This class is responsible for providing the height values and slope at each position (x,y). This is used to formulate constraints such as "foot must be touching terrain during stance phase".
If a height map of the terrain already exists, e.g. Octomap/Gridmap, then a simple adapter for these can be written to comply to this minimal interface and to be used with towr.
Definition at line 53 of file height_map.h.
Definition at line 58 of file height_map.h.
virtual towr::HeightMap::~HeightMap | ( | ) | [virtual] |
HeightMap::Vector3d towr::HeightMap::GetBasis | ( | Direction | direction, |
double | x, | ||
double | y | ||
) | const [private] |
< dimensional derivatives
returns either the terrain normal/tangent or its derivative.
direction | Terrain normal or tangent vector. |
x | The x position on the terrain. |
y | The y position on the terrain. |
dim_deriv | If empty, the vector is returned, if e.g. X_ is set, the derivative of the vector w.r.t. x is returned. |
Definition at line 53 of file height_map.cc.
double towr::HeightMap::GetDerivativeOfHeightWrt | ( | Dim2D | dim, |
double | x, | ||
double | y | ||
) | const |
How the height value changes at a 2D position in direction dim.
dim | The direction (x,y) w.r.t. which the height change is desired. |
x | The x position on the terrain. |
y | The y position on the terrain. |
Definition at line 37 of file height_map.cc.
HeightMap::Vector3d towr::HeightMap::GetDerivativeOfNormalizedBasisWrt | ( | Direction | direction, |
Dim2D | dim, | ||
double | x, | ||
double | y | ||
) | const |
How the terrain normal/tangent vectors change when moving in x or y.
direction | The terrain normal or tangent vectors. |
dim | The dimension w.r.t which the change is searched for. |
x | The x position on the terrain. |
y | The y position on the terrain. |
Definition at line 65 of file height_map.cc.
HeightMap::Vector3d towr::HeightMap::GetDerivativeOfNormalizedVectorWrtNonNormalizedIndex | ( | const Vector3d & | non_normalized, |
int | index | ||
) | const [private] |
Definition at line 126 of file height_map.cc.
double towr::HeightMap::GetFrictionCoeff | ( | ) | const [inline] |
Definition at line 101 of file height_map.h.
virtual double towr::HeightMap::GetHeight | ( | double | x, |
double | y | ||
) | const [pure virtual] |
x | The x position. |
y | The y position. |
virtual double towr::HeightMap::GetHeightDerivWrtX | ( | double | x, |
double | y | ||
) | const [inline, private, virtual] |
Definition at line 131 of file height_map.h.
virtual double towr::HeightMap::GetHeightDerivWrtXX | ( | double | x, |
double | y | ||
) | const [inline, private, virtual] |
Definition at line 135 of file height_map.h.
virtual double towr::HeightMap::GetHeightDerivWrtXY | ( | double | x, |
double | y | ||
) | const [inline, private, virtual] |
Definition at line 136 of file height_map.h.
virtual double towr::HeightMap::GetHeightDerivWrtY | ( | double | x, |
double | y | ||
) | const [inline, private, virtual] |
Definition at line 132 of file height_map.h.
virtual double towr::HeightMap::GetHeightDerivWrtYX | ( | double | x, |
double | y | ||
) | const [inline, private, virtual] |
Definition at line 137 of file height_map.h.
virtual double towr::HeightMap::GetHeightDerivWrtYY | ( | double | x, |
double | y | ||
) | const [inline, private, virtual] |
Definition at line 138 of file height_map.h.
HeightMap::Vector3d towr::HeightMap::GetNormal | ( | double | x, |
double | y | ||
) | const [private] |
Definition at line 78 of file height_map.cc.
HeightMap::Vector3d towr::HeightMap::GetNormalizedBasis | ( | Direction | direction, |
double | x, | ||
double | y | ||
) | const |
Returns either the vector normal or tangent to the terrain patch.
direction | The terrain normal or tangent vectors. |
x | The x position on the terrain. |
y | The y position on the terrain. |
Definition at line 47 of file height_map.cc.
double towr::HeightMap::GetSecondDerivativeOfHeightWrt | ( | Dim2D | dim1, |
Dim2D | dim2, | ||
double | x, | ||
double | y | ||
) | const [private] |
Definition at line 135 of file height_map.cc.
HeightMap::Vector3d towr::HeightMap::GetTangent1 | ( | double | x, |
double | y | ||
) | const [private] |
Definition at line 97 of file height_map.cc.
HeightMap::Vector3d towr::HeightMap::GetTangent2 | ( | double | x, |
double | y | ||
) | const [private] |
Definition at line 112 of file height_map.cc.
double towr::HeightMap::friction_coeff_ = 0.5 [protected] |
Definition at line 104 of file height_map.h.