Robotics StackExchange | Archived questions

Problems with a Bazel build of ROS2

Hello,

I managed to build ROS2 (foxy) with Bazel, see https://github.com/mvukov/rules_ros2. 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 publisherlambda node from examplesrclcppminimalpublisher 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

Asked by Milan Vukov on 2021-06-05 15:45:06 UTC

Comments

Answers

Fixed in https://github.com/mvukov/rules_ros2/pull/2.

Asked by Milan Vukov on 2021-06-13 14:30:25 UTC

Comments