Creating a Debian package using an existing ros package

asked 2017-09-22 01:57:50 -0600

NCG gravatar image

updated 2017-09-28 04:47:05 -0600

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,

  1. include - I put all my header files here (including the auto generated .h files for .msg files in my package)
  2. lib - I put the executable of my node and also "pkgconfigs" folder where I created <pkg_name>.pc file
  3. 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>

  1. include
    • _pkg_
      • all the header files
  2. lib
    • _pkg_
      • executable
    • lib_pkg_name_.so
    • pkgconfing
      • _pkg_.pc
  3. share
    • _pkg_
      • cmake
      • launch
      • package.xml

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

edit retag flag offensive close merge delete

Comments

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?

tfoote gravatar image tfoote  ( 2017-09-22 03:27:24 -0600 )edit
1

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.

tfoote gravatar image tfoote  ( 2017-09-22 03:29:42 -0600 )edit

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)

NCG gravatar image NCG  ( 2017-09-22 03:56:57 -0600 )edit
  • include -<pkg>
    • all the header files
    • lib -<pkg>
    • executable
    • share -<pkg> -cmake -launch -package.xml
NCG gravatar image NCG  ( 2017-09-22 04:06:52 -0600 )edit

And these are the lines that I add to my .bashrc,

export ROS_PACKAGE_PATH=/opt/<my-pack>/share:/opt/ros/indigo/share:/opt/ros/indigo/stacks

export LD_LIBRARY_PATH=/opt/<my-pack>/lib:/opt/ros/indigo/lib:/opt/ros/indigo/lib/x86_64-linux-gnu

export CPATH=/opt/<...>/include:/opt/ros/indigo/include

NCG gravatar image NCG  ( 2017-09-22 04:08:33 -0600 )edit

export PKG_CONFIG_PATH=/opt/c01/lib/pkgconfig:/opt/ros/indigo/lib/pkgconfig

export CMAKE_PREFIX_PATH=/opt/c01:/opt/ros/indigo

NCG gravatar image NCG  ( 2017-09-22 04:09:13 -0600 )edit
1

@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 gravatar image tfoote  ( 2017-09-25 18:38:31 -0600 )edit

@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

NCG gravatar image NCG  ( 2017-09-28 04:48:24 -0600 )edit