-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add string to time function #152
Conversation
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
…gnitionrobotics/ign-math into jshep1/string_to_chrono_helper Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-math6 #152 +/- ##
=============================================
- Coverage 99.24% 99.23% -0.02%
=============================================
Files 59 59
Lines 5823 5867 +44
=============================================
+ Hits 5779 5822 +43
- Misses 44 45 +1
Continue to review full report at Codecov.
|
Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: ahcorde <[email protected]>
…nitionrobotics/ign-math into ahcorde/time/helper_functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment about try/catch
Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Cast to system_clock::duration where necessary. Signed-off-by: Steve Peters <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
…rono_helper Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: ahcorde <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Signed-off-by: John Shepherd <[email protected]>
Not sure why codecov is marking some lines as uncovered, when they clearly are: |
I was also wondering this |
sdformat is building |
const std::string &_timeString) | ||
{ | ||
std::chrono::steady_clock::time_point timePoint = | ||
math::secNsecToTimePoint(-1, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing an msbuild warning when compiling this from source for sdformat:
'argument': conversion from 'int' to 'const uint64_t', signed/unsigned mismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing it's complaining about the implicit cast of -1
to const uint64_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I just realized this, I guess an invalid string will have to return 0 now, I was using -1 as an indication of error, but now it seems that's not going to be possible
{ | ||
numberDays = std::stoi(dayString); | ||
} | ||
catch (const std::out_of_range &oor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another windows warning found by sdformat:
'oor': unreferenced local variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be easy enough to fix by just deleting oor
:
catch (const std::out_of_range &)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out, I'm creating a PR now
Adds a function converting a string of the general format "dd hh:mm:ss.nnn" where n is millisecond values to a
std::chrono::steady_clock::time_point
Depends on #150
Signed-off-by: John Shepherd [email protected]