You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (diff < PERIOD - TOLERANCE || diff > PERIOD + TOLERANCE) {
executor.cancel();
ASSERT_GT(diff, PERIOD - TOLERANCE);
}
to
if (diff > PERIOD + TOLERANCE) {
executor.cancel();
ASSERT_LT(diff, PERIOD + TOLERANCE);
}
if (diff < PERIOD - TOLERANCE) {
executor.cancel();
ASSERT_GT(diff, PERIOD - TOLERANCE);
}
Besides, about the test timer creating a period with 100ms
auto timer = node->create_wall_timer(100ms, timer_callback, cbg);
This timer expects the callback called ideally as follows,
PERIOD=0.1s (same to the timer period), TOLERANCE=0.025s.
If 120ms(now-last) turns to 150ms, the next item will be about 50ms, which is not expected. (diff < PERIOD - TOLERANCE, and then ASSERT_GT(diff, PERIOD - TOLERANCE))
I think it is a possible way to make the issue happened.
In #1105, you adjust PERIOD and TOLERANCE. I agree with this modification. But I think 100ms in below code should be changed at the same time.
auto timer = node->create_wall_timer(100ms, timer_callback, cbg);
i was trying to reproduce this issue, but cannot do it so far.(using amd64 i7-3770 / Ubuntu18.04 / source build) i am not sure about the ROS2 CI back-end machines, but it depends on the system resource and situation. technically this could happen with certain condition.
If 120ms(now-last) turns to 150ms, the next item will be about 50ms
(nitpick: 1st of all, 150ms is over the threshold.)
I believe this is correct,
on the other hand, test application needs to check cyclic with static period because this is the user aspect.
I think it is a possible way to make the issue happened.
In #1105, you adjust PERIOD and TOLERANCE. I agree with this modification. But I think 100ms in below code should be changed at the same time.
auto timer = node->create_wall_timer(100ms, timer_callback, cbg);
What do you think ?
I overlooked the original code 🤦♂️ . I will try that, thanks!
Activity
Barry-Xu-2018 commentedon May 12, 2020
@ivanpauno
About #907 (comment),
maybe it's better to update from
to
Besides, about the test timer creating a period with 100ms
This timer expects the callback called ideally as follows,
But if there is something happened to block (or consume time, ie. thread switching) between timer ready and callback trigger, the callback might be,
PERIOD=0.1s (same to the timer period), TOLERANCE=0.025s.
If 120ms(now-last) turns to 150ms, the next item will be about 50ms, which is not expected. (diff < PERIOD - TOLERANCE, and then ASSERT_GT(diff, PERIOD - TOLERANCE))
I think it is a possible way to make the issue happened.
In #1105, you adjust
PERIODandTOLERANCE. I agree with this modification. But I think 100ms in below code should be changed at the same time.What do you think ?
fujitatomoya commentedon May 12, 2020
@ivanpauno @Barry-Xu-2018
i was trying to reproduce this issue, but cannot do it so far.(using amd64 i7-3770 / Ubuntu18.04 / source build) i am not sure about the ROS2 CI back-end machines, but it depends on the system resource and situation. technically this could happen with certain condition.
(nitpick: 1st of all, 150ms is over the threshold.)
I believe this is correct,
on the other hand, test application needs to check cyclic with static period because this is the user aspect.
if anything i can help, just let me know.
ivanpauno commentedon May 14, 2020
I overlooked the original code 🤦♂️ . I will try that, thanks!
ivanpauno commentedon May 14, 2020
Fixed by #1105