Robotics StackExchange | Archived questions

How to get Packages built for ROS Kinetic working in ROS Melodic?

I have cloned packages for an ROS based robot called Chefbot from This Github repository and copied the chefbot folder from the cloned files, into my catkin workspace src folder as per the instructions of the developer. This project is based on ROS Kinetic and I am running ROS Melodic. When I source my updated workspace after doing this, I am getting the following error output:

shaunak@robokits:~/catkin_ws$ rosdep install -y --from-paths src --ignore-src --rosdistro melodic  --os=ubuntu:bionic
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
chefbot_bringup: Cannot locate rosdep definition for [depthimage_to_laserscan]
chefbot_gazebo: Cannot locate rosdep definition for [create_node]
chefbot_description: Cannot locate rosdep definition for [create_description]

I also tried rosdep install --from-paths src --ignore-src --rosdistro=melodic -y -r to ignore the errors and initiate catkin_make_isolated --force-cmake(I am not using catkin_make as it does not work for other packages) but it throws an error of not being able to process the package. I am sure that the packages run without errors in ROS Kinetic. So I have to resolve this particular package's ROS version compatibility issue which is actually not there as per The Discussion Here, I am convinced with it and hence I have a few questions:

  1. Which files in any ROS package do depend on the version of ROS?
  2. Which segments in files referred in Question 1 do depend on the version of ROS?
  3. How does the environment of the ROS version affect these segments referred in Question 2?
  4. What can be done to make the environment of the ROS flexible so that the segments and hence the files do not get affected with the version-change?

The questions may sound silly as I am a beginner, but I have been facing the issues considering a fact that ROS Melodic is the latest release. In fact, there is not a problem with a version-change in general, but sometimes this kind of issue pops up where things are not happening with other developer's open source package with different ROS version. So the answers to these questions may be helpful.

Edit 1 with reference to the Answer 1 (below) from @l4ncelot :

I followed the steps suggested in Answer 1 by cloning the package depthimage_to_lasercan from the source link given Here to my catkin workspace, sourcing the workspace and then applying catkin_make, but I am getting the following error output:

error: expected constructor, destructor, or type conversion before  ' ( ' token
 PLUGINLIB_DECLARE_CLASS(depthimage_to_laserscan, DepthImageToLaserScanNodelet,  
 depthimage_to_laserscan::DepthImageToLaserScanNodelet, nodelet::Nodelet);
                         ^
depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScanNodelet.dir/build.make:62: recipe for target 'depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScanNodelet.dir/src/DepthImageToLaserScanNodelet.cpp.o' failed

This seems to be more of a syntax error which I am not able to solve. I went to the Bug / feature tracker link of the package given Here, but could not get much out of it.

Edit 2 with reference to comment from @l4ncelot :

Comment Number 4 -->

