Closed ClemensLinnhoff closed 1 year ago
clang-format
on the following filesclang-tidy
```cpp auto signal_strength_in_dBm = rendering_result.received_signal().signal_strength(); ^~~~~~~~~~~~~~~~~~~~~~ signal_strength_in_d_bm ```
```cpp void DetectionSensing::process_collected_beam_cells(LidarDetectionData* current_sensor, ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:187:15: note: nesting level increased to 1 [](const DetectionSensing::LidarBeamCellmW& first, const DetectionSensing::LidarBeamCellmW& second) { return first.dist_cell_idx < second.dist_cell_idx; }); ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:195:5: note: +1, including nesting penalty of 0, nesting level increased to 1 for (auto& lidar_cuboid_cell_of_beam : lidar_cuboid_cells_of_beam) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:197:9: note: +2, including nesting penalty of 1, nesting level increased to 2 if (lidar_cuboid_cell_of_beam.dist_cell_idx == summed_dist_cell_of_beam.dist_cell_idx) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:201:9: note: +1, nesting level increased to 2 else ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:210:5: note: +1, including nesting penalty of 0, nesting level increased to 1 if (!thresholded_summed_dist_cells.empty()) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:227:9: note: +2, including nesting penalty of 1, nesting level increased to 2 for (size_t thresholded_summed_dist_cell_dB_idx = 1; thresholded_summed_dist_cell_dB_idx < thresholded_summed_dist_cells.size(); thresholded_summed_dist_cell_dB_idx++) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:230:13: note: +3, including nesting penalty of 2, nesting level increased to 3 if ((float)thresholded_summed_dist_cells[thresholded_summed_dist_cell_dB_idx].dist_cell_idx > ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:236:17: note: +4, including nesting penalty of 3, nesting level increased to 4 if (no_of_peaks_in_beam > profile.detection_sensing_parameters.max_echos_per_beam) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:252:13: note: +1, nesting level increased to 3 else ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:258:17: note: +4, including nesting penalty of 3, nesting level increased to 4 if (thresholded_summed_dist_cells[thresholded_summed_dist_cell_dB_idx].signal_strength_in_dBm > peaks_in_beam[no_of_peaks_in_beam - 1].signal_strength_in_dBm) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:269:9: note: +2, including nesting penalty of 1, nesting level increased to 2 for (auto& current_peak : peaks_in_beam) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:275:13: note: +3, including nesting penalty of 2, nesting level increased to 3 if (profile.detection_sensing_parameters.echo_determination_mode == "peak") ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:279:13: note: +1, nesting level increased to 3 else ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:287:13: note: +3, including nesting penalty of 2, nesting level increased to 3 if ((profile.vertical_angle_clamping != "center") && (profile.beam_step_elevation > 0)) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:287:63: note: +1 if ((profile.vertical_angle_clamping != "center") && (profile.beam_step_elevation > 0)) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:289:17: note: +4, including nesting penalty of 3, nesting level increased to 4 if (profile.vertical_angle_clamping == "max_abs") ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:294:22: note: +1, nesting level increased to 4 else if (profile.vertical_angle_clamping == "top") ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:298:22: note: +1, nesting level increased to 4 else if (profile.vertical_angle_clamping == "bottom") ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:305:13: note: +3, including nesting penalty of 2, nesting level increased to 3 if (profile.detection_sensing_parameters.distance_stddev > 0.0) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:321:13: note: +3, including nesting penalty of 2, nesting level increased to 3 if (profile.detection_sensing_parameters.intensity_or_epw == 0) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:324:17: note: +4, including nesting penalty of 3, nesting level increased to 4 if (profile.detection_sensing_parameters.range_compensate_intensity) ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:335:17: note: +1, nesting level increased to 4 else ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:358:13: note: +1, nesting level increased to 3 else ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:373:17: note: +4, including nesting penalty of 3, nesting level increased to 4 while ((count < signal_strength_to_epw.size() - 1) && ^ /home/runner/work/sl-1-2-reflection-based-lidar-object-model/sl-1-2-reflection-based-lidar-object-model/src/model/strategies/lidar-detection-sensing-strategy/src/DetectionSensing.cpp:373:68: note: +1 while ((count < signal_strength_to_epw.size() - 1) && ^ ```
```cpp for (size_t thresholded_summed_dist_cell_dB_idx = 1; thresholded_summed_dist_cell_dB_idx < thresholded_summed_dist_cells.size(); thresholded_summed_dist_cell_dB_idx++) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ thresholded_summed_dist_cell_d_b_idx thresholded_summed_dist_cell_d_b_idx thresholded_summed_dist_cell_d_b_idx ```
```cpp double signal_strength_in_mW = pow(10, current_peak.signal_strength_in_dBm / 10); ^~~~~~~~~~~~~~~~~~~~~ signal_strength_in_m_w ```
```cpp double signal_strength_in_mW_range_compensated = signal_strength_in_mW * (pow(detection->position().distance(), 2)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ signal_strength_in_m_w_range_compensated ```
```cpp double emitted_signal_strength_mW = pow(10.0, profile.max_emitted_signal_strength_in_dBm / 10.0); ^~~~~~~~~~~~~~~~~~~~~~~~~~ emitted_signal_strength_m_w ```
```cpp auto summed_signal_strength_in_dBm = 10 * std::log10(summed_dist_cell_of_beam_ptr->signal_strength_in_mW); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ summed_signal_strength_in_d_bm ```
```cpp double threshold_mW = pow(10.0, threshold / 10.0) * pow(thres_distance_m, 2) / pow(range, 2); ^~~~~~~~~~~~ threshold_m_w ```
```cpp LidarBeamCelldBm thresholded_summed_dist_cell_dBm; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ thresholded_summed_dist_cell_d_bm ```
```cpp const double Gamma = existing_detection.intensity() / 100.0 * 255.0 / 100.0; //todo: calibrated to intensity values of Velodyne sensor. Change for other lidar types. ^~~~~ gamma ```
```cpp double emitted_signal_strength_mW = pow(10.0, profile.max_emitted_signal_strength_in_dBm / 10.0); ^~~~~~~~~~~~~~~~~~~~~~~~~~ emitted_signal_strength_m_w ```
```cpp double attenuated_power_mW = ^~~~~~~~~~~~~~~~~~~ attenuated_power_m_w ```
```cpp double attenuated_power_noise_mW = noise_distribution(generator); ^~~~~~~~~~~~~~~~~~~~~~~~~ attenuated_power_noise_m_w ```
```cpp double attenuated_power_dBm = 10 * log10(attenuated_power_noise_mW); ^~~~~~~~~~~~~~~~~~~~ attenuated_power_d_bm ```
```cpp double threshold_mW = pow(10.0, threshold / 10.0) * pow(profile.detection_sensing_parameters.thres_distance_m, 2) / pow(range, 2); ^~~~~~~~~~~~ threshold_m_w ```
Reference to a related issue in the repository
11
Add a description
Take this checklist as orientation for yourself, if this PR is ready for Maintainer Review