-
Notifications
You must be signed in to change notification settings - Fork 409
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 unit tests for rclcpp Rate objects #182
Conversation
ee1129e
to
ca229a1
Compare
CI is passing: http://ci.ros2.org/job/ci_linux/737/ However the fix is not optimal as it pulls all durations to the lowest common denominator. Clang uses microseconds whereas gcc uses nanoseconds for the high resolution clock. https://stackoverflow.com/questions/22205290/cast-from-time-point-duration-to-duration-fails-on-clang Does anyone have a better suggestion for this? |
It does seem a shame to throw away resolution, but if that is how clang is doing it, then it doesn't seem that we have much choice. We'll likely end up using clang eventually on Linux, too. Also, would we really be losing any capabilities? I.e., do we expect to run on a system that supports better-than-microsecond resolution timers? Looking around a bit, it seems that Linux + RT-PREEMPT can only get down to ~10us. |
I proposed a different way to fix this in #185. Basically, you force the time point object stored by the class to be nanosecond precision, but reuse the representation that the clock uses. This works fine since |
08ea444
to
d2475dd
Compare
This is close, however I'm having trouble getting osx to link the unit tests correctly. Windows is happy: http://ci.ros2.org/job/ci_windows/817/ Initially I was getting this error:
Adding an explicit linking to rmw_implementation_LIBRARIES fixed that but I only got a little farther to
From there I tried adding rcl_interfaces as a run dependency as well as a built time one to make sure the package is available for the tests. And that didn't work either:
I'm trying one more iteration with an explicit test_depend but I'm not sure where to look next. Does anyone have a suggestion? |
Without more context it is difficult to suggest anything but the usual:
|
The libraries exist where I would expect them. Looking at the output of I still had all the rpaths and looking at librclcpp it itself has the rpaths. (oddly including an rpath to link against itself? |
on rosidl_typesupport_introspection_c necessary for ros2/rclcpp#182
CI kickedoff but backlogged: CI linux is diabled? @dirk-thomas |
Our assumptions about sleep's behavior were incorrect. updated new CI: |
|
||
/* | ||
Tests that funcion_traits calculates arity of several functors. | ||
*/ |
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.
Docblock seems to be unrelated?
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.
Yeah, not quite accurate.
+1 We can hopefully tighten up the underrun bounds after addressing #190. |
Add unit tests for rclcpp Rate objects
${rosidl_generator_cpp_INCLUDE_DIRS} | ||
) | ||
target_link_libraries(test_rate | ||
${PROJECT_NAME}${target_suffix} |
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.
What is this line supposed to do? There is no target_suffix
in this scope. It will have a random value depending on how call_for_each_rmw_implementation
above has iterated through the rmw implementations.
Fixed in #213.
* Remove error msg from valid case * Document RCL_RET_{CLIENT/SERVICE}_TAKE_FAILED
* Add support for specifying max bagfile size in storage_options Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> * Add helper functions in Writer required for bagfile splitting Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> * Store max_bagfile_size when Writer is opened Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> * Uncrustify Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> * Apply suggestions from PR Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> * Add ROSBAG2_STORAGE_PUBLIC to MAX_BAGFILE_SIZE_NO_SPLIT This should fix the issue on Windows Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> * Renamed private function in Writer to not end in `_` Signed-off-by: Zachary Michaels <zmichaels11@gmail.com>
Connects to #181
First adding unit tests for coverage. Next debug problem.
The problem from 181 is reproduced in these unit tests:
CI: http://ci.ros2.org/job/ci_osx/602/