9 #ifndef CObservation2DRangeScan_H
10 #define CObservation2DRangeScan_H
79 std::pair<mrpt::math::CPolygon, std::pair<double, double>>>
96 const size_t len,
const float rangeVal,
const bool rangeValidity,
97 const int32_t rangeIntensity = 0);
148 size_t nRays,
const float* scanRanges,
const char* scanValidity);
172 template <
class POINTSMAP>
175 return static_cast<const POINTSMAP*
>(
m_cachedMap.get());
190 template <
class POINTSMAP>
192 const void* options =
nullptr)
const
195 return static_cast<const POINTSMAP*
>(
m_cachedMap.get());
227 float min_distance,
float max_angle,
float min_height = 0,
228 float max_height = 0,
float h = 0);
250 const std::vector<std::pair<double, double>>& angles);
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DECLARE_MEXPLUS_FROM(complete_type)
This must be inserted if a custom conversion method for MEX API is implemented in the class.
#define DECLARE_MEX_CONVERSION
This must be inserted if a custom conversion method for MEX API is implemented in the class.
#define MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE(_TYPE, __NS)
std::shared_ptr< CMetricMap > Ptr
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< int32_t > > intensity
The intensity values of the scan.
std::vector< char > m_validRange
It's false (=0) on no reflected rays, referenced to elements in scan.
bool getScanRangeValidity(const size_t i) const
std::vector< mrpt::math::CPolygon > TListExclusionAreas
Used in filterByExclusionAreas.
void resizeScanAndAssign(const size_t len, const float rangeVal, const bool rangeValidity, const int32_t rangeIntensity=0)
Resizes all data vectors to allocate a given number of scan rays and assign default values.
std::vector< int32_t > m_intensity
The intensity values of the scan.
CObservation2DRangeScan()
Default constructor.
float maxRange
The maximum range allowed by the device, in meters (e.g.
const POINTSMAP * buildAuxPointsMap(const void *options=nullptr) const
Returns a cached points map representing this laser scan, building it upon the first call.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
float beamAperture
The aperture of each beam, in radians, used to insert "thick" rays in the occupancy grid.
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< char > > validRange
It's false (=0) on no reflected rays, referenced to elements in scan.
void setScanIntensity(const size_t i, const int val)
bool hasIntensity() const
Return true if scan has intensity.
int32_t getScanIntensity(const size_t i) const
double deltaPitch
If the laser gathers data by sweeping in the pitch/elevation angle, this holds the increment in "pitc...
void filterByExclusionAngles(const std::vector< std::pair< double, double >> &angles)
Mark as invalid the ranges in any of a given set of "forbiden angle ranges", given as pairs<min_angle...
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees).
void loadFromVectors(size_t nRays, const float *scanRanges, const char *scanValidity)
std::vector< float > m_scan
The range values of the scan, in meters.
void internal_buildAuxPointsMap(const void *options=nullptr) const
Internal method, used from buildAuxPointsMap()
size_t getScanSize() const
Get number of scan rays.
void filterByExclusionAreas(const TListExclusionAreas &areas)
Mark as invalid sensed points that fall within any of a set of "exclusion areas", given in coordinate...
void truncateByDistanceAndAngle(float min_distance, float max_angle, float min_height=0, float max_height=0, float h=0)
A general method to truncate the scan by defining a minimum valid distance and a maximum valid angle ...
mrpt::maps::CMetricMap::Ptr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
bool rightToLeft
The scanning direction: true=counterclockwise; false=clockwise.
std::vector< std::pair< mrpt::math::CPolygon, std::pair< double, double > > > TListExclusionAreasWithRanges
Used in filterByExclusionAreas.
float getScanRange(const size_t i) const
bool isPlanarScan(const double tolerance=0) const
Return true if the laser scanner is "horizontal", so it has an absolute value of "pitch" and "roll" l...
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< float > > scan
The range values of the scan, in meters.
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
void getScanProperties(T2DScanProperties &p) const
Fill out a T2DScanProperties structure with the parameters of this scan.
void setScanRangeValidity(const size_t i, const bool val)
float stdError
The "sigma" error of the device in meters, used while inserting the scan in an occupancy grid.
void setScanHasIntensity(bool setHasIntensityFlag)
Marks this scan as having or not intensity data.
bool m_has_intensity
Whether the intensity values are present or not.
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
virtual ~CObservation2DRangeScan()
Destructor.
void setScanRange(const size_t i, const float val)
const POINTSMAP * getAuxPointsMap() const
Returns the cached points map representation of the scan, if already build with buildAuxPointsMap(),...
Declares a class that represents any robot's observation.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
This namespace contains representation of robot actions and observations.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Auxiliary struct that holds all the relevant geometry information about a 2D scan.
A generic proxy accessor template that only allows read-only access to the original binded STL contai...