20 #include <fmt/format.h> 21 #include <fmt/ostream.h> 35 const uint32_t scan_counter,
36 const uint8_t active_zoneset,
37 const int64_t timestamp)
38 : resolution_(resolution)
39 , min_scan_angle_(min_scan_angle)
40 , max_scan_angle_(max_scan_angle)
41 , scan_counter_(scan_counter)
42 , active_zoneset_(active_zoneset)
43 , timestamp_(timestamp)
47 throw std::invalid_argument(
"Resolution must not be 0");
52 throw std::invalid_argument(
"Resolution out of possible angle range");
57 throw std::invalid_argument(
"Attention: Start angle has to be smaller or equal to the end angle!");
197 os << fmt::format(
"LaserScan(timestamp = {} nsec, scanCounter = {}, minScanAngle = {} deg, maxScanAngle = {} deg, " 198 "resolution = {} deg, active_zoneset = {}, measurements = {}, intensities = {}, io_states = {})",
const IOData & getIOStates() const
int64_t getTimestamp() const
const util::TenthOfDegree & getMinScanAngle() const
const util::TenthOfDegree & maxScanAngle() const
void setIOStates(const IOData &io_states)
constexpr int16_t value() const
std::vector< double > IntensityData
uint8_t getActiveZoneset() const
std::vector< double > MeasurementData
const uint32_t scan_counter_
Number of the scan round this data belongs to.
IOData io_states_
States of the I/O pins.
static const util::TenthOfDegree MAX_X_AXIS_ROTATION
const MeasurementData & measurements() const
const util::TenthOfDegree resolution_
Distance of angle between the measurements.
const IntensityData & intensities() const
void setMeasurements(const MeasurementData &measurements)
void setIntensities(const IntensityData &intensities)
const util::TenthOfDegree & minScanAngle() const
std::ostream & operator<<(std::ostream &os, const PinState &pin_state)
const uint8_t active_zoneset_
The currently active zoneset of the scanner.
const MeasurementData & getMeasurements() const
IntensityData intensities_
Stores the received normalized signal intensities.
MeasurementData measurements_
Measurement data of the laserscan (in Millimeters).
int64_t timestamp() const
const util::TenthOfDegree & getScanResolution() const
const util::TenthOfDegree max_scan_angle_
Highest angle the scanner is scanning.
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
uint32_t scanCounter() const
const int64_t timestamp_
Time of the first ray in this scan round (or fragment if fragmented_scans is enabled).
const IOData & ioStates() const
const util::TenthOfDegree & getMaxScanAngle() const
uint8_t activeZoneset() const
std::string formatRange(const T &range)
const IntensityData & getIntensities() const
const util::TenthOfDegree min_scan_angle_
Lowest angle the scanner is scanning.
std::vector< IOState > IOData
const util::TenthOfDegree & scanResolution() const
LaserScan(const util::TenthOfDegree &resolution, const util::TenthOfDegree &min_scan_angle, const util::TenthOfDegree &max_scan_angle, const uint32_t scan_counter, const uint8_t active_zoneset, const int64_t timestamp)
This class represents a single laser scan in the <tf_prefix> target frame.
uint32_t getScanCounter() const
Helper class representing angles in tenth of degree.