Skip to content

Commit

Permalink
fix: segmentation fault from uninitialized pointer (#933)(backport) (#…
Browse files Browse the repository at this point in the history
…348)

fix: segmentation fault from uninitialized pointer (#933)

tf2_buffer_ and tf2_listener_ were not initialized, causing segfault
when the input cloud frame is not output_frame_ in
PointCloudConcatenateDataSynchronizerComponent::transformPointCloud

Co-authored-by: Vincent Richard <[email protected]>
Co-authored-by: Vincent Richard <[email protected]>
  • Loading branch information
3 people authored Apr 6, 2023
1 parent b20c054 commit 859af0a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ PointCloudConcatenateDataSynchronizerComponent::PointCloudConcatenateDataSynchro
}
}

// tf2 listener
{
tf2_buffer_ = std::make_shared<tf2_ros::Buffer>(this->get_clock());
tf2_listener_ = std::make_shared<tf2_ros::TransformListener>(*tf2_buffer_);
}

// Publishers
{
pub_output_ = this->create_publisher<PointCloud2>(
Expand Down

0 comments on commit 859af0a

Please sign in to comment.