Giter VIP home page Giter VIP logo

ros-bazel's Introduction

Build ROS packages using Bazel

Bazel is the open-source version of Google's internal build system, featuring fast incremental compiles and remote caching for distributed builds.

It proved really fast on some of the benchmarks I ran, so I decided to try using it to build ROS packages.

Since converting the whole ROS build to Bazel is quite a lot of work (albeit highly recommended for larger teams), this project takes a different route and imports a prebuilt ROS environment (likely installed using apt and the default instructions). This gets you the best of both worlds: your code builds and tests using Bazel, and there's no overhead in maintaining Bazel builds of the whole ROS ecosystem.

It's even possible to import other catkin packages outside of the default ROS binary distribution.

Status

  • Import C++ libraries like roscpp, etc..
  • Code generation for messages, both C++ and Python
  • Depend on Bazel-generated messages
  • Bazel caching and sandboxing ready
  • ROS Python libraries are not imported into Bazel. Python is generally quite messy in Bazel anyhow.
  • Integration with rospack, roslaunch, and generally anything that crawls the filesystem at runtime. Bazel-built binaries will probably just not be found by such tools.
  • Actions, services, dynamic_reconfigure and probably other less-known message-based stuff.

This code is not supported in any way, and probably not recommended for production use. I just wanted to see if there was an easier way to onboard ROS teams to Bazel without having to maintain a whole separate build system for ROS.

Try it out

Get a shell in the docker environment:

docker-compose build && docker-compose run bazeler bash

Start a talker node with custom messages:

bazel run //src/talker

How it works

It uses a Bazel repository rule to parse the ROS installation under /opt/ros/melodic and produce Bazel BUILD files and repositories. For example, roscpp becomes a @roscpp Bazel target that add the correct link and compile flags.

ros-bazel's People

Contributors

nicolov avatar garethellis0 avatar fahhem avatar mposa avatar

Stargazers

 avatar Antonio avatar  avatar Chan-Soon Lim avatar Francesco Vezzi avatar Zebo Xiang avatar Jiang Shan avatar Dez avatar  avatar Charles Stolz avatar Joseph Lowman avatar LIN Weilin avatar JasonHsu avatar Martin Valgur avatar Kevin Ryan avatar maky avatar Himanshu Raghuvanshi avatar Clay Motupalli avatar Evan Flynn avatar  avatar Andrew Vorozcovs avatar Keivan avatar  avatar Nate Kent avatar Dani avatar EvanLyu732 avatar youjun avatar Kaiyuan Eric Chen avatar Aaron Covrig avatar Aleksander Gondek avatar Hemal Shah avatar  avatar Bill avatar Mooyeol Baek avatar skykying avatar ZuckXu avatar  avatar Sebastian Bergt avatar Kevin Greene avatar Luc Bettaieb avatar yt avatar Honggou avatar Chang Li avatar  avatar  avatar Micaela Angeli avatar  avatar Abishek avatar David Boldt avatar Istvan Balazs Opra avatar Jonáš Kulhánek avatar Veeresh Taranalli avatar  avatar Chiasung avatar Andre Nguyen avatar  avatar JimmyJin avatar Gabriel Vacaliuc avatar Igor Bogoslavskyi avatar Kazuto Murase avatar AJ avatar  avatar Wang Shuo avatar Dat Nguyen avatar Christoph Ulshoefer avatar  avatar  avatar Nathan Liebrecht avatar  avatar

Watchers

James Cloos avatar Luc Bettaieb avatar Evan Flynn avatar  avatar JimmyJin avatar  avatar Bill avatar

ros-bazel's Issues

Any plan for more advanced ROS stuff?

It would be nice to have some of the basic tools like rosbag available rqt_runtime_monitor, etc. Do you have any plans on that, or would you be interested in merging a PR containing those?

service files support

i was trying to support generation of services header with .srv files, the command is gensrv, how should i integrate into the generate_messages.bzl files? any hints?

Docker compose failure

When building the docker file I get

E: Package 'oracle-java8-installer' has no installation candidate
ERROR: Service 'bazeler' failed to build: The command '/bin/sh -c apt-get install -y --no-install-recommends         software-properties-common     && apt-add-repository ppa:webupd8team/java --yes     && echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections     && echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list     && curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -     && apt-get update     && apt-get install -y --no-install-recommends         oracle-java8-installer     && apt-get install -y --no-install-recommends         bazel     && bazel --batch version' returned a non-zero code: 100

As a side note, this project is 2 years old, @nicolov is this still the method you use internally at Cruise to build ros packages using Bazel?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.