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

Revision history [back]

click to hide/show revision 1
initial version

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/tcpros_base.py", 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).