/apollo_ros_bridge

Bridge messaging between Apollo and ROS

Primary LanguageC++Apache License 2.0Apache-2.0

Apollo ROS Bridge

Overview

This is a C++ library which is used to interface messages between ROS and Apollo ecosystem. It is designed to help developers use ROS libraries to communicate with Apollo and hence make development easier.

Affiliation: Ridecell
Maintainer: Abhilash Balachandran abhilash@ridecell.com

Dependencies

Installation

Using Prebuilt docker image

There is a prebuild docker image which can be directly used. To use the prebuilt docker image:

cd docker_tools
./run.sh

Building docker image

To build the docker image on your machine,

cd docker_tools
./build.sh $image_name

If no image name is provided, it defaults to auroai/apollo_ros_bridge:latest

Building bridge code

In order to build the bridge, first build the appropriate ros messages used in the bridge source code:

cd /home/apollo_ros_bridge/ros_pkgs
catkin build

Now, build the bridge source code using bazel. From the root workspace of the package,

cd /home/apollo_ros_bridge
bazel build cyber_ros_bridge:all

To run the example node, run

roscore && ./bazel-bin/cyber_ros_bridge/cyber_ros_bridge

for extra logging,

GLOG_v=4 GLOG_logtostderr=1  ./bazel-bin/cyber_ros_bridge/cyber_ros_bridge

This launches the bridge with default params (defined in the common folder).

Alternatively, to launch the bridge with custom parameters,

cyber_launch start cyber_ros_bridge/launch/bridge_example.launch

Inside Apollo's repo, modify the following lines in docker/scripts/dev_start.sh

Comment out the following lines

--add-host in_dev_docker:127.0.0.1 \
--add-host ${LOCAL_HOST}:127.0.0.1 \
--hostname in_dev_docker \

This permits communication via ROS ecosystem

Run Apollo

Topics can be visualized with rostopic list and echo

Alternatively, publish relevant topics from ROS and view topics using cyber_monitor on Apollo's side

A sample script to run a ROS Container has been provided to help developers. This can be launched using:

cd /home/apollo_ros_bridge/docker_tools
./example_ros_run.sh

Adding Custom Bridging

For detailed information on how to add own bridging of topics, refer to adding custom bridging

Copyright and License

The apollo ros bridge source code is released under the Apache License, Version 2.0

Future Updates

  • Support for apollo 5.0
  • Timer method for bridging
  • easier docker setup