ros2 / ros2/ros2cli

[ros2interface] shows empty comments even with --no-comments

Open Beginner friendly
#769 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Python
Stars
262
Forks
228
Avg merge
23h 15m
Merged PRs (30d)
12

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • 0.13.4 (galactic)
  • DDS implementation:
    • N/A
  • Client library (if applicable):
    • N/A
Steps to reproduce issue
ros2 interface show tf2_msgs/msg/TFMessage --no-comments

Actually, the --no-comments param is not necessary, because it's the default behavior. Just included here for clarification.

Expected behavior

ros2interface should strip all comments:

$ ros2 interface show tf2_msgs/msg/TFMessage --no-comments
geometry_msgs/TransformStamped[] transforms
	std_msgs/Header header
		builtin_interfaces/Time stamp
			int32 sec
			uint32 nanosec
		string frame_id
	string child_frame_id
	Transform transform
		Vector3 translation
			float64 x
			float64 y
			float64 z
		Quaternion rotation
			float64 x 0
			float64 y 0
			float64 z 0
			float64 w 1
Actual behavior

ros2interface does not strip empty comment lines (see the two lines starting with #). This is because of the empty comment lines in tf2_msgs/msg/TFMessage:

$ ros2 interface show tf2_msgs/msg/TFMessage --no-comments
geometry_msgs/TransformStamped[] transforms
	#
	#
	std_msgs/Header header
		builtin_interfaces/Time stamp
			int32 sec
			uint32 nanosec
		string frame_id
	string child_frame_id
	Transform transform
		Vector3 translation
			float64 x
			float64 y
			float64 z
		Quaternion rotation
			float64 x 0
			float64 y 0
			float64 z 0
			float64 w 1
Additional information

Contributor guide

Open the 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.

Research direction

Start by running ros2 interface show tf2_msgs/msg/TFMessage --no-comments on the reported Galactic setup, then trace the ros2interface entry point that filters comments. Done means the output has no empty # lines while preserving the shown fields; add coverage for this TFMessage case if the existing tests provide a suitable location.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.