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

Problems with a Bazel build of ROS2

asked 2021-06-05 15:45:06 -0600

Milan Vukov gravatar image


I managed to build ROS2 (foxy) with Bazel, see I chose to work with CycloneDDS for this adventure. I'm running Ubuntu 20.04, using GCC 9.3, Python 3.8, and Bazel 4. I can build publisher and subscriber nodes from ROS2 examples (see examples/chatter folder). The problem is that I get empty messages on the subscriber side. Namely, I (build and) run the publisher with

bazel run //examples/chatter:talker

and I see the following output:

1622923403.099532 [0]     talker: using network interface wlp0s20f3 (udp/192.168.0.X) selected arbitrarily from: wlp0s20f3, docker0
[INFO] [1622923403.604275233] [minimal_publisher]: Publishing: 'Hello, world! 0'
[INFO] [1622923404.104128462] [minimal_publisher]: Publishing: 'Hello, world! 1'
[INFO] [1622923404.604133903] [minimal_publisher]: Publishing: 'Hello, world! 2'
[INFO] [1622923405.104024189] [minimal_publisher]: Publishing: 'Hello, world! 3'

In a separate terminal I (build and) run the subscriber with

bazel run //examples/chatter:listener

and I get

1622923408.435101 [0]   listener: using network interface wlp0s20f3 (udp/192.168.0.X) selected arbitrarily from: wlp0s20f3, docker0
[INFO] [1622923408.604919651] [minimal_subscriber]: I heard: ''
[INFO] [1622923409.104868214] [minimal_subscriber]: I heard: ''

I also tried the following experiment: I ran colcon-built publisher_lambda node from examples_rclcpp_minimal_publisher package in one terminal and the Bazel-built subscriber in another terminal. The subscriber is not receiving any messages in this case. So, the Bazel build seems to be incompatible with regular colcon-based builds.

Any ideas where to look to resolve the mentioned issues?

Cheers, Milan

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-13 14:30:25 -0600

Milan Vukov gravatar image
edit flag offensive delete link more

Question Tools



Asked: 2021-06-05 15:45:06 -0600

Seen: 712 times

Last updated: Jun 13 '21