-
Notifications
You must be signed in to change notification settings - Fork 430
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
Added optional TimerInfo to timer callback #2343
Conversation
@clalancette : ping |
@@ -709,9 +709,9 @@ Executor::execute_subscription(rclcpp::SubscriptionBase::SharedPtr subscription) | |||
} | |||
|
|||
void | |||
Executor::execute_timer(rclcpp::TimerBase::SharedPtr timer) | |||
Executor::execute_timer(rclcpp::TimerBase::SharedPtr timer, const std::shared_ptr<void> & dataPtr) |
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.
Can this pointer be the actual type instead of void
?
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.
The return from take_data() is void as it's the standard in the rest of the code. Therefore this pointer is also void.
@wjwwood @mjcarroll @fujitatomoya Ping, I would like to see this merged for jazzy |
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.
@jmachowinski thank you for the PR, i had a few comments.
besides, test would be ideal.
rclcpp/src/rclcpp/executors/static_single_threaded_executor.cpp
Outdated
Show resolved
Hide resolved
@fujitatomoya Thanks for the review, I'll update the PR accordingly.
Hm, I'm not really sure what to test here, the only thing I can think of would be that the info contains somewhat expected values. |
0b4ec71
to
88d1b0e
Compare
@fujitatomoya Added a simple test. And updated the commits. |
I haven't looked in this in too much detail, but I have to say that the use of (effectively) a |
See #2343 (comment) for the concrete example, of what we are trying to fix here. The pointer returned by take_data is void, as you need to assign it to the AnyExecutable here
in order to pass it on inside of the Executor. This is pretty much the standard in this area of the code, see rclcpp/rclcpp/include/rclcpp/waitable.hpp Lines 158 to 161 in 10252e9
for reference. |
This is standard for the executor/waitable model. The waitable is supposed to return a data handle that can be associated when the actual |
@mjcarroll Do you think the approach I took is viable, or should I look into something more typesafe ? |
88d1b0e
to
30a95af
Compare
30a95af
to
5616a9c
Compare
5616a9c
to
2bfee89
Compare
reworked patch after merge of #2142 |
CI (without ros2/examples#375) |
@jmachowinski probably we want to rebase this before restarting CI since some fixes are merged in a week? |
0840828
to
e920e72
Compare
e920e72
to
fa754fe
Compare
…dd interface for a callback with TimerInfo argument Signed-off-by: Alexis Tsogias <a.tsogias@cellumation.com>
fa754fe
to
3328d38
Compare
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
3328d38
to
1b3fe24
Compare
Can I somehow tell the auto CI, that this PR and ros2/examples#375 belong together, and I should build using both ? |
The |
Yes, this and examples. |
Had a follow up to this one: #2501 |
Signed-off-by: Alexis Tsogias <a.tsogias@cellumation.com> Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Alexis Tsogias <a.tsogias@cellumation.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com>
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-jazzy-jalisco-released/37862/1 |
Signed-off-by: Alexis Tsogias <a.tsogias@cellumation.com> Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Alexis Tsogias <a.tsogias@cellumation.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Alexis Tsogias <a.tsogias@cellumation.com> Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Alexis Tsogias <a.tsogias@cellumation.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Alexis Tsogias <a.tsogias@cellumation.com> Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Alexis Tsogias <a.tsogias@cellumation.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com>
This allows us to get the correct time of the timer callback as node->now() can
return a later timestamp than 'expected' due to race conditions.
This commit depends on ros2/rcl#1113