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_publisher
minimal_subscriber
pointcloud_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
rclcpp and rclpy examples
- 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.
Description
The
rclcppexamples 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
rclpyexamples currently include:minimal_publisherminimal_subscriberpointcloud_publisherbut 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:
Possible structure:
The example could demonstrate:
create_timer()Motivation
This would:
rclcppandrclpyexamplesIf this addition is considered useful, I would be happy to implement the example and submit a PR.