Ask Your Question
1

Build Ros Nodes with bazel

asked 2017-11-16 16:25:07 -0500

manan gravatar image

updated 2017-11-16 17:00:55 -0500

ahendrix gravatar image

Is it possible to Build ROS nodes with Bazel? e.g. could we build below example with Bazel? http://wiki.ros.org/ROS/Tutorials/Wri...

Please share your views.

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-11-16 17:10:52 -0500

ahendrix gravatar image

Unless you have a very compelling reason to use bazel, don't. It does a lot of things that aren't terribly compatible with the ROS package management system or traditional open-source build systems and package management.

The company that I work for uses bazel for our internal build system, and we have custom build rules for all of the ROS packages that we use, and a custom compatibility layer between bazel packages and ROS packages. Our rules are pretty specific to our application and are a pretty invasive modification to ROS, so we're not willing to open source them.

Bazel doesn't have any way to import local packages that are build by other tools (it can't read pkgconfig files or cmake find-package files), so it isn't easy to bring in external packages.

In theory you could install the precompiled ROS packages for Ubuntu or build and install ROS the normal way, and then add those libraries to bazel's WORKSPACE file, but that's still quite a bit of setup and you lose all of the inter-package dependencies that are defined in the cmake files and the package.xml files, so you'd have to either lump all of the ROS libraries into a single target, or redefine all of the packages and their dependencies within bazel.

edit flag offensive delete link more

Comments

Update: https://github.com/bazelbuild/rules_f... allows building libraries with CMake inside bazel project.

@ahendrix does this new functionality affect your view at all?

robarnes gravatar imagerobarnes ( 2018-08-28 17:31:20 -0500 )edit

I don't think that substantially changes my position. Those rules might save you some time importing C++ packages (but it's not clear how to handle dependencies between imported cmake projects), but they don't help at all with python or for making package management in ROS and bazel work together.

ahendrix gravatar imageahendrix ( 2018-08-28 18:17:49 -0500 )edit

Just an fyi: for ROS2 there is apparently a colcon compatibility pkg for Bazel: colcon/colcon-ros-bazel. That is the opposite direction of what the OP (and probably @robames) ask for, but I thought I'd mention it none-the-less.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-29 01:39:44 -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: 2017-11-16 16:25:07 -0500

Seen: 868 times

Last updated: Nov 16 '17