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:
- Which files in any ROS package do depend on the version of ROS?
- Which segments in files referred in Question 1 do depend on the version of ROS?
- How does the environment of the ROS version affect these segments referred in Question 2?
- 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 ...
First google result pointed me here where someone had the same error message.
@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.........
..............................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
@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.
@l4ncelot : Please see Edit 2 in the Question.
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.Please stop suggestion a manual workflow.
Read the documentation for
rosinstall_generator
and use that.@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.
@l4ncelot :
I have already cloned the same to my workspace. This error comes after sourcing the workspace with this package only.
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 ..
.. 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
.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.
@gvdhoornSo 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 myrosdep install ...
command is successful.@gvdhoorn point taken.
@Shaunak Vyas:
That surprises me, as if it would be successful, it would have installed
kobuki_description
for you.Are you still adding
-r
to therosdep
command line?If so, it's ignoring uninstallable packages.
@gvdhoorn I am not adding
-r
. My whole command is :Which gives output
without even a single warning.
What is the output of
dpkg -l | grep kobuki-description
?Or did you already clone that package into your workspace?
It is already cloned in my workspace.
@gvdhoorn@l4ncelot : Please see Edit 3 in the question.
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 ..
.. seeing compiler errors for that package.
If you don't need that particular package, you could just ignore it.
I need it.
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.
@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.
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.
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@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.
I will give answer to my own question soon. Thank you so much everyone for getting involved into the conversation.