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

"roscore" is not initializing - ROS MELODIC

asked 2018-09-08 23:43:27 -0500

revaapriyan gravatar image

updated 2022-01-31 08:52:28 -0500

lucasw gravatar image

I have installed ROS_MELODIC in my Ubuntu 18.04.1 LTS machine.

When I started the ros master with roscore, I got an exception as quoted.

... logging to /home/revan/.ros/log/199d6f5c-b3e9-11e8-b3b6-54a0507ac74b/roslaunch-revaapriyan-6988.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. 
RLException: Invalid <param> tag: Cannot load command parameter [rosversion]: no such command [rosversion roslaunch]. 
Param xml is <param command="rosversion roslaunch" name="rosversion"/> The traceback for the exception was written to the log file

The Traceback in the log file:

[roslaunch][ERROR] 2018-09-09 10:00:37,367: RLException: Invalid <param> tag: Cannot load command parameter [rosversion]: no such command [rosversion roslaunch]. 
Param xml is <param command="rosversion roslaunch" name="rosversion"/>
[roslaunch][ERROR] 2018-09-09 10:00:37,367: The traceback for the exception was written to the log file
[roslaunch][ERROR] 2018-09-09 10:00:37,368: Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 322, in main
    p.start()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 277, in start
    self._start_infrastructure()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 226, in _start_infrastructure
    self._load_config()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 138, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/config.py", line 447, in load_config_default
    load_roscore(loader, config, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/config.py", line 94, in load_roscore
    loader.load(f_roscore, config, core=True, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 751, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 723, in _load_launch
    self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 657, in _recurse_load
    default_machine, is_core, verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 667, in _recurse_load
    self._param_tag(tag, context, ros_config, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
    return f(*args, **kwds)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 282, in _param_tag
    "Invalid <param> tag: %s. \n\nParam xml is %s"%(e, tag.toxml()))
XmlParseException: Invalid <param> tag: Cannot load command parameter [rosversion]: no such command [rosversion roslaunch]. Param xml is <param command="rosversion roslaunch" name="rosversion"/>

My env variables are set as:

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_PYTHON_VERSION=2
ROS_PACKAGE_PATH=/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=
ROS_HOSTNAME=localhost
ROS_DISTRO=melodic

PS: gcc version - 7.3.0

edit retag flag offensive close merge delete

Comments

Can you tell us how you installed ROS? Using apt, or did you build things from sources?

If you used apt, can you check that you have python-rospkg installed? It should be by default, but I've seen stranger things. Check the output of dpkg -l | grep python-rospkg.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-09 04:03:44 -0500 )edit
  1. Installed ros by sudo apt-get install ros-melodic-desktop-full 2.Terminal output for python-rospkg check. (a) python-rospkg 1.1.7-100 all ROS package library (b) python-rospkg-modules 1.1.7-1 all ROS package

PS: I'm using Anaconda Distribution for managing python package

revaapriyan gravatar image revaapriyan  ( 2018-09-09 06:07:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-09-09 11:05:35 -0500

gvdhoorn gravatar image

PS: I'm using Anaconda Distribution for managing python package

please try removing Anaconda from your PATH and see whether roscore can start then.

Most likely the rospkg module installed by apt is installed for the system Python and is not found by Anaconda.

That is why it then can't call rosversion.

edit flag offensive delete link more

Comments

Even then, I have the same issue. :(

revaapriyan gravatar image revaapriyan  ( 2018-09-12 23:13:55 -0500 )edit
1

ok, let's take a step back.

Try this in a terminal:

rosversion

does that return any output?

If not, or just an error, run:

sudo apt-get install --reinstall python-rospkg
gvdhoorn gravatar image gvdhoorn  ( 2018-09-13 01:29:40 -0500 )edit

it's working now after the --reinstall command. Thanks a Lot

revaapriyan gravatar image revaapriyan  ( 2018-09-13 05:33:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-09-08 23:43:27 -0500

Seen: 2,673 times

Last updated: Sep 09 '18