Fixed remaining default constructor calls

release/4.3a0
Frank 2016-06-06 17:12:42 -07:00
parent 12d04abb1e
commit b2d2301533
6 changed files with 16 additions and 23 deletions

View File

@ -106,7 +106,8 @@ public:
// Allocate result // Allocate result
size_t m = this->size(); size_t m = this->size();
std::vector<Z> z(m); std::vector<Z> z;
z.reserve(m);
// Allocate derivatives // Allocate derivatives
if (E) E->resize(ZDim * m, N); if (E) E->resize(ZDim * m, N);
@ -116,7 +117,7 @@ public:
for (size_t i = 0; i < m; i++) { for (size_t i = 0; i < m; i++) {
MatrixZD Fi; MatrixZD Fi;
Eigen::Matrix<double, ZDim, N> Ei; Eigen::Matrix<double, ZDim, N> Ei;
z[i] = this->at(i).project2(point, Fs ? &Fi : 0, E ? &Ei : 0); z.emplace_back(this->at(i).project2(point, Fs ? &Fi : 0, E ? &Ei : 0));
if (Fs) (*Fs)[i] = Fi; if (Fs) (*Fs)[i] = Fi;
if (E) E->block<ZDim, N>(ZDim * i, 0) = Ei; if (E) E->block<ZDim, N>(ZDim * i, 0) = Ei;
} }

View File

@ -88,7 +88,7 @@ public:
/// @{ /// @{
/** Construct from canonical coordinates \f$ [T_x,T_y,\theta] \f$ (Lie algebra) */ /** Construct from canonical coordinates \f$ [T_x,T_y,\theta] \f$ (Lie algebra) */
Pose2(const Vector& v) { Pose2(const Vector& v) : Pose2() {
*this = Expmap(v); *this = Expmap(v);
} }

View File

@ -119,7 +119,7 @@ TEST( Point2, unit) {
namespace { namespace {
/* ************************************************************************* */ /* ************************************************************************* */
// some shared test values // some shared test values
Point2 x1, x2(1, 1), x3(1, 1); Point2 x1(0,0), x2(1, 1), x3(1, 1);
Point2 l1(1, 0), l2(1, 1), l3(2, 2), l4(1, 3); Point2 l1(1, 0), l2(1, 1), l3(2, 2), l4(1, 3);
/* ************************************************************************* */ /* ************************************************************************* */

View File

@ -61,16 +61,14 @@ namespace gtsam {
} }
/* ************************************************************************* */ /* ************************************************************************* */
template<class VALUE> template <class VALUE>
ExtendedKalmanFilter<VALUE>::ExtendedKalmanFilter(Key key_initial, T x_initial, ExtendedKalmanFilter<VALUE>::ExtendedKalmanFilter(
noiseModel::Gaussian::shared_ptr P_initial) { Key key_initial, T x_initial, noiseModel::Gaussian::shared_ptr P_initial)
: x_(x_initial) // Set the initial linearization point
// Set the initial linearization point to the provided mean {
x_ = x_initial;
// Create a Jacobian Prior Factor directly P_initial. // Create a Jacobian Prior Factor directly P_initial.
// Since x0 is set to the provided mean, the b vector in the prior will be zero // Since x0 is set to the provided mean, the b vector in the prior will be zero
// TODO Frank asks: is there a reason why noiseModel is not simply P_initial ? // TODO(Frank): is there a reason why noiseModel is not simply P_initial?
int n = traits<T>::GetDimension(x_initial); int n = traits<T>::GetDimension(x_initial);
priorFactor_ = JacobianFactor::shared_ptr( priorFactor_ = JacobianFactor::shared_ptr(
new JacobianFactor(key_initial, P_initial->R(), Vector::Zero(n), new JacobianFactor(key_initial, P_initial->R(), Vector::Zero(n),

View File

@ -162,7 +162,7 @@ public:
// The point d*P1 = (x,y,1) is computed in constructor as dP1_ // The point d*P1 = (x,y,1) is computed in constructor as dP1_
// Project to normalized image coordinates, then uncalibrate // Project to normalized image coordinates, then uncalibrate
Point2 pn; Point2 pn(0,0);
if (!DE && !Dd) { if (!DE && !Dd) {
Point3 _1T2 = E.direction().point3(); Point3 _1T2 = E.direction().point3();

View File

@ -300,20 +300,14 @@ TEST( SmartProjectionCameraFactor, perturbPoseAndOptimizeFromSfM_tracks ) {
SfM_Track track1; SfM_Track track1;
for (size_t i = 0; i < 3; ++i) { for (size_t i = 0; i < 3; ++i) {
SfM_Measurement measures; track1.measurements.emplace_back(i + 1, measurements_cam1.at(i));
measures.first = i + 1; // cameras are from 1 to 3
measures.second = measurements_cam1.at(i);
track1.measurements.push_back(measures);
} }
SmartFactor::shared_ptr smartFactor1(new SmartFactor(unit2)); SmartFactor::shared_ptr smartFactor1(new SmartFactor(unit2));
smartFactor1->add(track1); smartFactor1->add(track1);
SfM_Track track2; SfM_Track track2;
for (size_t i = 0; i < 3; ++i) { for (size_t i = 0; i < 3; ++i) {
SfM_Measurement measures; track2.measurements.emplace_back(i + 1, measurements_cam2.at(i));
measures.first = i + 1; // cameras are from 1 to 3
measures.second = measurements_cam2.at(i);
track2.measurements.push_back(measures);
} }
SmartFactor::shared_ptr smartFactor2(new SmartFactor(unit2)); SmartFactor::shared_ptr smartFactor2(new SmartFactor(unit2));
smartFactor2->add(track2); smartFactor2->add(track2);