-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use SBCL Unix API to get the timestamp instead of CL functions. #24
Conversation
Within roslisp the two special variables |
I've seen variable deprecations done with symbol macros before (can't remember where, though). Something like this would probably work: (defvar *%time-base* (unix-time)
"(Deprecated) Holds unix time (rounded to the nearest second) when roslisp was started")
(define-symbol-macro *time-base* (progn (ros-warn (roslisp time) "*time-base* is deprecated.") *%time-base*)) According to the Hyperspec though, the behavior of this will be undefined if a function has |
@daewok, thanks!
As |
I ran a quick sanity-test. It all compiles, runs, and makes sense to me. Here is what I did:
(defun from-msg (msg)
(let ((now (ros-time)))
(with-fields (transforms) msg
(with-fields ((then (stamp header))) (elt transforms 0)
(format t "~%now: ~a then: ~a diff: ~a~%" now then (- now then)))))
This prints something like this: If I ask the So, I get what I expected: Almost the diff by which the I'd like to merge. @gaya- @moesenle Any final thoughts? EDIT: If you wonder about the future-dating, it happens here: |
Use SBCL Unix API to get the timestamp instead of CL functions.
The main change is line 59 - 63. Everything else is minor indentation & co. fixes.
I was getting 0.6s difference on my system, which is pretty substantial...