65 const YAML::Node &node,
66 std::pair<int, LaserCorrection> &correction) {
76 >> correction.second.horiz_offset_correction;
78 correction.second.horiz_offset_correction = 0.0;
84 correction.second.max_intensity = 255;
90 correction.second.min_intensity = 0;
97 correction.second.cos_rot_correction
98 = cosf(correction.second.rot_correction);
99 correction.second.sin_rot_correction
100 = sinf(correction.second.rot_correction);
101 correction.second.cos_vert_correction
102 = cosf(correction.second.vert_correction);
103 correction.second.sin_vert_correction
104 = sinf(correction.second.vert_correction);
105 correction.second.focal_offset = 256.0f
106 *
static_cast<float>(std::pow(
107 1 - correction.second.focal_distance / 13100.0f, 2));
108 correction.second.laser_ring = 0;
114 const YAML::Node &lasers = node[
LASERS];
118 for (
int i = 0; i < num_lasers; i++) {
119 std::pair<int, LaserCorrection> correction;
120 lasers[i] >> correction;
128 double next_angle = -std::numeric_limits<double>::infinity();
130 for (
int ring = 0; ring < num_lasers; ++ring) {
132 double min_seen = std::numeric_limits<double>::infinity();
133 int next_index = num_lasers;
135 for (
int j = 0; j < num_lasers; ++j) {
138 if (next_angle < angle && angle < min_seen) {
144 if (next_index < num_lasers) {
147 next_angle = min_seen;
154 const std::pair<int, LaserCorrection> &correction) {
155 out << YAML::BeginMap;
156 out << YAML::Key <<
LASER_ID << YAML::Value << correction.first;
158 << correction.second.rot_correction;
160 << correction.second.vert_correction;
162 << correction.second.dist_correction;
164 << correction.second.dist_correction_x;
166 << correction.second.dist_correction_y;
168 << correction.second.vert_offset_correction;
170 << correction.second.horiz_offset_correction;
172 << correction.second.max_intensity;
174 << correction.second.min_intensity;
176 << correction.second.focal_distance;
178 << correction.second.focal_slope;