Skip to content

Commit

Permalink
Merge pull request ethz-asl#213 from Kaju-Bubanja/feature/boost_1.67_…
Browse files Browse the repository at this point in the history
…fixes

Feature/boost 1.67 fixes
  • Loading branch information
Thomas Schneider authored Aug 17, 2018
2 parents 8579dc7 + 769d7c3 commit 1223f9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ boost::posix_time::time_duration DurationBase<T>::toBoost() const {
#if defined(BOOST_DATE_TIME_HAS_NANOSECONDS)
return bt::seconds(sec) + bt::nanoseconds(nsec);
#else
return bt::seconds(sec) + bt::microseconds(nsec / 1000.0);
return bt::seconds(sec) + bt::microseconds(static_cast<int32_t>(nsec / 1000.0));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion aslam_cv/aslam_time/include/aslam/implementation/Time.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ boost::posix_time::ptime TimeBase<T, D>::toBoost() const {
#if defined(BOOST_DATE_TIME_HAS_NANOSECONDS)
return pt::from_time_t(sec) + pt::nanoseconds(nsec);
#else
return pt::from_time_t(sec) + pt::microseconds(nsec / 1000.0);
return pt::from_time_t(sec) + pt::microseconds(static_cast<int32_t>(nsec / 1000.0));
#endif
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include <aslam/backend/MatrixTransformation.hpp>
#include <sm/kinematics/rotations.hpp>
#include <aslam/Exceptions.hpp>
Expand All @@ -17,7 +16,7 @@ namespace aslam {
_UpdatePattern << UpdatePattern; // Pattern of the Matrix; 1: design variables; 0: constants
_UpdateDimension = 0;
for (int i=0; i<9; i++){
if (_UpdatePattern(i%3,floor(static_cast<double>(i/3)))==1){
if (_UpdatePattern(i%3,int(floor(static_cast<double>(i/3))))==1){
_UpdateDimension ++; // Count, how many design variables are in the matrix
}
}
Expand All @@ -41,8 +40,8 @@ namespace aslam {
Eigen::Matrix3d dA;
int j=0;
for (int i=0; i<9; i++){
_A(i%3,floor(static_cast<double>(i/3))) += _UpdatePattern(i%3,floor(static_cast<double>(i/3)))*dp[j];
if (_UpdatePattern(i%3,floor(static_cast<double>(i/3)))==1){j++; }
_A(i%3,int(floor(static_cast<double>(i/3)))) += _UpdatePattern(i%3,int(floor(static_cast<double>(i/3))))*dp[j];
if (_UpdatePattern(i%3,int(floor(static_cast<double>(i/3))))==1){j++; }
}
}

Expand Down Expand Up @@ -71,7 +70,7 @@ namespace aslam {
Eigen::MatrixXd finalJacobian(3,_UpdateDimension);
int j=0;
for (int i=0; i<9; i++){
if (_UpdatePattern(i%3,floor(static_cast<double>(i/3)))==1){
if (_UpdatePattern(i%3,int(floor(static_cast<double>(i/3))))==1){
SM_ASSERT_GT_DBG(aslam::Exception, _UpdateDimension, j , "Incorrect update dimension! It doesn't match the pattern");
finalJacobian.col(j) = applyChainRule.col(i); // took out only the rows for the values, which are design variables
j++;
Expand Down Expand Up @@ -115,4 +114,3 @@ namespace aslam {

} // namespace backend
} // namespace aslam

0 comments on commit 1223f9b

Please sign in to comment.