examples icon indicating copy to clipboard operation
examples copied to clipboard

Add minimal rclpy timer example demonstrating create_timer() usage

Open yadnyeshwar opened this issue 8 months ago • 3 comments

This PR adds a minimal example demonstrating how to use create_timer() in rclpy.

While the minimal publisher example already uses a timer internally, this example focuses specifically on timer usage without publishing.

This provides a simple reference for beginners learning periodic execution in ROS 2.

Closes #436

yadnyeshwar avatar Mar 08 '26 07:03 yadnyeshwar

@yadnyeshwar this is requested changes, friendly ping.

fujitatomoya avatar Mar 31 '26 00:03 fujitatomoya

@yadnyeshwar this is requested changes, friendly ping.

Thank you for the reminder and apologies for the delayed response. I was away for a short period due to personal reasons.

I have now addressed the requested changes by converting the example into an installable ROS 2 Python package so that it can be built and executed via ros2 run. I am currently verifying the CI results and will follow up with any additional fixes if needed.

Please let me know if there are any other adjustments you would like me to make.

yadnyeshwar avatar Mar 31 '26 06:03 yadnyeshwar

this still requires work.

  • there are two identical copies of the script (one under timers and one under topics)
  • the new files (setup, package, etc) were added to the topics folder rather than to the timers folder, where they should be.

alsora avatar Apr 08 '26 06:04 alsora

This PR appears to have been inactive since April, and the remaining review feedback looks narrowly scoped: remove the duplicate timer script and keep the complete installable package under rclpy/timers/minimal_timer. Are you still planning to update it? If not, I would be happy to prepare a clean rolling PR that preserves the example and addresses those points.

dlanov avatar Jul 16 '26 13:07 dlanov

This PR appears to have been inactive since April, and the remaining review feedback looks narrowly scoped: remove the duplicate timer script and keep the complete installable package under rclpy/timers/minimal_timer. Are you still planning to update it? If not, I would be happy to prepare a clean rolling PR that preserves the example and addresses those points.

Hi @dlanov , thank you for following up. I'm still interested in completing this contribution and continuing to contribute to ROS 2. I've been reviewing the current state of this PR against the latest rolling branch and noticed that the repository structure has changed since the original review. Before updating the branch, I'd like to confirm whether you would still prefer the installable package to live under rclpy/timers/minimal_timer as mentioned in the earlier review, or if you'd prefer the PR to follow the current repository layout. I'm happy to update the PR accordingly. Thank you!

yadnyeshwar avatar Jul 16 '26 18:07 yadnyeshwar

@yadnyeshwar Thanks for confirming. I'll step back and leave the layout decision and next update to you and the maintainers.

dlanov avatar Jul 16 '26 20:07 dlanov