Camera class: localTransform parameter should not have optical rotation anymore (it is added afterwards in the constructor). OdomSensor: the extrinsics should not contain optical rotation anymore. These 2 changes make it more convenient to set transfomation parameters in the UI. MainWindow::createCamera() now has odomSensor argument for convenience (for inherited classes to set both camera and odom sensor in the same function).

This commit is contained in:
matlabbe
2021-05-26 13:40:46 -04:00
parent 21dbeed4b7
commit ada3e75005
34 changed files with 96 additions and 80 deletions

View File

@@ -45,7 +45,7 @@ namespace rtabmap
Camera::Camera(float imageRate, const Transform & localTransform) :
_imageRate(imageRate),
_localTransform(localTransform),
_localTransform(localTransform*CameraModel::opticalRotation()),
_targetImageSize(0,0),
_frameRateTimer(new UTimer()),
_seq(0)

View File

@@ -88,7 +88,7 @@ CameraThread::CameraThread(
const ParametersMap & parameters) :
_camera(camera),
_odomSensor(odomSensor),
_extrinsicsOdomToCamera(extrinsics),
_extrinsicsOdomToCamera(extrinsics * CameraModel::opticalRotation()),
_odomAsGt(odomAsGt),
_poseTimeOffset(poseTimeOffset),
_poseScaleFactor(poseScaleFactor),
@@ -123,14 +123,13 @@ CameraThread::CameraThread(
// ownership transferred
CameraThread::CameraThread(
Camera * camera,
float poseScaleFactor,
bool odomAsGt,
const ParametersMap & parameters) :
_camera(camera),
_odomSensor(0),
_odomAsGt(odomAsGt),
_poseTimeOffset(0.0),
_poseScaleFactor(poseScaleFactor),
_poseScaleFactor(1.0f),
_mirroring(false),
_stereoExposureCompensation(false),
_colorOnly(false),
@@ -153,7 +152,6 @@ CameraThread::CameraThread(
_imuBaseFrameConversion(false)
{
UASSERT(_camera != 0);
UDEBUG("_poseScaleFactor =%f", _poseScaleFactor);
UDEBUG("_odomAsGt =%s", _odomAsGt?"true":"false");
}

View File

@@ -1186,7 +1186,7 @@ void CameraRealSense2::setDualMode(bool enabled, const Transform & extrinsics)
#ifdef RTABMAP_REALSENSE2
UASSERT(!enabled || !extrinsics.isNull());
dualMode_ = enabled;
dualExtrinsics_ = extrinsics;
dualExtrinsics_ = extrinsics*CameraModel::opticalRotation();
if(dualMode_)
{
odometryProvided_ = true;