Skip to content

Commit

Permalink
style(lidar_transfusion): affine matrix naming
Browse files Browse the repository at this point in the history
Signed-off-by: amadeuszsz <[email protected]>
  • Loading branch information
amadeuszsz committed May 29, 2024
1 parent 8434721 commit 8b59a37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class VoxelGenerator
std::unique_ptr<PreprocessCuda> pre_ptr_{nullptr};
TransfusionConfig config_;
cuda::unique_ptr<unsigned char[]> cloud_data_d_{nullptr};
cuda::unique_ptr<float[]> affine_transform_d_{nullptr};
cuda::unique_ptr<float[]> affine_past2current_d_{nullptr};
std::vector<float> points_;
cudaStream_t stream_;
CloudInfo cloud_info_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ VoxelGenerator::VoxelGenerator(
pre_ptr_ = std::make_unique<PreprocessCuda>(config_, stream_);
cloud_data_d_ = cuda::make_unique<unsigned char[]>(config_.cloud_capacity_ * MAX_CLOUD_STEP_SIZE);
points_.resize(config_.cloud_capacity_ * config_.num_point_feature_size_);
affine_transform_d_ = cuda::make_unique<float[]>(AFF_MAT_SIZE);
affine_past2current_d_ = cuda::make_unique<float[]>(AFF_MAT_SIZE);
}

bool VoxelGenerator::enqueuePointCloud(
Expand Down Expand Up @@ -96,20 +96,20 @@ std::size_t VoxelGenerator::generateSweepPoints(
#else
size_t points_size = pc_msg.width * pc_msg.height;
cuda::clear_async(cloud_data_d_.get(), config_.cloud_capacity_ * MAX_CLOUD_STEP_SIZE, stream_);
cuda::clear_async(affine_transform_d_.get(), AFF_MAT_SIZE, stream_);
cuda::clear_async(affine_past2current_d_.get(), AFF_MAT_SIZE, stream_);
CHECK_CUDA_ERROR(cudaStreamSynchronize(stream_));

CHECK_CUDA_ERROR(cudaMemcpyAsync(
cloud_data_d_.get(), pc_msg.data.data(), pc_msg.data.size() * sizeof(unsigned char),
cudaMemcpyHostToDevice, stream_));
CHECK_CUDA_ERROR(cudaMemcpyAsync(
affine_transform_d_.get(), affine_past2current.data(), AFF_MAT_SIZE * sizeof(float),
affine_past2current_d_.get(), affine_past2current.data(), AFF_MAT_SIZE * sizeof(float),
cudaMemcpyHostToDevice, stream_));
CHECK_CUDA_ERROR(cudaStreamSynchronize(stream_));

pre_ptr_->generateVoxelsInput_launch(
cloud_data_d_.get(), cloud_info_, points_agg, points_size, time_lag,
affine_transform_d_.get(), points_d.get());
affine_past2current_d_.get(), points_d.get());
CHECK_CUDA_ERROR(cudaStreamSynchronize(stream_));
points_agg += points_size;
}
Expand Down

0 comments on commit 8b59a37

Please sign in to comment.