Python publisher/subscriber tutorial uses std_msgs/msg/String, which is marked as deprecated

Open
#7,482 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@abhishek5127-hash is already working on this.

Since Nov 20, 2026.

  • #7505 by @abhishek5127-hash — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

Read the rolling tutorial at source/ROS-Framework/client-libraries/Working-with-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.rst and compare it with the Jazzy version. Check the minimal_publisher and minimal_subscriber examples in ros2/examples and confirm how example_interfaces is declared as a dependency. Done means the chosen message type and dependency guidance are consistent across the tutorial and examples.

Written by the indexing model from the issue text.

Description

Description

The tutorial "Writing a simple publisher and subscriber (Python)" and the code it is
based on (rclpy/topics/minimal_publisher and minimal_subscriber in ros2/examples)
use std_msgs/msg/String.

That message is marked as deprecated in ros2/common_interfaces (std_msgs/msg/String.msg,
rolling):

# This was originally provided as an example message.
# It is deprecated as of Foxy
# It is recommended to create your own semantically meaningful message.
# However if you would like to continue using this please use the equivalent in example_msgs.

(I assume example_msgs means example_interfaces.) The example_interfaces/msg/String
definition adds that, if deploying it into a system, one should create a semantically
meaningful message type.

Where

  • Tutorial source (rolling):
    source/ROS-Framework/client-libraries/Working-with-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.rst
    (the text, the code blocks and the exec_depend step all mention std_msgs)
  • Same tutorial on the jazzy branch
  • ros2/examples: rclpy/topics/minimal_publisher and minimal_subscriber (rolling and jazzy)

Question

Would you accept a change to use example_interfaces/msg/String in the tutorial and the
minimal examples? The alternative would be keeping std_msgs and adding a short note
that the message is meant for examples only and that real systems should define their own.

One thing I noticed: on a system with only ros-jazzy-ros-base installed,
ros2 interface show example_interfaces/msg/String returned "Unknown package", so the
tutorial would need to mention the extra dependency (the existing rosdep install step
would cover it through exec_depend).

I may be missing context on why std_msgs was kept, so I wanted to ask before sending a PR.
I am happy to prepare one for the docs and/or the examples if this direction makes sense.

Tested on: ROS 2 Jazzy, Ubuntu 24.04 (arm64 container).

Dominant language
Python
Stars
1.1k
Forks
1.4k
Avg merge
18h 52m
Merged PRs (30d)
119

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/ros2_documentation

All issues in ros2/ros2_documentation

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.