Creating a Debian package using an existing ros package
Hi i am newbie to ROS, please bear with me if this is a stupid question. I am trying to create debian packages using my own ros packages. After studying the /opt/ros directory I manage to create a debian package which includes the following folders,
- include - I put all my header files here (including the auto generated .h files for .msg files in my package)
- lib - I put the executable of my node and also "pkgconfigs" folder where I created <pkg_name>.pc file
- share - here I put the cmake, launch and package.xml
So when I do "apt-get install <pkg_name>"(from my private server) all these will install correctly to the desired path in /opt directory(my-packs). I even add the paths correctly to the .bashrc file, in fact when I do roscd <pkg_name> it will recognize the folder as /opt/my-packs/share/<pkg-name>
However when I try to "rosrun <pkg_name> <executable_node> it will output an error,
[rosrun] Couldn't find executable named <executable_node> below /opt/c01/share/<pkg_name>.
I hope I am doing this correctly, but it seems rosrun can not find the path to the executable which is in the /opt/my-packs/lib/<pkg-name> . Please help me figure this out
EDIT
I use "dh_make" to make a .deb from my own ros package and yes I use install rule. So basically this is how my own repository looks like in the /opt folder, /opt/<my-repo>
- include
- _pkg_
- all the header files
- _pkg_
- lib
- _pkg_
- executable
- lib_pkg_name_.so
- pkgconfing
- _pkg_.pc
- _pkg_
- share
- _pkg_
- cmake
- launch
- package.xml
- _pkg_
And these are the lines that I add to my .bashrc,
export ROS_PACKAGE_PATH=/opt/<...>/share:/opt/ros/indigo/share:/opt/ros/indigo/stacks
export CPATH=/opt/<...>/include:/opt/ros/indigo/include
export PKG_CONFIG_PATH=/opt/c01/lib/pkgconfig:/opt/ros/indigo/lib/pkgconfig
export CMAKE_PREFIX_PATH=/opt/c01:/opt/ros/indigo
export LD_LIBRARY_PATH=/opt/<...>/lib:/opt/ros/indigo/lib:/opt/ros/indigo/lib/x86_64-linux-gnu
One more thing that I noticed was that when I do ldd executable
, the path assign to the lib_pkg_name_.so file is not , /opt/"my-pack>"/lib instead it is shown as /"my-local-ws"/devel/lib/
Thank you in advance
Please provide more information when you say you're "creating a debian package" there's a lot of approaches to doing this. Without knowing how you're attempting to do this it's unlikely we'll be able to help you. And when you put these files into certain places are you using an install rule?
Have you tried using bloom? http://wiki.ros.org/bloom One of it's main functions is to create git buildpackage repositories with all the debian metadata ready to create a sourcedeb.
And rosrun shouldn't be looking in share for executables. You might be giving invalid settings in your bashrc.
Thank you for the reply @tfoote. I use "dh_make" to make a .deb from my own ros package and yes I use install rule. So basically this is how my own repository looks like in the /opt folder, /opt/<my-repo> (please look at the next comment)
And these are the lines that I add to my .bashrc,
@NCG please edit your question to fill in these things. it will be much more readable. Can you make a simple test package that you can share to reproduce your problem? And looking at the error message if your executable installed below the directory it's looking in?
@tfoote I have edited accordingly. And thank you, I found that my executable is not installed under the desired directory. Is it possible to get any reference on how to change the path on CMakeLists.txt TIA