Increased minimum rtabmap version to 0.20.7. Updated OdomInfo msg with localScanMapFormat (fixed intensity channel wrongly converted to rgb). rtabmap.launch: Show in rviz filtered scan from odometry if icp_odometry is true. rtabmapviz: fixed hanging shutdown after a ctr-c. OdometryROS: can now publish local scan map with intensity channel. icp_odometry: fixed intensity ignored if voxel size is set.

This commit is contained in:
matlabbe
2020-11-28 17:28:45 -05:00
parent 371a826109
commit ada3e7082c
7 changed files with 64 additions and 33 deletions
+11 -1
View File
@@ -823,11 +823,21 @@ void OdometryROS::processData(const SensorData & data, const ros::Time & stamp,
if(odomLocalScanMap_.getNumSubscribers() && !info.localScanMap.isEmpty())
{
sensor_msgs::PointCloud2 cloudMsg;
if(info.localScanMap.hasNormals())
if(info.localScanMap.hasNormals() && info.localScanMap.hasIntensity())
{
pcl::PointCloud<pcl::PointXYZINormal>::Ptr cloud = util3d::laserScanToPointCloudINormal(info.localScanMap, info.localScanMap.localTransform());
pcl::toROSMsg(*cloud, cloudMsg);
}
else if(info.localScanMap.hasNormals())
{
pcl::PointCloud<pcl::PointNormal>::Ptr cloud = util3d::laserScanToPointCloudNormal(info.localScanMap, info.localScanMap.localTransform());
pcl::toROSMsg(*cloud, cloudMsg);
}
else if(info.localScanMap.hasIntensity())
{
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud = util3d::laserScanToPointCloudI(info.localScanMap, info.localScanMap.localTransform());
pcl::toROSMsg(*cloud, cloudMsg);
}
else
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = util3d::laserScanToPointCloud(info.localScanMap, info.localScanMap.localTransform());