Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef TOWR_HEIGHT_MAP_H_
00031 #define TOWR_HEIGHT_MAP_H_
00032
00033 #include <memory>
00034 #include <vector>
00035 #include <Eigen/Dense>
00036
00037 #include "variables/cartesian_dimensions.h"
00038
00039 namespace towr {
00040
00053 class HeightMap {
00054 public:
00055 using Ptr = std::shared_ptr<HeightMap>;
00056 using Vector3d = Eigen::Vector3d;
00057
00058 enum Direction { Normal, Tangent1, Tangent2 };
00059
00060 HeightMap() = default;
00061 virtual ~HeightMap () = default;
00062
00068 virtual double GetHeight(double x, double y) const = 0;
00069
00077 double GetDerivativeOfHeightWrt(Dim2D dim, double x, double y) const;
00078
00086 Vector3d GetNormalizedBasis(Direction direction, double x, double y) const;
00087
00096 Vector3d GetDerivativeOfNormalizedBasisWrt(Direction direction, Dim2D dim,
00097 double x, double y) const;
00101 double GetFrictionCoeff() const { return friction_coeff_; };
00102
00103 protected:
00104 double friction_coeff_ = 0.5;
00105
00106 private:
00107 using DimDerivs = std::vector<Dim2D>;
00108
00117 Vector3d GetBasis(Direction direction, double x, double y,
00118 const DimDerivs& dim_deriv= {}) const;
00119
00120 Vector3d GetNormal(double x, double y, const DimDerivs& = {}) const;
00121 Vector3d GetTangent1(double x, double y, const DimDerivs& = {}) const;
00122 Vector3d GetTangent2(double x, double y, const DimDerivs& = {}) const;
00123
00124 double GetSecondDerivativeOfHeightWrt(Dim2D dim1, Dim2D dim2,
00125 double x, double y) const;
00126
00127 Vector3d GetDerivativeOfNormalizedVectorWrtNonNormalizedIndex(
00128 const Vector3d& non_normalized, int index) const;
00129
00130
00131 virtual double GetHeightDerivWrtX(double x, double y) const { return 0.0; };
00132 virtual double GetHeightDerivWrtY(double x, double y) const { return 0.0; };
00133
00134
00135 virtual double GetHeightDerivWrtXX(double x, double y) const { return 0.0; };
00136 virtual double GetHeightDerivWrtXY(double x, double y) const { return 0.0; };
00137 virtual double GetHeightDerivWrtYX(double x, double y) const { return 0.0; };
00138 virtual double GetHeightDerivWrtYY(double x, double y) const { return 0.0; };
00139 };
00140
00141 }
00142
00143 #endif