16 #ifndef PSEN_SCAN_V2_STANDALONE_SCAN_RANGE_H 17 #define PSEN_SCAN_V2_STANDALONE_SCAN_RANGE_H 30 template <
int16_t min_allowed_angle,
int16_t max_allowed_angle>
33 static_assert(min_allowed_angle < max_allowed_angle,
"MIN-angle limit smaller than MAX-angle limit.");
63 template <
int16_t min_angle_raw,
int16_t max_angle_raw>
71 if (start_angle < min_angle || start_angle > max_angle)
73 throw std::out_of_range(
"Start angle out of range");
76 if (end_angle < min_angle || end_angle > max_angle)
78 throw std::out_of_range(
"End angle out of range");
81 if (start_angle >= end_angle)
83 throw std::invalid_argument(
"Start angle must be smaller than end angle");
87 template <
int16_t min_angle,
int16_t max_angle>
93 template <
int16_t min_angle,
int16_t max_angle>
99 template <
int16_t min_angle,
int16_t max_angle>
105 template <
int16_t min_angle,
int16_t max_angle>
108 return this->
start();
111 template <
int16_t min_angle,
int16_t max_angle>
121 #endif // PSEN_SCAN_V2_STANDALONE_SCAN_RANGE_H const util::TenthOfDegree & getStart() const
const util::TenthOfDegree & end() const
ScanRangeTemplated()=default
static constexpr ScanRangeTemplated< min_allowed_angle, max_allowed_angle > createInvalidScanRange()
const util::TenthOfDegree & getEnd() const
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
util::TenthOfDegree start_angle_
Higher level data type storing the range in which the scanner takes measurements. ...
const util::TenthOfDegree & start() const
util::TenthOfDegree end_angle_
Helper class representing angles in tenth of degree.