ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Cannot execute rostopic list -v correctly

asked 2018-06-03 13:38:01 -0500

Eliptical0 gravatar image

updated 2018-06-03 13:58:37 -0500

gvdhoorn gravatar image


I am a beginner to ROS, please see below information about my environment:

ROS version: melodic

Platform: Ubuntu 18

Environment Variables (output of env | grep ROS) i source the setup.bash file for my current workspace every time i login:


While following the beginner tutorials, i performed the step to list current topics in verbose mode via rostopic list -v and was faced with the following result:

Published topics:
 * /turtle1/color_sensor [turtlesim/Color] 1 publisher
 * /turtle1/cmd_vel [geometry_msgs/Twist] 1 publisher
 * /rosout [rosgraph_msgs/Log] 5 publishers
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /turtle1/pose [turtlesim/Pose] 1 publisher

Subscribed topics:
Traceback (most recent call last):
  File "/opt/ros/melodic/bin/rostopic", line 35, in <module>
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rostopic/", line 2119, in rostopicmain
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rostopic/", line 2059, in _rostopic_cmd_list
    exitval = _rostopic_list(topic, verbose=options.verbose, subscribers_only=options.subscribers, publishers_only=options.publishers, group_by_host=options.hostname) or 0
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rostopic/", line 1246, in _rostopic_list
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rostopic/", line 1140, in _sub_rostopic_list
    print(indent+" * %s [%s] %s subscribers"%(t, ttype, len(llist)))
NameError: global name 'llist' is not defined

According to the correct output shown in the tutorials, i get the Published topics correctly, however the Subscribed topics output is not correct.

Kindly help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-03 14:00:28 -0500

gvdhoorn gravatar image

This is a known issue, and already fixed in ros/ros_comm#1407.

It could take a little while for this fix to reach you though.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-06-03 13:38:01 -0500

Seen: 239 times

Last updated: Jun 03 '18