Ask Your Question

ROS-Comm catkin_make error

asked 2021-04-22 13:09:58 -0500

sisko gravatar image

updated 2021-04-22 13:10:42 -0500

I was working on entirely a different problem of trying to publish into cmd_vel from move_base and a custom node of mine. Basically, move_base issues twist messages to drive my robot from one pose to another. And, I was attempting to issue another set of twist messages to get my robot to follow a wall to the destination. My intention was to do this by issuing twists with just twist.angular.z = 0.5 values until to robot was a set distance from the wall. So, these two nodes should have been publishing to cmd_vel and moving the robot along.

BUT, what i found was that my node seemed to premept move_base. The robot would not respond to move_base unless I stopped my node.

SO, I decided to experiment with the mux package and I cloned it into my catkin_ws/src directory. However, when I tried launching my launch file, I got the following error:

process[master]: started with pid [7849]
Traceback (most recent call last):
  File "/home/sisko/catkin_ws/devel/bin/rosmaster", line 15, in <module>
    exec(compile(, python_script, 'exec'), context)
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosmaster/scripts/rosmaster", line 35, in <module>
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/", line 84, in rosmaster_main
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/", line 58, in configure_logging
    _log_filename = rosgraph.roslogging.configure_logging('rosmaster', logging.DEBUG, filename=filename)
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosgraph/src/rosgraph/", line 192, in configure_logging
    logging.config.fileConfig(config_file, disable_existing_loggers=False)
  File "/usr/lib/python2.7/logging/", line 85, in fileConfig
    handlers = _install_handlers(cp, formatters)
  File "/usr/lib/python2.7/logging/", line 163, in _install_handlers
    h = klass(*args)
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosgraph/src/rosgraph/", line 237, in __init__
    from rospy.rostime import get_time, is_wallclock
  File "/home/sisko/catkin_ws/devel/lib/python2.7/dist-packages/rospy/", line 34, in <module>
  File "<string>", line 49, in <module>
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/", line 60, in <module>
    import rospy.impl.init
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/", line 54, in <module>
    from .tcpros import init_tcpros
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/", line 45, in <module>
    import rospy.impl.tcpros_service
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/", line 54, in <module>
    from rospy.impl.tcpros_base import TCPROSTransport, TCPROSTransportProtocol, \
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/", line 160
    (e_errno, msg, *_) = e.args
SyntaxError: invalid syntax
================================================================================REQUIRED process [master] has died!
process has died [pid 7849, exit code 1, cmd rosmaster --core -p 11311 -w 3 __log:=/home/sisko/.ros/log/9f569ecc-a37c-11eb-b1b2-70188b82a32f/master.log].
log file: /home/sisko/.ros/log/9f569ecc-a37c-11eb-b1b2-70188b82a32f/master*.log
Initiating shutdown!
[master] killing on exit
RLException: ERROR: could not contact master ...
edit retag flag offensive close merge delete


SO, I decided to experiment with the mux package and I cloned it into my catkin_ws/src directory.


Why not simply sudo apt install ros-melodic-topic-tools?

Building packages from source should be your absolute last resort.

If you're not used to doing it, it can lead to all sorts of problems. One of which you've encountered.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-22 14:55:56 -0500 )edit

Thanks @gvdhoom: I tried that and it said everything is uptodate :

sudo apt install ros-melodic-topic-tools -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-melodic-topic-tools is already the newest version (1.14.10-1bionic.20201017.081458).
0 to upgrade, 0 to newly install, 0 to remove and 4 not to upgrade.
sisko gravatar image sisko  ( 2021-04-22 16:51:01 -0500 )edit

apt will not solve your current problem.

My question was why did you "clone[d] it into [your] catkin_ws/src directory" when you could have just apt installed it?

The default way to install ROS packages on Debian/Ubuntu should be to use apt, not build them from source.

The apt output you show actually tells us you already had topic_tools installed. There was no need to build it from source.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-23 02:03:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-04-23 02:13:27 -0500

gvdhoorn gravatar image

SO, I decided to experiment with the mux package and I cloned it into my catkin_ws/src directory. However, when I tried launching my launch file, I got the following error:

  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/", line 160
    (e_errno, msg, *_) = e.args
SyntaxError: invalid syntax

You are running ROS Melodic, which is Python 2 based.

It's likely you git cloned the noetic-devel version of ros_comm, which is Python 3 compatible.

The syntax error you get is probably caused by this divergence.

It seems ros-comm was installed by default and cloning it in and compiling it seemed to have messed up my environment. I have tried multiple attempts to fix this like sudo apt-get remove --purge ros-melodic-ros-comm and deleting the cloned copy in my catkin_ws/src directory but my launch files still fail to start.

Yes, the packages in ros_comm are installed by default, as they are core components of ROS.

There was no need to build them from source in your workspace.

As to your problem, I believe the following should fix it:

  1. remove ros_comm from your catkin_ws (ie: rm -rf /home/sisko/catkin_ws/src/ros_comm)
  2. remove the build and devel folders from your catkin_ws (ie: rm -rf /home/sisko/catkin_ws/build and rm -rf /home/sisko/catkin_ws/devel)
  3. rebuild your workspace (ie: source /opt/ros/melodic/setup.bash, cd /home/sisko/catkin_ws and catkin_make)

Rebuilding is not strictly necessary perhaps, but it won't hurt (will just take a bit of time).

edit flag offensive delete link more


Could you please mark the question as answered if you feel it has been answered? You can do that by ticking the checkmark to the left of the answer. It should turn green.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-27 04:28:53 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2021-04-22 13:09:58 -0500

Seen: 51 times

Last updated: Apr 23