fixed pcl warning when no 3D words are sent in info msgs

This commit is contained in:
Mathieu Labbe
2014-12-01 14:09:50 -05:00
parent 073c23c615
commit 6bad7bdf71
+4 -1
View File
@@ -206,7 +206,10 @@ void GuiWrapper::infoMapCallback(
std::multimap<int, cv::KeyPoint> words;
std::multimap<int, pcl::PointXYZ> words3D;
pcl::PointCloud<pcl::PointXYZ> cloud;
pcl::fromROSMsg(mapMsg->nodes[0].words3DValues, cloud);
if(mapMsg->nodes[0].words3DValues.data.size())
{
pcl::fromROSMsg(mapMsg->nodes[0].words3DValues, cloud);
}
for(unsigned int i=0; i<mapMsg->nodes[0].wordsKeys.size() && i<mapMsg->nodes[0].wordsValues.size(); ++i)
{
cv::KeyPoint pt;