Robotics StackExchange | Archived questions

Explanation of catkin_make install?

Hi everyone,

I am trying to create a binary representation of my workspace so that I can transfer just binaries rather than the source. I am able to generate an install directory of my workspace. when I move that install directory to some location other than where it was built, it can't 'find' anything? eg: copyting from ~/ws/ to ~/ then running source ~/install/setup.bash. How do I specify its new location? I believe the error is in the line

: ${_CATKIN_SETUP_DIR:=/home/<user>/ws/install}

of setup.sh or perhaps executable permissions since I have copied them to a new location? Am I suppose to run something else to setup permissions?

EDIT

I have found the problem is in relation to copying the directory from a usb. Is it possible to retain the files characteristics when copying from a USB? I think the problem is pertinent to file permissions.

Thanks, Grant

Asked by PapaG on 2019-08-26 18:07:59 UTC

Comments

edited to reflect my new question.

Asked by PapaG on 2019-08-26 20:58:01 UTC

try 'rospack profile' first to let system index your packages..

Asked by tianb03 on 2019-08-26 21:24:36 UTC

@tianb03 what should I be looking for from this command?

Asked by PapaG on 2019-08-26 21:36:09 UTC

I do think the issue is with permissions, none of the binaries in the new location have executable permissions

Asked by PapaG on 2019-08-26 21:39:47 UTC

Answers

ROS and catkin packages need to know the installation path when they are built, so the catkin installation process requires that you specify the installation directory when you run catkin_make install. If you don't specify an installation directory, it defaults to the install directory within your workspace.

You can change the destination directory with -DCMAKE_INSTALL_PREFIX:

$ catkin_make -DCMAKE_INSTALL_PREFIX=/opt/ros/<distro> install

You may want to choose an installation directory like /opt/PapaG that doesn't overlap with the system ROS installation, and then instruct you users to install the files in that directory.

The catkin_make wiki page provides more details and examples of how you can use catkin_make and its install command.

Asked by ahendrix on 2019-08-26 22:22:28 UTC

Comments

The issue is due to permissions, I solved it by zipping the entire install folder (zipping just its contents didn't work. Does the actually folder hold some config that is pertinent to the function? zipping it from the workspace, then unzipping it on a new workspace works, doing the same with only the contents of catkin_ws/install does not work?

Asked by PapaG on 2019-08-27 23:12:06 UTC

You are correct about permissions; the file permissions need to be preserved when moving the install directory from one computer to another. You can do this with tar, zip, rsync in archive mode, and probably a bunch of other linux tools.

I'm not aware of anything the src, devel, or build folders that is required to run code from the install folder. It would help to see the actual commands that you're using and the error that you're getting.

Asked by ahendrix on 2019-08-28 00:11:04 UTC

I was archiving (.tar.gz) all files inside catkin_ws/install/ then unzipping them (using tar) into a newly created folder. all files held their permissions however when I sourced the environment it would not launch anything for me. That being, all files from catkin_ws/install/ now existed inside ~/new/install/.

I instead archived the /install folder inside a .tar.gz from /catkin_ws/. When I unzipped this file into a new directory so that it now represented ~/new/install/, sourcing the environment and roslaunching all works.

Asked by PapaG on 2019-08-28 00:22:59 UTC