Ask Your Question
9

Generate .deb from ROS package

asked 2014-06-17 06:23:45 -0600

Jose Luis gravatar image

updated 2014-06-20 04:52:49 -0600

Hi to all,

I would like to generate a ".deb" file to share my ROS code with other. I have heard about Bloom and another ways to generate ".deb" files. However, this is not a good solution for me, I only need a local manner to generate a ".deb" file to obfuscate my source code and thereby, my colleague could install and use it in his computer, without see the source. I only need to share my code with my colleague, no with the ROS community, because it is a very concrete (ad hoc) source code, is not valid for the rest of community.

Is there a "ROS" manner to compile my ROS package in a .deb file?

Edit (by @William):

The first step is correct, it generates a debian folder with rules and another files.

$ cd path/to/your/catkin/package
$ bloom-generate rosdebian --os-name ubuntu --os-version trusty --ros-distro indigo

Then, when i try to use the second command:

$ fakeroot debian/rules binary

I have problems with CMakeList.txt.

-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.86
CMake Error at /opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:72 (find_package):
  Could not find a configuration file for package roscpp.

  Set roscpp_DIR to the directory containing a CMake configuration file for
  roscpp.  The file will have one of the following names:

    roscppConfig.cmake
    roscpp-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:7 (find_package)


CMake Error at /opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:72 (find_package):
  Could not find a configuration file for package message_generation.

  Set message_generation_DIR to the directory containing a CMake
  configuration file for message_generation.  The file will have one of the
  following names:

    message_generationConfig.cmake
    message_generation-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:7 (find_package)


CMake Error at CMakeLists.txt:26 (add_message_files):
  Unknown CMake command "add_message_files".


-- Configuring incomplete, errors occurred!
dh_auto_configure: cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCATKIN_BUILD_BINARY_PACKAGE=1 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr returned exit code 1
make[1]: *** [override_dh_auto_configure] Error 2
make: *** [binary] Error 2

The compiler, among other errors, does not recognize "add_message_files" command. Any idea?

Thank you very much for your help ;)


I am trying with a lot of configurations, but it doesn't work. I am sure that the solution is very simple. I attach my CMakelist.txt and package.xml, order that you may check the files.

CMakelist.txt

cmake_minimum_required(VERSION 2.8.3)
project(br_modbus)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp message_generation std_msgs genmsg)


## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
# catkin_python_setup()

#######################################
## Declare ROS messages and services ##
#######################################

## Generate messages in the 'msg' folder
 add_message_files(
   FILES
   BrInputStatus.msg
 )

## Generate services in the 'srv' folder
 add_service_files(
   FILES
   setOutput.srv
   setOutputEmpty.srv
   setOutputString.srv
   getOutput.srv
 )

## Generate added messages ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
9

answered 2014-06-17 14:06:45 -0600

William gravatar image

updated 2014-06-19 13:40:30 -0600

You can still use bloom to generate the source deb, from which you can build a binary deb:

$ cd path/to/your/catkin/package
$ bloom-generate rosdebian --os-name ubuntu --os-version trusty --ros-distro indigo

This will create a folder debian with all of the file you need to build a debian. After that you should be able to call something like this:

$ fakeroot debian/rules binary

To build the .deb file (according to this site: https://wiki.debian.org/BuildingAPackage ).

Node that by using the bloom-generate rosdebian ... ROS debian generator, this will setup the package to install into /opt/ros/<rosdistro>. If you want it installed into /usr you can just use the normal debian generator, i.e. replace rosdebian with debian.

The other option is to just use checkinstall : https://help.ubuntu.com/community/Che... which I believe can make .deb files out of anything which has an install rule.

Edit:

You will need to install all dependencies and source the appropriate setup file (usually /opt/ros/hydro/setup.bash) before running fakeroot ....

Edit:

You can try to use dpkg-buildpackage instead:

http://manpages.ubuntu.com/manpages/p...

I would just recommend using checkinstall.

edit flag offensive delete link more

Comments

1

As you can see in the CMakelist.txt and package.xml files, I use my own messages and services in my package, this is a trouble for the generation of .deb, as seen in the above mistake:

CMake Error at CMakeLists.txt:26 (add_message_files):
  Unknown CMake command "add_message_files". 

Jose Luis gravatar imageJose Luis ( 2014-06-20 06:22:55 -0600 )edit

Calling bloom-generate rosdebian is usually enough, distribution and ROS version are guessed automatically.

Is using CPack a bad idea? It allows to generate debian packages easily, what would be the drawbacks?

VictorLamoine gravatar imageVictorLamoine ( 2018-09-10 02:59:17 -0600 )edit
0

answered 2014-09-09 05:20:15 -0600

Damien gravatar image

This is not an answer but a question to William in order to complete the .deb generation locally...

I'm trying to perform the same operation than Jose: generate a local deb of my ros package. I do run "bloom-generate rosdebian --os-name ubuntu --os-version precise --ros-distro hydro" correctly but when running "fakeroot debian/rules binary" the compiler doesn’t find the include files that are located in the "devel/include/" directory of the catkin workspace. Those header files are auto-generated by catkin_make when defining services in my main code... Any idea on to solve this?

Also, could you elaborate on the 2 alternatives you are proposing: checkinstall and dpkg-buildpackage ? Thanks in advance.

edit flag offensive delete link more

Comments

1

Hi can you repost this in a new question and just link to this questions when describing your question? That would be more appropriate. Please include the bloom tag in your question and I'll see it and try to answer it.

William gravatar imageWilliam ( 2014-09-09 15:03:15 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-06-17 06:23:45 -0600

Seen: 6,058 times

Last updated: Sep 09 '14