1

I am trying to build the catkin work space with ROS kinetic on Ubuntu 16.04, but this is the error that has occurred and the package.XML is empty. So what should I do? Any suggestions? I am using also gazebo and just want to build the CMake but I couldn't. I am new to CMake and Ubuntu.

evadro@evadro-PowerEdge-T620:~/catkin_ws$ catkin build
-----------------------------------------------------------
Profile:                     default
Extending:             [env] /opt/ros/kinetic
Workspace:                   /home/evadro/catkin_ws
-----------------------------------------------------------
Build Space:        [exists] /home/evadro/catkin_ws/build
Devel Space:        [exists] /home/evadro/catkin_ws/devel
Install Space:      [unused] /home/evadro/catkin_ws/install
Log Space:          [exists] /home/evadro/catkin_ws/logs
Source Space:       [exists] /home/evadro/catkin_ws/src
DESTDIR:            [unused] None
-----------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
-----------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
-----------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
-----------------------------------------------------------
Workspace configuration appears valid.
-----------------------------------------------------------
Traceback (most recent call last):
  File "/usr/bin/catkin", line 11, in <module>
    load_entry_point('catkin-tools==0.4.5', 'console_scripts', 'catkin')()
  File "/usr/lib/python2.7/dist-packages/catkin_tools/commands/catkin.py", line 272, in main
    catkin_main(sysargs)
  File "/usr/lib/python2.7/dist-packages/catkin_tools/commands/catkin.py", line 267, in catkin_main
    sys.exit(args.main(args) or 0)
  File "/usr/lib/python2.7/dist-packages/catkin_tools/verbs/catkin_build/cli.py", line 422, in main
    summarize_build=opts.summarize  # Can be True, False, or None
  File "/usr/lib/python2.7/dist-packages/catkin_tools/verbs/catkin_build/build.py", line 283, in build_isolated_workspace
    workspace_packages = find_packages(context.source_space_abs, exclude_subspaces=True, warnings=[])
  File "/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py", line 89, in find_packages
    packages = find_packages_allowing_duplicates(basepath, exclude_paths=exclude_paths, exclude_subspaces=exclude_subspaces, warnings=warnings)
  File "/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py", line 150, in find_packages_allowing_duplicates
    xml, filename=filename, warnings=warnings)
  File "/usr/lib/python2.7/dist-packages/catkin_pkg/package.py", line 598, in parse_package_string
    raise InvalidPackage('The manifest contains invalid XML:\n%s' % ex, filename)
catkin_pkg.package.InvalidPackage: Error(s) in package '/home/evadro/catkin_ws/src/./package.xml':
The manifest contains invalid XML:
no element found: line 1, column 0
Kevin
  • 16,549
  • 8
  • 60
  • 74
GP2020-DAR
  • 29
  • 4

1 Answers1

0

Your Problem

You cannot have an empty package.xml. The package.xml contains all information about your package and some of them are necessary (like the name of the package). That's why your Error-Code tells you right at the end:

The manifest contains invalid XML: no element found: line 1, column 0

Also: where would you put your package.xml? You don't create a package.xml for a Workspace but for a Package, which can lie inside a workspace.

How to fix your package.xml

There is a very good Tutorial at ros.org about how to create a simple Package here. In case you really want to create a Workspace with an empty package in it, you can go to the src/ of your workspace (which doesn't need to contain anything but this src-folder yet) and run the following command:

catkin_create_pkg theNameOfMyNewPackage

Edit: if you are wondering how to structure your package.xml and how to organize your dependencies, there is also a very helpful page by Ros here

...but do you really want one?

But to me your Question sounds a lot like you don't actually want to have an empty package (and therefore no package.xml at all) but just an empty workspace. You can achieve that by navigating anywhere inside your workspace (which, again, doesn't need to contain anything but this src-folder yet) an run the following command:

cakin init

After that, you can still add some packages - like with the script catkin_create_pkg.

Jere
  • 1,196
  • 1
  • 9
  • 31
  • thank you for the answer but i don't want to crate a new xml package i think did something that delete for me all the dependency in the package.xml and i don't know how to fix it and return this dependency – GP2020-DAR Feb 12 '20 at 09:07
  • According to your question and also according to your error code, your package.xml is empty. I thought that was because you don’t actually have a package. If you do, you have a different question entirely: your problem then would be what package.xml fits to your package. – Jere Feb 12 '20 at 09:17
  • In case you really want to fix your dependencies, look at the link I just added – Jere Feb 12 '20 at 09:34
  • this link Ros here – GP2020-DAR Feb 12 '20 at 09:45