Skip to content

Commit

Permalink
removed rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaju-Bubanja committed Aug 17, 2018
1 parent 30da22b commit 769d7c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <aslam/Duration.hpp>
//#include <ros/rate.h>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <math.h>

namespace aslam {
//
Expand Down Expand Up @@ -166,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(static_cast<int32_t>(round(nsec / 1000.0)));
return bt::seconds(sec) + bt::microseconds(static_cast<int32_t>(nsec / 1000.0));
#endif
}

Expand Down
3 changes: 1 addition & 2 deletions aslam_cv/aslam_time/include/aslam/implementation/Time.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
//#include <ros/exception.h>
//#include <aslam/time.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <math.h>

/*********************************************************************
** Cross Platform Headers
Expand Down Expand Up @@ -151,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(static_cast<int32_t>(round(nsec / 1000.0)));
return pt::from_time_t(sec) + pt::microseconds(static_cast<int32_t>(nsec / 1000.0));
#endif
}

Expand Down

0 comments on commit 769d7c3

Please sign in to comment.