How to properly install packages from source?
Hi,
I have been reading on how to install packages INTO ROS that aren't included in the ROS installation for a while now and I still don't get it. I am trying to modify source before installing, hence I would like to build it myself.
I am using Kinetic (Ubuntu 16.04 LTS) distro using catkin filesystem. The package I am trying to install is this: serial
It is available as a .deb package so initially I installed it using sudo apt-get install ros-kinematic-serial
and that installed fine.
First of all, I don't quite get how a package like this one works when installed (or any ROS package). I checked its CMakeLists.txt file, it only installs headers and an example binary file. Going into
cd /opt/ros/kinetic/share/serial
there is only package.xml file and a cmake folder with serialConfig.cmake and serialConfig-version.cmake files. I compiled a basic ROS node using this library and it works fine, so how does ROS know where to find the src files if it only has headers and cmake configs installed?Secondly, if I try to install package from source into ROS, what's the proper way of doing it? I have tried:
cd ~/catkin_ws/src
git clone https://github.com/wjwwood/serial.git
cd ~/catkin_ws/ && catkin_make
source ~/catkin_ws/devel/setup.bash
That works fine, my example node works and I can adjust the source to my liking, but the package is installed to my catkin workspace and not the global ROS path. How do I add the package into the ROS environment so that something like
rospack list
can identify it?Lastly, how come after
catkin_make
I can't find my package using rosrun my_package serial_example_node?
Any help is really appreciated!
Something for the future: please don't ask multiple questions in a single post. The question title asks how to properly install pkgs from source, but the question text then goes on and adds two to three conceptual questions. Those additional questions are essentially 'invisible' this way.