Ask Your Question
0

How do I run realsense_camera package built with catkin without running a script before?

asked 2018-02-08 09:15:56 -0500

CreFroD gravatar image

The realsense_camera package is not available for ROS Lunar, therefore I have built it from source as described in this tutorial. At the end of the tutorial an example on how to use the package is given:

source ~/catkin_ws/devel/setup.bash
roslaunch realsense_camera r200_nodelet_default.launch

So I want to avoid running this script every time and just run the package as if I installed it from repository:

roslaunch realsense_camera r200_nodelet_default.launch

I haven't ever used catkin before so I don't understand what the commands in tutorial actually do. Here is the contents of ~/catkin_ws/devel/setup.bash

#!/usr/bin/env bash
# generated from catkin/cmake/templates/setup.bash.in

CATKIN_SHELL=bash

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"

How do I do this? If I understand it correctly, the package is not installed in the system. Does catkin has something like make install?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-02-08 10:55:55 -0500

Dirk Thomas gravatar image

updated 2018-02-08 10:56:14 -0500

The script is setting up / extending some environment variable which are necessary to find artifacts in your custom location (~/catkin_ws). You can call env before and after sourcing the script to see the differences.

I assume you anyway source the file /opt/ros/lunar/setup.bash. In that case you could install the package into /opt/ros/lunar. Then it wouldn't require any additional file to be sourced. Assuming your workspace only contains that package you can install it like this: catkin_make_isolated --install --cmake-args -DCMAKE_INSTALL_PREFIX=/opt/ros/lunar (for the install step you will need root permission to copy the files to /opt/ros/lunar). You should be careful though since that might "interact" / "interfere" with Debian packages installed to that location (disclaimer: I haven't run that command and checked if it works or does any harm in your case). But this should give you some idea how to approach it.

edit flag offensive delete link more

Comments

Thank you for your answer. I tried to execute the command you gave with sudo, but I get error: sudo: catkin_make_isolated: command not found. Also I have to note, that I have two packages in the workspace: realsense_camera and librealsense. Will it work anyway?

CreFroD gravatar imageCreFroD ( 2018-02-08 12:47:10 -0500 )edit

catkin_make_isolated is part to the standard from-source tutorial ( http://wiki.ros.org/kinetic/Installat... ), Maybe you need to make sure that the environment is correct when using sudo?

Dirk Thomas gravatar imageDirk Thomas ( 2018-02-08 13:56:46 -0500 )edit

Both package will then be installed. If any of the packages is already installed from Debian that will overwrite the files. As long as you know what you do (and remember that in the future that you did that) it should be ok. There is no good way to "uninstall" the files again though.

Dirk Thomas gravatar imageDirk Thomas ( 2018-02-08 13:57:49 -0500 )edit

Thank you! But I decided to add the script to /opt/ros/lunar/setup.bash, which I source anyway on the start of the system.

CreFroD gravatar imageCreFroD ( 2018-02-09 15:17:50 -0500 )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

1 follower

Stats

Asked: 2018-02-08 09:15:56 -0500

Seen: 77 times

Last updated: Feb 08 '18