mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
MainWindow: add fake frustum when only lidar is received
This commit is contained in:
@@ -4205,6 +4205,7 @@ Signature * Memory::createSignature(const SensorData & inputData, const Transfor
|
|||||||
"full calibration. If images are already rectified, set %s parameter back to true.",
|
"full calibration. If images are already rectified, set %s parameter back to true.",
|
||||||
(int)i,
|
(int)i,
|
||||||
Parameters::kRtabmapImagesAlreadyRectified().c_str());
|
Parameters::kRtabmapImagesAlreadyRectified().c_str());
|
||||||
|
std::cout << data.cameraModels()[i] << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1410,6 +1410,30 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
|
|||||||
{
|
{
|
||||||
_cloudViewer->updateCameraFrustum(_odometryCorrection*odom.pose(), odom.data().stereoCameraModel());
|
_cloudViewer->updateCameraFrustum(_odometryCorrection*odom.pose(), odom.data().stereoCameraModel());
|
||||||
}
|
}
|
||||||
|
else if(!odom.data().laserScanRaw().isEmpty() ||
|
||||||
|
!odom.data().laserScanCompressed().isEmpty())
|
||||||
|
{
|
||||||
|
Transform scanLocalTransform;
|
||||||
|
if(!odom.data().laserScanRaw().isEmpty())
|
||||||
|
{
|
||||||
|
scanLocalTransform = odom.data().laserScanRaw().localTransform();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scanLocalTransform = odom.data().laserScanCompressed().localTransform();
|
||||||
|
}
|
||||||
|
//fake frustum
|
||||||
|
CameraModel model(
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
1.5,
|
||||||
|
scanLocalTransform*CameraModel::opticalRotation(),
|
||||||
|
0,
|
||||||
|
cv::Size(4,3));
|
||||||
|
_cloudViewer->updateCameraFrustum(_odometryCorrection*odom.pose(), model);
|
||||||
|
|
||||||
|
}
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
|
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
|
||||||
if(_preferencesDialog->isFramesShown())
|
if(_preferencesDialog->isFramesShown())
|
||||||
{
|
{
|
||||||
@@ -2182,6 +2206,29 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
|||||||
{
|
{
|
||||||
_cloudViewer->updateCameraFrustum(poses.rbegin()->second, stat.getLastSignatureData().sensorData().stereoCameraModel());
|
_cloudViewer->updateCameraFrustum(poses.rbegin()->second, stat.getLastSignatureData().sensorData().stereoCameraModel());
|
||||||
}
|
}
|
||||||
|
else if(!stat.getLastSignatureData().sensorData().laserScanRaw().isEmpty() ||
|
||||||
|
!stat.getLastSignatureData().sensorData().laserScanCompressed().isEmpty())
|
||||||
|
{
|
||||||
|
Transform scanLocalTransform;
|
||||||
|
if(!stat.getLastSignatureData().sensorData().laserScanRaw().isEmpty())
|
||||||
|
{
|
||||||
|
scanLocalTransform = stat.getLastSignatureData().sensorData().laserScanRaw().localTransform();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scanLocalTransform = stat.getLastSignatureData().sensorData().laserScanCompressed().localTransform();
|
||||||
|
}
|
||||||
|
//fake frustum
|
||||||
|
CameraModel model(
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
1.5,
|
||||||
|
scanLocalTransform*CameraModel::opticalRotation(),
|
||||||
|
0,
|
||||||
|
cv::Size(4,3));
|
||||||
|
_cloudViewer->updateCameraFrustum(poses.rbegin()->second, model);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_cloudViewer->updateCameraTargetPosition(poses.rbegin()->second);
|
_cloudViewer->updateCameraTargetPosition(poses.rbegin()->second);
|
||||||
|
|||||||
Reference in New Issue
Block a user