mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +08:00
fixed #436
This commit is contained in:
@@ -19,10 +19,23 @@
|
|||||||
<remap from="rgb/image" to="rgb/image_out"/>
|
<remap from="rgb/image" to="rgb/image_out"/>
|
||||||
<remap from="depth/image" to="depth/image_out"/>
|
<remap from="depth/image" to="depth/image_out"/>
|
||||||
<remap from="rgb/camera_info" to="rgb/camera_info_out"/>
|
<remap from="rgb/camera_info" to="rgb/camera_info_out"/>
|
||||||
<remap from="cloud" to="/voxel_cloud" />
|
<remap from="cloud" to="/voxel_cloud_xyzrgb" />
|
||||||
|
|
||||||
<param name="voxel_size" type="double" value="0.02"/>
|
<param name="voxel_size" type="double" value="0.02"/>
|
||||||
<param name="decimation" type="int" value="2"/>
|
<param name="decimation" type="int" value="2"/>
|
||||||
|
<param name="noise_filter_radius" type="double" value="0.05"/>
|
||||||
|
<param name="normal_k" type="int" value="6"/>
|
||||||
|
</node>
|
||||||
|
|
||||||
|
<node pkg="nodelet" type="nodelet" name="points_xyz" args="load rtabmap_ros/point_cloud_xyz camera_nodelet_manager">
|
||||||
|
<remap from="depth/image" to="depth/image_out"/>
|
||||||
|
<remap from="depth/camera_info" to="rgb/camera_info_out"/>
|
||||||
|
<remap from="cloud" to="/voxel_cloud_xyz" />
|
||||||
|
|
||||||
|
<param name="voxel_size" type="double" value="0.02"/>
|
||||||
|
<param name="decimation" type="int" value="2"/>
|
||||||
|
<param name="noise_filter_radius" type="double" value="0.05"/>
|
||||||
|
<param name="normal_k" type="int" value="6"/>
|
||||||
</node>
|
</node>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
|||||||
@@ -291,10 +291,11 @@ private:
|
|||||||
if(indices->size() && voxelSize_ > 0.0)
|
if(indices->size() && voxelSize_ > 0.0)
|
||||||
{
|
{
|
||||||
pclCloud = rtabmap::util3d::voxelize(pclCloud, indices, voxelSize_);
|
pclCloud = rtabmap::util3d::voxelize(pclCloud, indices, voxelSize_);
|
||||||
|
pclCloud->is_dense = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do radius filtering after voxel filtering ( a lot faster)
|
// Do radius filtering after voxel filtering ( a lot faster)
|
||||||
if(pclCloud->size() && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
if(!pclCloud->empty() && (pclCloud->is_dense || !indices->empty()) && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
||||||
{
|
{
|
||||||
if(pclCloud->is_dense)
|
if(pclCloud->is_dense)
|
||||||
{
|
{
|
||||||
@@ -310,7 +311,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
sensor_msgs::PointCloud2 rosCloud;
|
sensor_msgs::PointCloud2 rosCloud;
|
||||||
if(pclCloud->size() && (normalK_ > 0 || normalRadius_ > 0.0f))
|
if(!pclCloud->empty() && (pclCloud->is_dense || !indices->empty()) && (normalK_ > 0 || normalRadius_ > 0.0f))
|
||||||
{
|
{
|
||||||
//compute normals
|
//compute normals
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr normals = rtabmap::util3d::computeNormals(pclCloud, normalK_, normalRadius_);
|
pcl::PointCloud<pcl::Normal>::Ptr normals = rtabmap::util3d::computeNormals(pclCloud, normalK_, normalRadius_);
|
||||||
|
|||||||
@@ -470,10 +470,11 @@ private:
|
|||||||
if(indices->size() && voxelSize_ > 0.0)
|
if(indices->size() && voxelSize_ > 0.0)
|
||||||
{
|
{
|
||||||
pclCloud = rtabmap::util3d::voxelize(pclCloud, indices, voxelSize_);
|
pclCloud = rtabmap::util3d::voxelize(pclCloud, indices, voxelSize_);
|
||||||
|
pclCloud->is_dense = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do radius filtering after voxel filtering ( a lot faster)
|
// Do radius filtering after voxel filtering ( a lot faster)
|
||||||
if(pclCloud->size() && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
if(!pclCloud->empty() && (pclCloud->is_dense || !indices->empty()) && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
||||||
{
|
{
|
||||||
if(pclCloud->is_dense)
|
if(pclCloud->is_dense)
|
||||||
{
|
{
|
||||||
@@ -489,7 +490,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
sensor_msgs::PointCloud2 rosCloud;
|
sensor_msgs::PointCloud2 rosCloud;
|
||||||
if(pclCloud->size() && (normalK_ > 0 || normalRadius_ > 0.0f))
|
if(!pclCloud->empty() && (pclCloud->is_dense || !indices->empty()) && (normalK_ > 0 || normalRadius_ > 0.0f))
|
||||||
{
|
{
|
||||||
//compute normals
|
//compute normals
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr normals = rtabmap::util3d::computeNormals(pclCloud, normalK_, normalRadius_);
|
pcl::PointCloud<pcl::Normal>::Ptr normals = rtabmap::util3d::computeNormals(pclCloud, normalK_, normalRadius_);
|
||||||
|
|||||||
Reference in New Issue
Block a user