mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-06 17:57:45 +08:00
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:
+27
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user