-
Notifications
You must be signed in to change notification settings - Fork 239
Closed
Description
We have been investigating why we can't seem to get lookupTransform to work properly for us, and came across this function.
Instead of doing the big long thing that is going on there:
inline double durationToSec(const tf2::Duration& input){
int64_t count = input.count();
int32_t sec, nsec;
nsec = static_cast<int32_t>(count % 1000000000l);
sec = static_cast<int32_t>((count - nsec) / 1000000000l);
double sec_double, nsec_double;
nsec_double = 1e-9 * static_cast<double>(nsec);
sec_double = static_cast<double>(sec);
return sec_double + nsec_double;
}
couldn't we just do
inline double durationToSec(const tf2::Duration& input){
return input.count() * 1e-9;
}
I can't see a reason for the extra stuff that is going on in there.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels