Robotics StackExchange | Archived questions

ROS-Comm catkin_make error

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, movebase 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 **cmdvel** and moving the robot along.

BUT, what i found was that my node seemed to premept movebase. The robot would not respond to movebase 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(fh.read(), python_script, 'exec'), context)
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosmaster/scripts/rosmaster", line 35, in <module>
    rosmaster.rosmaster_main()
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/main.py", line 84, in rosmaster_main
    configure_logging()   
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/main.py", 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/roslogging.py", line 192, in configure_logging
    logging.config.fileConfig(config_file, disable_existing_loggers=False)
  File "/usr/lib/python2.7/logging/config.py", line 85, in fileConfig
    handlers = _install_handlers(cp, formatters)
  File "/usr/lib/python2.7/logging/config.py", line 163, in _install_handlers
    h = klass(*args)
  File "/home/sisko/catkin_ws/src/ros_comm/tools/rosgraph/src/rosgraph/roslogging.py", line 237, in __init__
    from rospy.rostime import get_time, is_wallclock
  File "/home/sisko/catkin_ws/devel/lib/python2.7/dist-packages/rospy/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 49, in <module>
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/client.py", line 60, in <module>
    import rospy.impl.init
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/init.py", line 54, in <module>
    from .tcpros import init_tcpros
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/tcpros.py", line 45, in <module>
    import rospy.impl.tcpros_service
  File "/home/sisko/catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/tcpros_service.py", 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/tcpros_base.py", 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 [http://Razer-Blade:11311/]
The traceback for the exception was written to the log file
No handlers could be found for logger "roslaunch"

I tried executing catkin-make in my catkin_ws directory and I get the following :

-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Generating .msg files for action actions_tutorial/WashTheDishes /home/sisko/catkin_ws/src/actions_tutorial/action/WashTheDishes.action
-- actions_tutorial: 7 messages, 0 services
-- +++ processing catkin package: 'hector_geotiff'
-- ==> add_subdirectory(hector_slam/hector_geotiff)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /home/sisko/catkin_ws/devel/share/roscpp/cmake/roscppConfig.cmake:113 (message):
  Project 'roscpp' specifies
  '/home/sisko/catkin_ws/src/ros_comm/clients/roscpp/include' as an include
  dir, which is not found.  It does neither exist as an absolute directory
  nor in
  '/home/sisko/catkin_ws/src/ros_comm/clients/roscpp//home/sisko/catkin_ws/src/ros_comm/clients/roscpp/include'.
  Check the website 'http://ros.org/wiki/roscpp' for information and consider
  reporting the problem.
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  hector_slam/hector_geotiff/CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/sisko/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/sisko/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:22030: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

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.

Any help, PLEASE !!!

Asked by sisko on 2021-04-22 13:09:58 UTC

Comments

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

why?

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.

Asked by gvdhoorn on 2021-04-22 14:55:56 UTC

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.

Asked by sisko on 2021-04-22 16:51:01 UTC

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.

Asked by gvdhoorn on 2021-04-23 02:03:20 UTC

Answers

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).

Asked by gvdhoorn on 2021-04-23 02:13:27 UTC

Comments

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.

Asked by gvdhoorn on 2021-04-27 04:28:53 UTC