Go to the documentation of this file.
30 const size_t size_x = dem_get_size_x();
31 const size_t size_y = dem_get_size_y();
35 for (
size_t x = 0; x < size_x; x++)
36 for (
size_t y = 0; y < size_y; y++)
39 if (dem_get_z_by_cell(x, y, z))
49 mrpt::keep_max<float>(z_max, z);
50 mrpt::keep_min<float>(z_min, z);
66 const double resolution = dem_get_resolution();
68 if (!getMinMaxHeight(z_min, z_max))
return false;
71 const TPlane horz_plane_above(
74 const TPlane horz_plane_below(
90 const double totalDist = Apt.
norm();
91 if (totalDist == 0)
return false;
93 Apt *= resolution * 0.99 / totalDist;
98 const size_t N =
mrpt::round(ceil(totalDist / resolution));
100 for (
size_t i = 0; i < N; i++)
103 const TPoint3D testPt = pt + Apt_half;
106 if (dem_get_z(testPt.
x, testPt.
y, pt_z))
109 if (pt_z >= std::min(pt.
z, pt.
z + Apt.
z) &&
110 pt_z < std::max(pt.
z, pt.
z + Apt.
z))
138 if (robotPose) robotPose3D = (*robotPose);
152 const auto* thePoints =
170 if (!thePointsMoved.
empty())
176 const size_t N = thePointsMoved.
size();
177 for (
size_t i = 0; i < N; i++)
180 thePointsMoved.
getPoint(i, x, y, z);
181 insertIndividualPoint(x, y, z, pt_params);
183 this->dem_update_map();
bool empty() const
STL-like method to check whether the map is empty:
virtual ~CHeightGridMap2D_Base()
void changeCoordinatesReference(const mrpt::poses::CPose2D &b)
Replace each point by (pose compounding operator).
size_t size() const
Save the point cloud as a PCL PCD file, in either ASCII or binary format.
TPoint3D_< double > TPoint3D
Lightweight 3D point.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
With this struct options are provided to the observation insertion process.
Extra params for insertIndividualPoint()
#define IS_CLASS(obj, class_name)
True if the given reference to object (derived from mrpt::rtti::CObject) is of the given class.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors.
Standard object for storing any 3D lightweight object.
bool update_map_after_insertion
(default: true) run any required operation to ensure the map reflects the changes caused by this poin...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This namespace contains representation of robot actions and observations.
void loadFromVelodyneScan(const mrpt::obs::CObservationVelodyneScan &scan, const mrpt::poses::CPose3D *robotPose=nullptr)
Like loadFromRangeScan() for Velodyne 3D scans.
T norm() const
Point norm: |v| = sqrt(x^2+y^2+z^2)
bool getPoint(TPoint3D &p) const
Gets the content as a point, returning false if the type is not adequate.
int round(const T value)
Returns the closer integer (int) to x.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
float d2f(const double d)
shortcut for static_cast<float>(double)
bool intersect(const TSegment3D &s1, const TSegment3D &s2, TObject3D &obj)
Gets the intersection between two 3D segments.
bool getMinMaxHeight(float &z_min, float &z_max) const
Computes the minimum and maximum height in the grid.
3D Plane, represented by its equation
Declares a class that represents any robot's observation.
This base provides a set of functions for maths stuff.
3D line, represented by a base point and a director vector.
bool dem_internal_insertObservation(const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr)
Internal method called by internal_insertObservation()
void getPoint(size_t index, float &x, float &y, float &z) const
Access to a given point from map, as a 2D point.
bool intersectLine3D(const mrpt::math::TLine3D &r1, mrpt::math::TObject3D &obj) const
Gets the intersection between a 3D line and a Height Grid map (taking into account the different heig...
A CObservation-derived class for RAW DATA (and optionally, point cloud) of scans from 3D Velodyne LID...
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Fri Jul 17 08:43:33 UTC 2020 | |