ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

Hi,

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:

ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROS_PACKAGE_PATH=/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=melodic

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>
    rostopic.rostopicmain()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rostopic/__init__.py", line 2119, in rostopicmain
    _rostopic_cmd_list(argv)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rostopic/__init__.py", 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/__init__.py", line 1246, in _rostopic_list
    verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rostopic/__init__.py", 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
1

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

Question Tools

Stats

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

Seen: 273 times

Last updated: Jun 03 '18