Fixed remaining default constructor calls
parent
12d04abb1e
commit
b2d2301533
|
|
@ -106,7 +106,8 @@ public:
|
|||
|
||||
// Allocate result
|
||||
size_t m = this->size();
|
||||
std::vector<Z> z(m);
|
||||
std::vector<Z> z;
|
||||
z.reserve(m);
|
||||
|
||||
// Allocate derivatives
|
||||
if (E) E->resize(ZDim * m, N);
|
||||
|
|
@ -116,7 +117,7 @@ public:
|
|||
for (size_t i = 0; i < m; i++) {
|
||||
MatrixZD Fi;
|
||||
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 (E) E->block<ZDim, N>(ZDim * i, 0) = Ei;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
/// @{
|
||||
|
||||
/** 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ TEST( Point2, unit) {
|
|||
namespace {
|
||||
/* ************************************************************************* */
|
||||
// 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);
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
|||
|
|
@ -62,15 +62,13 @@ namespace gtsam {
|
|||
|
||||
/* ************************************************************************* */
|
||||
template <class VALUE>
|
||||
ExtendedKalmanFilter<VALUE>::ExtendedKalmanFilter(Key key_initial, T x_initial,
|
||||
noiseModel::Gaussian::shared_ptr P_initial) {
|
||||
|
||||
// Set the initial linearization point to the provided mean
|
||||
x_ = x_initial;
|
||||
|
||||
ExtendedKalmanFilter<VALUE>::ExtendedKalmanFilter(
|
||||
Key key_initial, T x_initial, noiseModel::Gaussian::shared_ptr P_initial)
|
||||
: x_(x_initial) // Set the initial linearization point
|
||||
{
|
||||
// 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
|
||||
// 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);
|
||||
priorFactor_ = JacobianFactor::shared_ptr(
|
||||
new JacobianFactor(key_initial, P_initial->R(), Vector::Zero(n),
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ public:
|
|||
// The point d*P1 = (x,y,1) is computed in constructor as dP1_
|
||||
|
||||
// Project to normalized image coordinates, then uncalibrate
|
||||
Point2 pn;
|
||||
Point2 pn(0,0);
|
||||
if (!DE && !Dd) {
|
||||
|
||||
Point3 _1T2 = E.direction().point3();
|
||||
|
|
|
|||
|
|
@ -300,20 +300,14 @@ TEST( SmartProjectionCameraFactor, perturbPoseAndOptimizeFromSfM_tracks ) {
|
|||
|
||||
SfM_Track track1;
|
||||
for (size_t i = 0; i < 3; ++i) {
|
||||
SfM_Measurement measures;
|
||||
measures.first = i + 1; // cameras are from 1 to 3
|
||||
measures.second = measurements_cam1.at(i);
|
||||
track1.measurements.push_back(measures);
|
||||
track1.measurements.emplace_back(i + 1, measurements_cam1.at(i));
|
||||
}
|
||||
SmartFactor::shared_ptr smartFactor1(new SmartFactor(unit2));
|
||||
smartFactor1->add(track1);
|
||||
|
||||
SfM_Track track2;
|
||||
for (size_t i = 0; i < 3; ++i) {
|
||||
SfM_Measurement measures;
|
||||
measures.first = i + 1; // cameras are from 1 to 3
|
||||
measures.second = measurements_cam2.at(i);
|
||||
track2.measurements.push_back(measures);
|
||||
track2.measurements.emplace_back(i + 1, measurements_cam2.at(i));
|
||||
}
|
||||
SmartFactor::shared_ptr smartFactor2(new SmartFactor(unit2));
|
||||
smartFactor2->add(track2);
|
||||
|
|
|
|||
Loading…
Reference in New Issue