ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Is it possible to run nodes without source ?

asked 2017-08-17 10:43:15 -0600

Bastienm gravatar image

Hi,

I'm working with ROS Kinetic in docker. I'm doing several thing through jenkins and several scripts to put my project (wrapped with ros) and all the dependency in the docker. As I want to keep my docker as light as possible I would like to remove all the source code from the package. The ros project is orbslam ( https://github.com/raulmur/ORB_SLAM2 ) with some update to publish the transform and some other data.

All the ros part is working well in the docker. But is there a way to "ros run" my RGBD app without having source code in the docker ? rosbuild isn't creating any exe that I could run without source ? Maybe only with lib .so ?

edit retag flag offensive close merge delete

Comments

You may be able to just copy over the build space of your workspace.

jayess gravatar image jayess  ( 2017-08-17 13:12:50 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2017-08-17 20:13:12 -0600

Ed Venator gravatar image

updated 2017-08-20 15:27:27 -0600

I do this routinely to build on one machine (my laptop) and deploy to a target machine (the robot).

First, make sure all of the packages you're building have install directives set up in your CMakeLists.txt For more information, refer to the catkin docs.

The rest of these instructions assume you use catkin-tools to build your workspace. You can do all of this with catkin_make, but I don't use it, so I can't give you instructions.

  1. Choose a directory to deploy your code to. It needs to exist on both your build machine (or build container) and your target machine. If it's in your home directory, the user names have to be the same in both environments. I usually create a directory in /opt and use sudo chown to give it to my user.
  2. On the build machine, set up your catkin workspace for install builds:

    catkin config --install

    catkin config --install-space /opt/my_workspace

  3. Build your workspace with catkin build. Catkin will do the normal build, but it will also install everything to the install space. All your libraries will be in /opt/my_workspace/lib/, all your executables from each package will be in /opt/my_workspace/lib/<pkg_name>/ and all of the files you install to the share directory, like launch files, will be in /opt/my_workspace/share/<pkg_name>/. If you've ever poked around in /opt/ros/, you'll notice that this is exactly how the binary packages you install with apt-get are laid out.

  4. Copy your install space from build machine to target machine. You can do this with scp or rsync for physical machines. Since you're using Docker, you can probably build this step into your Dockerfile.

The one downside to this is that the install space isn't totally portable--you have to deploy the files to the same path as you installed them to when you built them. There are ways around that (that's how the ROS build server works), but it's probably not worth the trouble. If you need that kind of power, you should just spin up a ROS build farm and make Debian packages.

edit flag offensive delete link more

Comments

Thanks for your answer ! I'll check how to do it with catkin_make, other way I'll use catkin-tools.

Bastienm gravatar image Bastienm  ( 2017-08-18 04:15:05 -0600 )edit

Did you able to solve it using catkin-tools ?

Zekarias Taye Hirpo gravatar image Zekarias Taye Hirpo  ( 2021-08-23 07:12:25 -0600 )edit
0

answered 2021-05-27 02:30:24 -0600

KroNton gravatar image

updated 2021-05-27 02:34:15 -0600

you can use the following steps to launch your files or run nodes without sourcing the workspace manually:

 nano ~/.bashrc

source ~/[workspace_name]/devel/setup.bash

 source ~/.bashrc
edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2017-08-17 10:43:15 -0600

Seen: 2,120 times

Last updated: May 27 '21