mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-05 17:27:46 +08:00
Refactoring: removed some code duplication about transformation estimation and features (2D-3D) extraction.
Added Feature2D::generateKeypoints3D() for convenience. Added parameter "Vis/PnPOpenCV2". Added parameter "Vis/ForwardEstOnly". Removed OdometryOpticalFlow class, replaced by OdometryF2F (frame-to-frame). To get the same previous OpticalFLow approach, parameter "Vis/CorType" should be set to 1. Some parameters under group "OdomFlow/..." are now under "Vis/CorFlow...". In Registration class, add computeTransformationMod() method to modify input signatures. Added constructor Signature(SensorData) for convenience. Modified words multimap used with cv::Point3f instead of pcl::PointXYZ to limit the use of PCL headers where they are not really required. Added Stereo::create() for convenience. Transform: fixed quaternion constructor where data_ was not initialized. Added parentheses operator for convenience. DatabaseViewer: loading .rtabmap/rtabmap.ini instead of .rtabmap/dbViewer.ini when used from rtabmap application. Added vertical layout option for convenience. MainWindow: fixed wrong Odometry speed values ParametersToolBox: using QStackedWidget instead of a QToolBox for space, added "Restore Defaults" button.
This commit is contained in:
@@ -67,21 +67,22 @@ Transform::Transform(float x, float y, float z, float roll, float pitch, float y
|
||||
*this = fromEigen3f(t);
|
||||
}
|
||||
|
||||
Transform::Transform(float x, float y, float z, float qx, float qy, float qz, float qw)
|
||||
Transform::Transform(float x, float y, float z, float qx, float qy, float qz, float qw) :
|
||||
data_(cv::Mat::zeros(3,4,CV_32FC1))
|
||||
{
|
||||
Eigen::Matrix3f rotation = Eigen::Quaternionf(qw, qx, qy, qz).toRotationMatrix();
|
||||
data()[0] = rotation(0,0);
|
||||
data()[1] = rotation(0,1);
|
||||
data()[2] = rotation(0,2);
|
||||
data()[3] = 0.0f;
|
||||
data()[3] = x;
|
||||
data()[4] = rotation(1,0);
|
||||
data()[5] = rotation(1,1);
|
||||
data()[6] = rotation(1,2);
|
||||
data()[7] = 0.0f;
|
||||
data()[7] = y;
|
||||
data()[8] = rotation(2,0);
|
||||
data()[9] = rotation(2,1);
|
||||
data()[10] = rotation(2,2);
|
||||
data()[11] = 0.0f;
|
||||
data()[11] = z;
|
||||
}
|
||||
|
||||
Transform::Transform(float x, float y, float theta)
|
||||
@@ -92,7 +93,8 @@ Transform::Transform(float x, float y, float theta)
|
||||
|
||||
bool Transform::isNull() const
|
||||
{
|
||||
return (data()[0] == 0.0f &&
|
||||
return (data_.empty() ||
|
||||
(data()[0] == 0.0f &&
|
||||
data()[1] == 0.0f &&
|
||||
data()[2] == 0.0f &&
|
||||
data()[3] == 0.0f &&
|
||||
@@ -115,7 +117,7 @@ bool Transform::isNull() const
|
||||
uIsNan(data()[8]) ||
|
||||
uIsNan(data()[9]) ||
|
||||
uIsNan(data()[10]) ||
|
||||
uIsNan(data()[11]);
|
||||
uIsNan(data()[11]));
|
||||
}
|
||||
|
||||
bool Transform::isIdentity() const
|
||||
|
||||
Reference in New Issue
Block a user