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

How to build only a few packages from a repository, instead of all?

asked 2020-04-24 07:30:44 -0500

lms95 gravatar image

updated 2022-02-13 17:03:24 -0500

lucasw gravatar image

In my case I am trying to use the Universal Robots package and the robotiq grippers package. These two packages I am installing them from source into my catkin workspace. But, these packages are very wide in the sense that I only need the description from one of the arms and a specific gripper. I want to avoid excessive computing when I run catkin build command tool. I am pretty new to ROS, so is this recommendable or should I install the full package?

Thank you!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-04-25 08:06:54 -0500

gvdhoorn gravatar image

updated 2020-04-25 08:08:55 -0500

I only need the description from one of the arms and a specific gripper.

You'll need to make sure to not remove any part of the repository you cloned which is used by the package(s) you are interested in, but other than that you should be able to either:

  • remove the directories containing the packages you're not interested in, or
  • place a CATKIN_IGNORE file in those directories

Both will cause the packages to no longer be built, nor found by any ROS tool. Not even in the src space of your workspace.

And a quick comment:

These two packages I am installing them from source into my catkin workspace. But, these packages are very wide in the sense that I only need the description from one of the arms and a specific gripper

where you write "package", you most of the time seem to actually be referring to the repository. Repositories contain packages. A collection of packages is not also called "a package".

edit flag offensive delete link more

Comments

And as always:

These two packages I am installing them from source

only build things from source if you really have to.

The "issue" you are running into is one of the reasons why from-source builds should be avoided.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-25 08:07:36 -0500 )edit
1

answered 2020-04-25 09:02:25 -0500

hashirzahir gravatar image

Perhaps you can use the catkin build command instead of catkin_make. catkin build allows for building individual packages via catkin build PKG_NAME to prevent rebuilding all. But this only works well when you are constantly building a small number of packages. If your problem is in reverse, in that you want to build all except a few packages, what gvdhoorn said is accurate, adding a touch CATKIN_IGNORE in the package directory will exclude it from future rebuilds.

Another method is to build all the static packages in one workspace and all the packages that need constant rebuilding in another workspace. Then, you can add an alias so that you are able to source both directories simultaneously

alias source_everything="source ws_1/devel/setup.bash && source ws_2/devel/setup.bash --extend"

Hope that helps.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-04-24 07:30:44 -0500

Seen: 150 times

Last updated: Apr 25 '20