Add TimerInfo to timer callback.#1292
Conversation
|
@mjcarroll @ahcorde @clalancette can you take a look? |
375742d to
baad477
Compare
|
according to https://ci.ros2.org/job/ci_linux/21290/console, |
About the stuck, it is related to Here it's just checking if the callback has one parameter. def _take_timer(self, tmr):
try:
with tmr.handle:
info = tmr.handle.call_timer_with_info()
if len(inspect.signature(tmr.callback).parameters) == 1:
timer_info = TimerInfo(
expected_call_time=info['expected_call_time'],
actual_call_time=info['actual_call_time'],
clock_type=tmr.clock.clock_type)
async def _execute():
await await_or_execute(tmr.callback, timer_info)
else:
async def _execute():
await await_or_execute(tmr.callback)
return _execute
except InvalidHandle:
# Timer is a Destroyable, which means that on __enter__ it can throw an
# InvalidHandle exception if the entity has already been destroyed. Handle that here
# by just returning an empty argument, which means we will skip doing any real work
# in _execute_timer below
pass
return None |
@Barry-Xu-2018 thanks for the suggestion. this does not work either, because callback would have multiple parameters. |
Oh, yeah. Finding parameter names through type is the correct way. |
|
https://ci.ros2.org/job/ci_linux/21306/#showFailuresLink does not look related to the fix, but just in case i want to retry. |
|
@ahcorde @sloretz @mjcarroll @clalancette i could use review for this. |
ahcorde
left a comment
There was a problem hiding this comment.
There is a test failure https://build.ros2.org/job/Rpr__rclpy__ubuntu_noble_amd64/161/testReport/junit/rclpy.rclpy.test/test_timer/test_cancel_reset_0_001_/ is this related with this PR ?
Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
f5f7c42 to
7c8e1c2
Compare
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
ros2/rclpy#1292 Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
i do not think this is related, all tests are pass in my local environment. i did add a couple of cosmetic fixes including new test case, and rebasing the current rolling. CI: |
|
https://ci.ros2.org/job/ci_linux/21574/ is not related |
address #1126 and #1265
counterparf of rclcpp implementation ros2/rclcpp#2343