Skip to content

Commit 7c07d05

Browse files
author
chao
committed
remove num_valid and write to signal even if range is not valid
1 parent b27c4db commit 7c07d05

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/decoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void Decoder::PublishAndReset() {
239239
cv::extractChannel(image16u, signal, 7);
240240
// multiply by 32 for visualization purposes
241241
signal_pub_.publish(
242-
cv_bridge::CvImage(header, "16UC1", signal * 32).toImageMsg());
242+
cv_bridge::CvImage(header, "16UC1", signal * 4).toImageMsg());
243243
}
244244
}
245245

src/lidar.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,9 @@ void LidarScan::HardReset() noexcept {
111111
icol = 0;
112112
iscan = 0;
113113
prev_uid = -1;
114-
num_valid = 0;
115114
}
116115

117116
void LidarScan::SoftReset(int full_col) noexcept {
118-
num_valid = 0;
119117
// Reset col (usually to 0 but in the rare case that data jumps forward
120118
// it will be non-zero)
121119
icol = icol % cols();
@@ -178,9 +176,10 @@ void LidarScan::DecodeColumn(const uint8_t* const col_buf,
178176
if (min_range <= range && range <= max_range) {
179177
xyz = model.ToPoint(range, theta_enc, ipx);
180178
r = xyz.norm(); // we compute range ourselves
181-
s16u = pf.px_signal(px_buf);
182-
++num_valid;
179+
// s16u = pf.px_ambient(px_buf);
180+
// s16u = pf.px_reflectivity(px_buf);
183181
}
182+
s16u = pf.px_ambient(px_buf);
184183
}
185184

186185
// Now we set cloud and image data
@@ -224,7 +223,6 @@ void LidarScan::DecodeColumn(const uint8_t* const col_buf,
224223
void LidarScan::UpdateCinfo(sensor_msgs::CameraInfo& cinfo) const noexcept {
225224
cinfo.R[0] = range_scale;
226225
cinfo.binning_x = iscan;
227-
cinfo.binning_y = num_valid;
228226

229227
// Update camera info roi with curr_scan
230228
auto& roi = cinfo.roi;

src/lidar.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ struct LidarScan {
8181
int icol{0}; // column index
8282
int iscan{0}; // subscan index
8383
int prev_uid{-1};
84-
int num_valid{0};
8584
double min_range{};
8685
double max_range{};
8786
double range_scale{};

0 commit comments

Comments
 (0)