9#ifndef CObservationVelodyneScan_H
10#define CObservationVelodyneScan_H
67 static const int SIZE_BLOCK = 100;
68 static const int RAW_SCAN_SIZE = 3;
69 static const int SCANS_PER_BLOCK = 32;
70 static const int BLOCK_DATA_SIZE = (SCANS_PER_BLOCK * RAW_SCAN_SIZE);
73 static const uint16_t ROTATION_MAX_UNITS = 36000;
82 static const int PACKET_SIZE = 1206;
83 static const int POS_PACKET_SIZE = 512;
84 static const int BLOCKS_PER_PACKET = 12;
85 static const int PACKET_STATUS_SIZE = 4;
86 static const int SCANS_PER_PACKET = (SCANS_PER_BLOCK * BLOCKS_PER_PACKET);
88 static const uint8_t RETMODE_STRONGEST = 0x37;
126 char NMEA_GPRMC[72+234];
142 std::vector<float>
x,y,z;
155 { std::vector<float> dumm; x.swap(dumm); }
156 { std::vector<float> dumm; y.swap(dumm); }
157 { std::vector<float> dumm; z.swap(dumm); }
158 { std::vector<uint8_t> dumm; intensity.swap(dumm); }
176 float ROI_x_min,
ROI_x_max, ROI_y_min, ROI_y_max, ROI_z_min, ROI_z_max;
178 float nROI_x_min,
nROI_x_max, nROI_y_min, nROI_y_max, nROI_z_min, nROI_z_max;
217 std::vector<mrpt::math::TPointXYZIu8> & out_points,
#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 MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE(_TYPE, __NS)
Declares a class that represents any robot's observation.
A CObservation-derived class for RAW DATA (and optionally, point cloud) of scans from 3D Velodyne LID...
bool has_satellite_timestamp
If true, CObservation::timestamp has been generated from accurate satellite clock....
static const float DISTANCE_RESOLUTION
meters
mrpt::system::TTimeStamp originalReceivedTimestamp
The local computer-based timestamp based on the reception of the message in the computer.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) MRPT_OVERRIDE
A general method to change the sensor pose on the robot.
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve the sensor pose on the robot.
CObservationVelodyneScan()
void generatePointCloud(const TGeneratePointCloudParameters ¶ms=defaultPointCloudParams)
Generates the point cloud into the point cloud data fields in CObservationVelodyneScan::point_cloud w...
std::vector< TVelodyneRawPacket > scan_packets
The main content of this object: raw data packet from the LIDAR.
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot/vehicle frame of reference.
double maxRange
The maximum range allowed by the device, in meters (e.g. 100m). Stored here by the driver while captu...
void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
static const float ROTATION_RESOLUTION
void generatePointCloudAlongSE3Trajectory(const mrpt::poses::CPose3DInterpolator &vehicle_path, std::vector< mrpt::math::TPointXYZIu8 > &out_points, TGeneratePointCloudSE3Results &results_stats, const TGeneratePointCloudParameters ¶ms=defaultPointCloudParams)
An alternative to generatePointCloud() for cases where the motion of the sensor as it grabs one scan ...
static const float DISTANCE_MAX
meters
static const float DISTANCE_MAX_UNITS
static const TGeneratePointCloudParameters defaultPointCloudParams
TPointCloud point_cloud
Optionally, raw data can be converted into a 3D point cloud (local coordinates wrt the sensor,...
virtual ~CObservationVelodyneScan()
mrpt::system::TTimeStamp getOriginalReceivedTimeStamp() const MRPT_OVERRIDE
By default, returns CObservation::timestamp but in sensors capable of satellite (or otherwise) accura...
mrpt::obs::VelodyneCalibration calibration
The calibration data for the LIDAR device. See mrpt::hwdrivers::CVelodyneScanner and mrpt::obs::Velod...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
This class stores a time-stamped trajectory in SE(3) (CPose3D poses).
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
class BASE_IMPEXP CPose3DInterpolator
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool filterByROI
Enable ROI filter (Default:false): add points inside a given 3D box.
TGeneratePointCloudParameters()
double maxAzimuth_deg
Minimum azimuth, in degrees (Default=360). Points will be generated only the the area of interest [mi...
bool filterBynROI
Enable nROI filter (Default:false): do NOT add points inside a given 3D box.
float isolatedPointsFilterDistance
(Default:2.0 meters) Minimum distance between a point and its two neighbors to be considered an inval...
bool dualKeepLast
(Default:true) In VLP16 dual mode, keep both or just one of the returns.
float maxDistance
Minimum (default=1.0f) and maximum (default: Infinity) distances/ranges for a point to be considered....
double minAzimuth_deg
Minimum azimuth, in degrees (Default=0). Points will be generated only the the area of interest [minA...
bool filterOutIsolatedPoints
(Default:false) Simple filter to remove spurious returns (e.g. Sun reflected on large water extension...
Results for generatePointCloudAlongSE3Trajectory()
TGeneratePointCloudSE3Results()
size_t num_correctly_inserted_points
Number of points for which a valid interpolated SE(3) pose could be determined.
size_t num_points
Number of points in the observation.
See point_cloud and scan_packets.
std::vector< uint8_t > intensity
Color [0,255].
Payload of one POSITION packet.
One unit of data from the scanner (the payload of one UDP DATA packet)
uint8_t laser_return_mode
0x37: strongest, 0x38: last, 0x39: dual return
uint32_t gps_timestamp
us from top of hour
uint8_t velodyne_model_ID
0x21: HDL-32E, 0x22: VLP-16
uint16_t header
Block id: UPPER_BANK or LOWER_BANK.
uint16_t rotation
0-35999, divide by 100 to get degrees
Velodyne calibration data, for usage in mrpt::obs::CObservationVelodyneScan.