Skip to content

Commit 29512b5

Browse files
committed
Fixing all launch files
1 parent 94363b8 commit 29512b5

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

cuboid_detection/launch/bbox_filter.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<!-- Launch ground plane segmentation -->
55
<include file="$(find cuboid_detection)/launch/ground_plane_segmentation.launch"/>
6-
<include file="$(find cuboid_detection)/launch/surface_normal_estimation.launch"/>
6+
<!-- <include file="$(find cuboid_detection)/launch/surface_normal_estimation.launch"/> -->
77

88
<!-- Detect 2D bbox -->
99
<node

cuboid_detection/launch/iterative_closest_point.launch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<!-- Launch Bounding Box Filter -->
55
<include file="$(find cuboid_detection)/launch/bbox_filter.launch"/>
6+
<include file="$(find cuboid_detection)/launch/surface_normal_estimation.launch"/>
67

78

89
<!-- Run ICP node -->

cuboid_detection/src/surface_normal_estimation.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct planeSegementationOutput
5858

5959

6060
pcl::ModelCoefficients::Ptr coefficients(new pcl::ModelCoefficients);
61+
bool coefficients_set = false;
6162

6263
void convert_icp_eigen_to_tf(Eigen::Matrix4f Tm)
6364
{
@@ -86,6 +87,7 @@ void convert_icp_eigen_to_tf(Eigen::Matrix4f Tm)
8687

8788
void coefficients_callback(const pcl_msgs::ModelCoefficients& input)
8889
{
90+
coefficients_set = true;
8991
pcl_conversions::toPCL(input, *coefficients);
9092
}
9193

@@ -154,6 +156,9 @@ pcl::SacModel model, Eigen::Vector3f plane_normal, bool invert_local)
154156
void callback(const sensor_msgs::PointCloud2ConstPtr& input)
155157
{
156158
// If Model Coefficients have been recieved:
159+
if(coefficients_set == false)
160+
return;
161+
157162
Eigen::Vector3f plane_normal(coefficients->values[0], coefficients->values[1], coefficients->values[2]);
158163

159164
if (debug) ROS_INFO("Got here.");
@@ -225,7 +230,7 @@ int main(int argc, char** argv)
225230
{
226231
// Initialize ROS
227232
ros::init(argc, argv, "surface_normal_estimation");
228-
ros::NodeHandle nh("~");
233+
ros::NodeHandle nh("~s");
229234

230235
// Get params from launch file
231236
nh.getParam("invert", invert);
@@ -252,10 +257,12 @@ int main(int argc, char** argv)
252257
std::cout << "Co-efficients Topic: " << coefficients_topic << std::endl;
253258

254259
// Create a ROS subscriber for the input point cloud
255-
ros::Subscriber sub = nh.subscribe(input_topic, 1, callback);
256260
ros::Subscriber sub_coeff = nh.subscribe("/ground_plane_segmentation/coefficients", 1, coefficients_callback);
261+
ros::Subscriber sub = nh.subscribe(input_topic, 1, callback);
257262

258263
// Create a ROS publisher for the normal coefficients
264+
pcl_pub = nh.advertise<sensor_msgs::PointCloud2>(output_topic, 1);
265+
// coef_pub = nh.advertise<pcl_msgs::ModelCoefficients>(coefficients_topic, 1);
259266
normal_x_pub = nh.advertise<pcl_msgs::ModelCoefficients>("/surface_segmentation/normal_x_coefficients", 1);
260267
normal_y_pub = nh.advertise<pcl_msgs::ModelCoefficients>("/surface_segmentation/normal_y_coefficients", 1);
261268
normal_z_pub = nh.advertise<pcl_msgs::ModelCoefficients>("/surface_segmentation/normal_z_coefficients", 1);

0 commit comments

Comments
 (0)