Add minimal_timer example for rclpy to demonstrate periodic execution using create_timer()
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Compare the existing rclcpp minimal timer demonstrations and the current rclpy examples, especially minimal_publisher and minimal_subscriber. Then add the proposed rclpy/timer/minimal_timer example with minimal_timer.py and README.md, covering node creation, create_timer(), a periodic callback, and fixed-interval logging. Done means the example is runnable and provides the requested beginner reference.
Written by the indexing model from the issue text.
Description
Description
The rclcpp examples repository contains minimal timer demonstrations (e.g., examples_rclcpp_minimal_timer), which help beginners understand how to execute periodic callbacks using ROS 2 timers.
However, the rclpy examples currently include:
minimal_publisherminimal_subscriberpointcloud_publisher
but there is no minimal example demonstrating the use of create_timer() in Python.
Since timers are a fundamental mechanism in ROS 2 for running periodic tasks (such as sensor polling, monitoring loops, or periodic logging), a minimal Python example could help beginners understand this concept more easily.
Proposed Addition
Add a simple example under:
rclpy/topics/minimal_timer/
Possible structure:
rclpy/timer/minimal_timer/
├── minimal_timer.py
└── README.md
The example could demonstrate:
- Creating a ROS 2 node
- Creating a timer using
create_timer() - Executing a periodic callback
- Logging output at fixed intervals
Motivation
This would:
- Improve parity between
rclcppandrclpyexamples - Help beginners understand periodic execution in ROS 2
- Provide a simple reference implementation for timers in Python
If this addition is considered useful, I would be happy to implement the example and submit a PR.
- Dominant language
- C++
- Stars
- 970
- Forks
- 365
- Avg merge
- 12d 20h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ros2/examples
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Similar issues
-
bug build
Difficulty 1/5 Under an hour Newbie friendliness 91/100
facebookincubator/velox#19194 ·
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Openfuzz
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ClickHouse/ClickHouse#122114 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
module/agent platform/macos type/bug/regression
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement PyCDE
Difficulty 2/5 1-3 hours Newbie friendliness 78/100