15 #include <Eigen/Eigen> 32 Eigen::Vector3d& pointOnTerrain() {
return point_; }
33 Eigen::Vector3d& normalToTerrain() {
return normal_; }
34 Eigen::Matrix3d& terrainRotation() {
return rotation_; }
35 Eigen::VectorXd& terrainDescriptionVector() {
return b_; }
36 Eigen::Matrix<double,Eigen::Dynamic,3>& terrainDescriptionMatrix() {
return A_; }
38 const int&
terrainId()
const {
return terrain_id_; }
39 const Eigen::Vector3d& pointOnTerrain()
const {
return point_; }
40 const Eigen::Vector3d& normalToTerrain()
const {
return normal_; }
41 const Eigen::Matrix3d& terrainRotation()
const {
return rotation_; }
42 const Eigen::VectorXd& terrainDescriptionVector()
const {
return b_; }
43 const Eigen::Matrix<double,Eigen::Dynamic,3>& terrainDescriptionMatrix()
const {
return A_; }
44 const Eigen::Quaternion<double> terrainOrientation()
const {
return Eigen::Quaternion<double>(rotation_); }
46 std::string toString()
const;
47 friend std::ostream& operator<<(std::ostream &os,
const TerrainRegion& obj) {
return os << obj.toString(); }
53 void initialize(
const Eigen::Matrix<double,Eigen::Dynamic,3>& ccwvertices,
int terrain_id);
58 Eigen::Matrix3d rotation_;
59 Eigen::Vector3d point_, normal_;
60 Eigen::Matrix<double,Eigen::Dynamic,3> A_;
69 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
75 void addTerrainRegion(
const Eigen::Matrix<double,Eigen::Dynamic,3>& ccwvertices);
76 void loadFromFile(
const std::string cfg_file,
const std::string terrain_description_name =
"terrain_description");
79 const int numRegions()
const {
return terrain_regions_.size(); }
80 TerrainRegion& terrainRegion(
int terrain_id) {
return terrain_regions_[terrain_id]; }
81 const TerrainRegion& terrainRegion(
int terrain_id)
const {
return terrain_regions_[terrain_id]; }
83 std::string toString()
const;
84 friend std::ostream& operator<<(std::ostream &os,
const TerrainDescription& obj) {
return os << obj.toString(); }
87 int num_terrain_regions_;
88 std::vector<TerrainRegion> terrain_regions_;
This class is a container for all variables required to define a terrain region.
Definition: TerrainDescription.hpp:24
This class is a container for a terrain description in terms of terrain surfaces. ...
Definition: TerrainDescription.hpp:66
const int numRegions() const
Definition: TerrainDescription.hpp:79
int & terrainId()
Definition: TerrainDescription.hpp:31