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: |
There was a problem hiding this comment.
Docblock seems to be unrelated?
There was a problem hiding this comment.
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.
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 <[email protected]> * Add helper functions in Writer required for bagfile splitting Signed-off-by: Zachary Michaels <[email protected]> * Store max_bagfile_size when Writer is opened Signed-off-by: Zachary Michaels <[email protected]> * Uncrustify Signed-off-by: Zachary Michaels <[email protected]> * Apply suggestions from PR Signed-off-by: Zachary Michaels <[email protected]> * Add ROSBAG2_STORAGE_PUBLIC to MAX_BAGFILE_SIZE_NO_SPLIT This should fix the issue on Windows Signed-off-by: Zachary Michaels <[email protected]> * Renamed private function in Writer to not end in `_` Signed-off-by: Zachary Michaels <[email protected]>
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/