Skip to content

Commit

Permalink
Update velodyne_decoder_ros_wrapper.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
amc-nu authored Aug 8, 2023
1 parent 3065104 commit 8ab8d58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nebula_ros/src/velodyne/velodyne_decoder_ros_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void VelodyneDriverRosWrapper::ReceiveScanMsgCallback(
std::tuple<nebula::drivers::NebulaPointCloudPtr, double> pointcloud_ts =
driver_ptr_->ConvertScanToPointcloud(scan_msg);
nebula::drivers::NebulaPointCloudPtr pointcloud = std::get<0>(pointcloud_ts);
double cloud_stamp = std::get<1>(pointcloud_ts);
if (pointcloud == nullptr) {
RCLCPP_WARN_STREAM(get_logger(), "Empty cloud parsed.");
return;
Expand Down Expand Up @@ -77,7 +78,7 @@ void VelodyneDriverRosWrapper::ReceiveScanMsgCallback(
aw_points_ex_pub_->get_subscription_count() > 0 ||
aw_points_ex_pub_->get_intra_process_subscription_count() > 0) {
const auto autoware_ex_cloud =
nebula::drivers::convertPointXYZIRCAEDTToPointXYZIRADT(pointcloud, 0.0);//velodyne drivers originally doesn't use absolute time
nebula::drivers::convertPointXYZIRCAEDTToPointXYZIRADT(pointcloud, cloud_stamp);
auto ros_pc_msg_ptr = std::make_unique<sensor_msgs::msg::PointCloud2>();
pcl::toROSMsg(*autoware_ex_cloud, *ros_pc_msg_ptr);
ros_pc_msg_ptr->header.stamp =
Expand Down

0 comments on commit 8ab8d58

Please sign in to comment.