Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always true condition? #54

Open
VRichardJP opened this issue Jun 7, 2024 · 0 comments
Open

Always true condition? #54

VRichardJP opened this issue Jun 7, 2024 · 0 comments

Comments

@VRichardJP
Copy link
Contributor

What is the point of the branching here:

// publish keyframe scan for map
if (this->vf_use_) {
if (kf.second->points.size() == kf.second->width * kf.second->height) {
sensor_msgs::PointCloud2 keyframe_cloud_ros;
pcl::toROSMsg(*kf.second, keyframe_cloud_ros);
keyframe_cloud_ros.header.stamp = timestamp;
keyframe_cloud_ros.header.frame_id = this->odom_frame;
this->kf_cloud_pub.publish(keyframe_cloud_ros);
}
} else {
sensor_msgs::PointCloud2 keyframe_cloud_ros;
pcl::toROSMsg(*kf.second, keyframe_cloud_ros);
keyframe_cloud_ros.header.stamp = timestamp;
keyframe_cloud_ros.header.frame_id = this->odom_frame;
this->kf_cloud_pub.publish(keyframe_cloud_ros);
}

I ran DLIO on some sample data and I noticed kf.second->points.size() == kf.second->width * kf.second->height is always true. So is there any need for a branching?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant