9 #ifndef CObservation2DRangeScan_H
10 #define CObservation2DRangeScan_H
65 void resizeScan(
const size_t len);
66 void resizeScanAndAssign(
const size_t len,
const float rangeVal,
const bool rangeValidity,
const int32_t rangeIntensity = 0);
67 size_t getScanSize()
const;
70 float getScanRange(
const size_t i)
const;
71 void setScanRange(
const size_t i,
const float val);
74 int32_t getScanIntensity(
const size_t i)
const;
75 void setScanIntensity(
const size_t i,
const int val);
78 bool getScanRangeValidity(
const size_t i)
const;
79 void setScanRangeValidity(
const size_t i,
const bool val);
92 void loadFromVectors(
size_t nRays,
const float *scanRanges,
const char *scanValidity );
101 void internal_buildAuxPointsMap(
const void *options = NULL )
const;
111 template <
class POINTSMAP>
113 return static_cast<const POINTSMAP*
>(m_cachedMap.pointer());
124 template <
class POINTSMAP>
126 if (!m_cachedMap.present()) internal_buildAuxPointsMap(options);
127 return static_cast<const POINTSMAP*
>(m_cachedMap.pointer());
136 bool isPlanarScan(
const double tolerance = 0)
const;
138 bool hasIntensity()
const;
139 void setScanHasIntensity(
bool setHasIntensityFlag);
144 void getDescriptionAsText(std::ostream &o)
const MRPT_OVERRIDE;
149 void truncateByDistanceAndAngle(
float min_distance,
float max_angle,
float min_height = 0,
float max_height = 0,
float h = 0 );
154 void filterByExclusionAreas(
const TListExclusionAreas &areas );
159 void filterByExclusionAreas(
const TListExclusionAreasWithRanges &areas );
164 void filterByExclusionAngles(
const std::vector<std::pair<double,double> > &angles );
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before 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)
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< int32_t > > intensity
The intensity values of the scan. If available, must have same length than validRange.
mrpt::maps::CMetricMapPtr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
std::vector< char > m_validRange
It's false (=0) on no reflected rays, referenced to elements in scan.
std::vector< mrpt::math::CPolygon > TListExclusionAreas
Used in filterByExclusionAreas.
std::vector< int32_t > m_intensity
The intensity values of the scan. If available, must have same length than validRange.
float maxRange
The maximum range allowed by the device, in meters (e.g. 80m, 50m,...)
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve 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.
double deltaPitch
If the laser gathers data by sweeping in the pitch/elevation angle, this holds the increment in "pitc...
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees).
std::vector< float > m_scan
The range values of the scan, in meters. Must have same length than validRange.
std::vector< std::pair< mrpt::math::CPolygon, std::pair< double, double > > > TListExclusionAreasWithRanges
Used in filterByExclusionAreas.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) MRPT_OVERRIDE
A general method to change the sensor pose on the robot.
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.
const POINTSMAP * buildAuxPointsMap(const void *options=NULL) const
Returns a cached points map representing this laser scan, building it upon the first call.
mrpt::utils::ContainerReadOnlyProxyAccessor< std::vector< float > > scan
The range values of the scan, in meters. Must have same length than validRange.
float stdError
The "sigma" error of the device in meters, used while inserting the scan in an occupancy grid.
bool m_has_intensity
Whether the intensity values are present or not. If not, space is saved during serialization.
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).
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
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...