I am sorry, I misstyped the version of Ubuntu, it's Beaver 18.04, anyway no, I downloaded it via apt but is it meaningful?
Yes.
Seeing as you aren't building ROS Melodic on Ubuntu Xenial and as you are on a supported architecture (as you've already installed ROS using apt
) you can just install gmapping
using apt
:
sudo apt install ros-melodic-slam-gmapping
Is there any specific reason you did not do that?
Building ROS packages from source should not be your primary way of installing them. If possible, always prefer to install ROS packages using apt
on Ubuntu.
I've explained how you can determine whether you can use apt
(ie: whether binary packages are available) to install a package in #q320046.
In general there are very few circumstances in which building from source is needed or desirable. I would say for normal usage it's almost never needed. Except your own packages of course.
I then cloned the repo in /opt/ros/melodic/share
If you must build packages from source, don't place them in that directory. It will not work.
Clone packages in the source space of your workspace, run rosdep
to install all dependencies and then build the workspace (using catkin_make
, as you've been doing, or catkin build
(from catkin_tools
)). After source
-ing the devel/setup.bash
of your workspace, the package(s) should be available to you.
and run rosdep install gmapping
while this is a valid command, I don't believe it does what you think it does in this case. It does not register the package with ROS, or something similar. rosdep
is a tool used to install dependencies of ROS packages.
sourced the environment and run catkin_make
.
if you're building your workspace, those two steps should probably be reversed.
Refer to #q252478 for an example workflow that shows the steps in the correct order.
Am i wrong to clone repos there? is there a way to do otherwise without cloning them into the ws, as that seems to be the problem?
Cloning repositories (ie: building packages from sources) does have its uses, but I would strongly suggest to only do it when absolutely needed. As I wrote in #q320046, there are quite a few steps to get right, multiple points at which things can fail, and it's always more time consuming than a simple apt install
.
If you still want or need to build packages from sources, but don't want those packages in your 'main workspace', then I'd suggest to take a look at workspace overlaying. You place the packages you don't want in your main workspace in the underlay, build the underlay, source
it and then continue working in your main workspace.
Finally: I would remove any packages you've placed in /opt/ros/melodic/share
and try to install whatever you need using apt
. If it's not available, use an underlay workspace.
You have a from-source build of Melodic on Ubuntu
16.04
?Why do you clone repositories into
/opt/ros/melodic/share
? Even if you are building packages from source, that is not where packages should be cloned to. It's very likely that the package hasn't been built.Please clarify what sort of setup you really are running. gmapping has been released into both Kinetic and Melodic, so unless you absolutely must build Melodic from source on Xenial, using
apt
and a supported version of ROS would be very much preferred.Hi, thanks for your comment. I am cloning repos there because i don't want them to be included in my workspace, where i keep the packages i am working on. Or, at least, that's the meaning I give to the word "workspace", something where you work but not where your tools are, such as
catkin_ws
. i'm then runningrosdep install gmapping
and that call succeedes, or at least should.Am i wrong to clone repos there? is there a way to do otherwise without cloning them into the ws, as that seems to be the problem?
Please answer the question whether you are building ROS Melodic from source on Ubuntu Xenial.
And if yes, then why?
I am sorry, I misstyped the version of Ubuntu, it's Beaver 18.04, anyway no, I downloaded it via apt but is it meaningful?