MsgConversion/laser: check if intensity field has the supported datatype before converting. PointCloud2Depth: added {cloud}_transformed output topic (with same stamp and frame_id than the depth image).

This commit is contained in:
matlabbe
2020-03-24 17:40:06 -04:00
parent aec4fe6bcc
commit aced8a8c93
2 changed files with 40 additions and 4 deletions
+27 -2
View File
@@ -1788,10 +1788,21 @@ bool convertScanMsg(
bool containIntensity = false;
for(unsigned int i=0; i<scanOut.fields.size(); ++i)
{
if(scanOut.fields[i].name.compare("intensity") == 0)
if(scanOut.fields[i].datatype == sensor_msgs::PointField::FLOAT32)
{
containIntensity = true;
}
else
{
static bool warningShown = false;
if(!warningShown)
{
ROS_WARN("The input scan cloud has an \"intensity\" field "
"but the datatype (%d) is not supported. Intensity will be ignored. "
"This message is only shown once.", scanOut.fields[i].datatype);
warningShown = true;
}
}
}
rtabmap::LaserScan::Format format;
@@ -1860,7 +1871,21 @@ bool convertScan3dMsg(
}
if(scan3dMsg->fields[i].name.compare("intensity") == 0)
{
containIntensity = true;
if(scan3dMsg->fields[i].datatype == sensor_msgs::PointField::FLOAT32)
{
containIntensity = true;
}
else
{
static bool warningShown = false;
if(!warningShown)
{
ROS_WARN("The input scan cloud has an \"intensity\" field "
"but the datatype (%d) is not supported. Intensity will be ignored. "
"This message is only shown once.", scan3dMsg->fields[i].datatype);
warningShown = true;
}
}
}
}