Skip to content

Commit

Permalink
Merge pull request #260 from borglab/fix/cmake-wrapper-warnings
Browse files Browse the repository at this point in the history
Fixed some wrapper warnings
  • Loading branch information
varunagrawal authored Mar 29, 2020
2 parents 8194b93 + 02ff7ae commit 9361d5b
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ add_subdirectory(CppUnitLite)
# Build wrap
if (GTSAM_BUILD_WRAP)
add_subdirectory(wrap)
# suppress warning of cython line being too long
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation")
endif()
endif(GTSAM_BUILD_WRAP)

# Build GTSAM library
Expand Down
2 changes: 1 addition & 1 deletion gtsam/geometry/tests/testEssentialMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ TEST (EssentialMatrix, rotate) {
Matrix actH1, actH2;
try {
bodyE.rotate(cRb, actH1, actH2);
} catch (exception e) {
} catch (exception& e) {
} // avoid exception
Matrix expH1 = numericalDerivative21(rotate_, bodyE, cRb), //
expH2 = numericalDerivative22(rotate_, bodyE, cRb);
Expand Down
9 changes: 7 additions & 2 deletions gtsam/navigation/PreintegrationParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ struct GTSAM_EXPORT PreintegrationParams: PreintegratedRotationParams {
bool use2ndOrderCoriolis; ///< Whether to use second order Coriolis integration
Vector3 n_gravity; ///< Gravity vector in nav frame

/// Default constructor for serialization only
PreintegrationParams()
: accelerometerCovariance(I_3x3),
integrationCovariance(I_3x3),
use2ndOrderCoriolis(false),
n_gravity(0, 0, -1) {}

/// The Params constructor insists on getting the navigation frame gravity vector
/// For convenience, two commonly used conventions are provided by named constructors below
PreintegrationParams(const Vector3& n_gravity)
Expand Down Expand Up @@ -60,8 +67,6 @@ struct GTSAM_EXPORT PreintegrationParams: PreintegratedRotationParams {
bool getUse2ndOrderCoriolis() const { return use2ndOrderCoriolis; }

protected:
/// Default constructor for serialization only: uninitialized!
PreintegrationParams() {}

/** Serialization function */
friend class boost::serialization::access;
Expand Down
6 changes: 3 additions & 3 deletions gtsam/navigation/tests/testImuFactorSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ TEST(ImuFactor, serialization) {

ImuFactor factor(1, 2, 3, 4, 5, pim);

EXPECT(equalsObj(factor));
EXPECT(equalsXML(factor));
EXPECT(equalsBinary(factor));
EXPECT(equalsObj<ImuFactor>(factor));
EXPECT(equalsXML<ImuFactor>(factor));
EXPECT(equalsBinary<ImuFactor>(factor));
}

/* ************************************************************************* */
Expand Down
6 changes: 6 additions & 0 deletions gtsam/nonlinear/NonlinearEquality.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ class NonlinearEquality: public NoiseModelFactor1<VALUE> {

/// @}

EIGEN_MAKE_ALIGNED_OPERATOR_NEW

private:

/** Serialization function */
Expand Down Expand Up @@ -263,6 +265,8 @@ class NonlinearEquality1: public NoiseModelFactor1<VALUE> {
traits<X>::Print(value_, "Value");
}

EIGEN_MAKE_ALIGNED_OPERATOR_NEW

private:

/** Serialization function */
Expand Down Expand Up @@ -327,6 +331,8 @@ class NonlinearEquality2: public NoiseModelFactor2<VALUE, VALUE> {
return traits<X>::Local(x1,x2);
}

EIGEN_MAKE_ALIGNED_OPERATOR_NEW

private:

/** Serialization function */
Expand Down
7 changes: 5 additions & 2 deletions gtsam/nonlinear/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,16 @@ Values localToWorld(const Values& local, const Pose2& base,
// if value is a Pose2, compose it with base pose
Pose2 pose = local.at<Pose2>(key);
world.insert(key, base.compose(pose));
} catch (std::exception e1) {
} catch (const std::exception& e1) {
try {
// if value is a Point2, transform it from base pose
Point2 point = local.at<Point2>(key);
world.insert(key, base.transformFrom(point));
} catch (std::exception e2) {
} catch (const std::exception& e2) {
// if not Pose2 or Point2, do nothing
#ifndef NDEBUG
std::cerr << "Values[key] is neither Pose2 nor Point2, so skip" << std::endl;
#endif
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions gtsam_unstable/slam/AHRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class GTSAM_UNSTABLE_EXPORT AHRS {
void print(const std::string& s = "") const;

virtual ~AHRS();

EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};

} /* namespace gtsam */
Expand Down

0 comments on commit 9361d5b

Please sign in to comment.