Is there a way to distribute a ROS package without sharing the sources?
I just want the user to be able to run the ROS nodes without dependencies problems.
I know ROS is an open-source project, but I am not allowed to share the code.
Solution 1:
In your package CMakelists.txt, add the install directives. It goes like this :
install( TARGETS
#list of nodes
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS
#list of shared libraries
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
install(FILES
#list of necessary files (xml...)
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY
include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
)
Using
$ catkin_make
$ catkin_make install
you can create the binaries needed for execution without sharing the code. This will create another folder /install
in addition to the usual /devel
and /build
in your catkin workspace.
Note : You can specify the install folder using :
$ catkin_make -DCMAKE_INSTALL_PREFIX=path/to/folder install
Just make sure that the binaries need to be compiled for the correct architecture that the other computer has
and any dependencies you do not have in your workspace when you invoke catkin_make need to also be installed by the other part before being used.
Now that you have the /install
folder, just zip & send it.
Now, the essential part would be adding the install/setup.bash to your the other machine .bashrc
, or ROS won't find the distributed pacakges.
$ echo "source ~/catkin_ws/install/setup.bash" >> ~/.bashrc
See here for more information.
Solution 2:
you can have bloom generate you a deb-src and then you can compile that and distrbute the .deb file, ion the other machine, you can install it with dpkg -i
. This could be done by following this part of the pre-release tutorial.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With