fixed "CameraModel() Condition (fx > 0.0) not met! [fx=0.000000]" error on appearance-based demo

This commit is contained in:
matlabbe
2020-02-21 10:45:54 -05:00
parent ee9d16994f
commit 7d0711878e
+15 -8
View File
@@ -896,14 +896,21 @@ rtabmap::Signature nodeDataFromROS(const rtabmap_ros::NodeData & msg)
{
for(unsigned int i=0; i<msg.fx.size(); ++i)
{
models.push_back(rtabmap::CameraModel(
msg.fx[i],
msg.fy[i],
msg.cx[i],
msg.cy[i],
transformFromGeometryMsg(msg.localTransform[i]),
0.0,
cv::Size(msg.width[i], msg.height[i])));
if(msg.fx[i] == 0)
{
models.push_back(rtabmap::CameraModel());
}
else
{
models.push_back(rtabmap::CameraModel(
msg.fx[i],
msg.fy[i],
msg.cx[i],
msg.cy[i],
transformFromGeometryMsg(msg.localTransform[i]),
0.0,
cv::Size(msg.width[i], msg.height[i])));
}
}
}
}