@Shaunak Vyas doesn't matter if it's has been released yet or not. Just get the pull request (or edit you code by yourself according to [this](https://github.com/ros-perception/depthimage_to_laserscan/pull/27/commits/6394008e59c95773750e48ff90efd4d0f5c95db3) commit) and it should fix the error.

Thank you for this. After getting so many missing packages, it fixed the error indeed. Now I am able to execute rosdep install -y --from-paths src --ignore-src successfully. But when I apply catkin_make_isolated --force-cmake, I am dealing with the following error output:

    -- Could NOT find kobuki_description (missing: kobuki_description_DIR)
    -- Could not find the required component 'kobuki_description'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
    CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
      Could not find a package configuration file provided by
      "kobuki_description" with any of the following names:

        kobuki_descriptionConfig.cmake
        kobuki_description-config.cmake

      Add the installation prefix of "kobuki_description" to CMAKE_PREFIX_PATH or
      set "kobuki_description_DIR" to a directory containing one of the above
      files.  If "kobuki_description" provides a separate development package or
      SDK, be sure it has been installed.
    Call Stack (most recent call first):
      CMakeLists.txt:7 (find_package)
    -- Configuring incomplete, errors occurred!
<== Failed to process package 'chefbot_description'

Tried to google the error statement "Could not find a package configuration file" and got to know that there are many people facing the same error, but the solution depends on the package and hence it's not generalized.

Edit 3 based on few failed experiments :

As the error stated in Edit 2 was not getting resolved even after escalating the issue Here, I applied a new approach by removing the Chefbot package from my workspace because I wanted to check whether the standard packages get built or not. Now I am having a workspace that has all the required packages for Chefbot and the command rosdep install -y --from-paths src --ignore-src --rosdistro melodic --os=ubuntu:bionic runs successfully by giving output #All required rosdeps installed successfully without even a single warning. That means my dependencies are correct. But I am stuck at an error when applying catkin_make_isolated --force-cmake and I have escalated the issue Here. The error that I am getting seems like a programming error and hence I can not do anything except waiting for the package developer to resolve it.

Note: I have cloned each and every package into my workspace from the ROS Wiki source link of the package only.

Asked by Shaunak Vyas on 2018-10-11 00:13:41 UTC

Comments

First google result pointed me here where someone had the same error message.

Asked by l4ncelot on 2018-10-12 01:34:52 UTC

@l4ncelot: Alread done. If you got to #27 link given there, you will find comment from @jarvisschultz stating Also added depthimage_to_laserscan to rosinstall.........

Asked by Shaunak Vyas on 2018-10-12 01:59:48 UTC

..............................which directs Here. If you see the uri of the updated depthimage_to_laserscan package with patch carefully, it is the same as given Here

Asked by Shaunak Vyas on 2018-10-12 02:03:58 UTC

@Shaunak Vyas doesn't matter if it's has been released yet or not. Just get the pull request (or edit you code by yourself according to this commit) and it should fix the error.

Asked by l4ncelot on 2018-10-12 02:08:56 UTC

@l4ncelot : Please see Edit 2 in the Question.

Asked by Shaunak Vyas on 2018-10-12 05:46:26 UTC

The error from edit 2 tells you it can't find kobuki_description package. Here is the package you need. Do the same thing like with other catkin package i.e. clone to workspace, build, source.

Asked by l4ncelot on 2018-10-12 05:56:16 UTC

Please stop suggestion a manual workflow.

Read the documentation for rosinstall_generator and use that.

Asked by gvdhoorn on 2018-10-12 05:57:57 UTC

@gvdhoorn yeah I know that. But I think it's better to go through this manually to actually see what's going on and to learn how to read error messages and fix them manually. Automatic work is great, but beginner would have no idea what's going on behind the scene IMO.

Asked by l4ncelot on 2018-10-12 06:02:46 UTC

@l4ncelot :

Here is the package you need. Do the same thing like with other catkin package i.e. clone to workspace, build, source.

I have already cloned the same to my workspace. This error comes after sourcing the workspace with this package only.

Asked by Shaunak Vyas on 2018-10-12 06:07:22 UTC

It's always good to know how things work, but with the workflow recommended in this answer, future readers as well as @Shaunak Vyas potentially spend hours resolving missing pkg errors. That is not very productive and in addition we don't want newcomers to get used to such a workflow. We have ..

Asked by gvdhoorn on 2018-10-12 06:07:35 UTC

.. a hard enough time teaching new ROS users to not build everything from source. So if you must build from source, and the target pkg and some of it's dependencies are not available in a particular distribution, use rosinstall_generator.

Asked by gvdhoorn on 2018-10-12 06:08:33 UTC

This error comes after sourcing the workspace with this package only.

this is me nitpicking, but you still don't source any workspace here. That comes after things have built successfully.

You're trying to build your workspace.

Those are very differen things.

Asked by gvdhoorn on 2018-10-12 06:09:16 UTC

@gvdhoorn So if you must build from source, and the target pkg and some of it's dependencies are not available in a particular distribution, use rosinstall_generator

I do not think rosinstall_generator will resolve this as my rosdep install ... command is successful.

Asked by Shaunak Vyas on 2018-10-12 06:19:35 UTC

@gvdhoorn point taken.

Asked by l4ncelot on 2018-10-12 06:23:49 UTC

@Shaunak Vyas:

as my rosdep install ... command is successful.

That surprises me, as if it would be successful, it would have installed kobuki_description for you.

Are you still adding -r to the rosdep command line?

If so, it's ignoring uninstallable packages.

Asked by gvdhoorn on 2018-10-12 06:25:55 UTC

@gvdhoorn I am not adding -r. My whole command is :

rosdep install -y --from-paths src --ignore-src --rosdistro melodic  --os=ubuntu:bionic

Which gives output

#All required rosdeps installed successfully

without even a single warning.

Asked by Shaunak Vyas on 2018-10-12 06:33:29 UTC

What is the output of dpkg -l | grep kobuki-description?

Or did you already clone that package into your workspace?

Asked by gvdhoorn on 2018-10-12 06:42:27 UTC

It is already cloned in my workspace.

Asked by Shaunak Vyas on 2018-10-12 06:45:38 UTC

@gvdhoorn @l4ncelot : Please see Edit 3 in the question.

Asked by Shaunak Vyas on 2018-10-13 03:51:18 UTC

You basically ran into the "you can try building pkgs on newer ROS releases, and they should work, provided their dependencies did not change significantly in the newer ROS version" exception.

Unfortunately Gazebo 9 is rather different from Gazebo 7 in important areas. That is why you are ..

Asked by gvdhoorn on 2018-10-13 08:32:46 UTC

.. seeing compiler errors for that package.

If you don't need that particular package, you could just ignore it.

Asked by gvdhoorn on 2018-10-13 08:33:21 UTC

I need it.

Asked by Shaunak Vyas on 2018-10-13 10:42:12 UTC

Hi @Shaunak Vyas, sounds like you are down to Gazebo 7 vs 9 errors. I recently encountered the same issue and fixed it on my fork. Perhaps that will help get you going.

Asked by jarvisschultz on 2018-10-14 17:16:57 UTC

@jarvisschultz : I am not opening gazebo as of now. I am working with RViz for mapping and navigation. I am in touch with the developer of Chefbot Mr Lentin Joseph now.

Asked by Shaunak Vyas on 2018-10-17 04:15:34 UTC

In the meanwhile, if anyone can refer me a book/link explaining how to build an ROS package targeting Autonomous Robot with Kinect from scratch, I would be grateful.

Asked by Shaunak Vyas on 2018-10-17 04:16:19 UTC

The bug report you submitted on the turtlebot_create_desktop package is specifically a Gazebo version issue. Doesn't matter if you're not using Gazebo, whatever you are doing is trying to compile Gazebo plugins

Asked by jarvisschultz on 2018-10-17 07:42:26 UTC

@jarvisschultz : I completely agree with you. Anyways, Mr Lentin Joseph has asked me to solve this problem on my own by studying ROS. It was a silly mistake that I have done by not understanding the concepts thoroughly and starting up with irrelevant questions.

Asked by Shaunak Vyas on 2018-10-19 00:35:00 UTC

I will give answer to my own question soon. Thank you so much everyone for getting involved into the conversation.

Asked by Shaunak Vyas on 2018-10-19 00:35:31 UTC

Answers

Let's break down those errors messages.

chefbot_bringup: Cannot locate rosdep definition for [depthimage_to_laserscan]

This error basically tells you "while searching for the dependencies for package chefbot_bringup I couldn't find rosdep definition for depthimage_to_laserscan". If you look at wiki page of depthimage_to_lasercan package here you can see that the package is not release for melodic. This is the reason why rosdep couldn't find the definition.

rosdep command looks for the dependencies in package.xml file in each project. Have a look here where the depthimage_to_lasercan is defined.

What you need to do right now is to build the depthimage_to_lasercan from source from github (clone the package from git to your catkin workspace, catkin_make command and don't forget to source the workspace in the end).

The same idea applies for the remaining 2 packages.

Asked by l4ncelot on 2018-10-11 03:46:16 UTC

Comments

@l4ncelot is essentially correct.

One tool that can help generate "trees" of dependencies for you and help you checkout the sources of them is rosinstall_generator.

Asked by gvdhoorn on 2018-10-11 03:58:35 UTC

@gvdhoorn : Please see Edit 1 and Edit 2 in Question.

Asked by Shaunak Vyas on 2018-10-12 05:48:33 UTC