Skip to content

Commit

Permalink
fixed issue iralabdisco#5
Browse files Browse the repository at this point in the history
  • Loading branch information
shannon112 committed Sep 13, 2019
1 parent 751d310 commit f65d04a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
8 changes: 3 additions & 5 deletions launch/laserscan_multi_merger.launch
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<!--
DESCRITPION
-->


<launch>
<node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger" output="screen">
<param name="destination_frame" value="/cart_frame"/>
<node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger" output="screen">
<param name="destination_frame" value="/base_link"/>
<param name="cloud_destination_topic" value="/merged_cloud"/>
<param name="scan_destination_topic" value="/scan_multi"/>
<param name="laserscan_topics" value ="scandx scansx" /> <!-- LIST OF THE LASER SCAN TOPICS TO SUBSCRIBE -->
<param name="laserscan_topics" value ="/front_scan /back_scan" /> <!-- LIST OF THE LASER SCAN TOPICS TO SUBSCRIBE -->
</node>
</launch>
20 changes: 10 additions & 10 deletions src/laserscan_multi_merger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <pcl/io/pcd_io.h>
#include <sensor_msgs/PointCloud.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/point_cloud_conversion.h>
#include <sensor_msgs/point_cloud_conversion.h>
#include "sensor_msgs/LaserScan.h"
#include "pcl_ros/point_cloud.h"
#include <Eigen/Dense>
Expand Down Expand Up @@ -82,13 +82,13 @@ void LaserscanMerger::laserscan_topic_parser()

for(int i=0;i<tokens.size();++i)
{
for(int j=0;j<topics.size();++j)
{
if( (tokens[i].compare(topics[j].name) == 0) && (topics[j].datatype.compare("sensor_msgs/LaserScan") == 0) )
{
tmp_input_topics.push_back(topics[j].name);
}
}
// for(int j=0;j<topics.size();++j)
// {
// if( (tokens[i].compare(topics[j].name) == 0) && (topics[j].datatype.compare("sensor_msgs/LaserScan") == 0) )
// {
tmp_input_topics.push_back(tokens[i]);
// }
// }
}

sort(tmp_input_topics.begin(),tmp_input_topics.end());
Expand Down Expand Up @@ -162,7 +162,7 @@ void LaserscanMerger::scanCallback(const sensor_msgs::LaserScan::ConstPtr& scan,
pcl_conversions::toPCL(tmpCloud3, clouds[i]);
clouds_modified[i] = true;
}
}
}

// Count how many scans we have
int totalClouds = 0;
Expand All @@ -181,7 +181,7 @@ void LaserscanMerger::scanCallback(const sensor_msgs::LaserScan::ConstPtr& scan,
pcl::concatenatePointCloud(merged_cloud, clouds[i], merged_cloud);
clouds_modified[i] = false;
}

point_cloud_publisher_.publish(merged_cloud);

Eigen::MatrixXf points;
Expand Down

0 comments on commit f65d04a

Please sign in to comment.