Skip to content

data-capsule/fogros2-sgc-iros

Repository files navigation

FogROS2 SGC

FogROS2-SGC is a cloud robotics platform for connecting disjoint ROS2 networks across different physical locations, networks, and Data Distribution Services.

[Website] [Video] [Arxiv] (TODO: arxiv link)

Table of Contents

Local Demo

If you want to get a taste of FogROS2 SGC without setting up the environment, just run

docker compose build && docker compose up 

with docker(install) and docker compose(install). It takes some time to build. You will see two docker containers running talker and listener are connected securely with FogROS2-SGC.

Build FogROS2 SGC

The following are instructions of building FogROS2 SGC.

Install dependencies

sudo apt update
sudo apt install build-essential curl pkg-config libssl-dev protobuf-compiler clang

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -y
source "$HOME/.cargo/env"

Install ROS

ROS2 Dashing Eloquent Foxy Galactic Humble Rolling should work fine with FogROS2 SGC.

Here we show the instruction of installing ROS2 rolling with Debian packages.

First, install ROS2 from binaries with these instructions.

Setup your environment with these instructions.

Every terminal should be configured with

source /opt/ros/rolling/setup.bash

Build the repo

The repo is built with

cargo build

Run with Different Machines

In the example, we use two machines to show talker(machine A) and listener(machine B) example.

Certificate Generation

The certificates can be generated by

cd scripts
./generate_crypto.sh

Every directory in ./scripts/crypto contains the cryptographic secrets needed for communication.

Distribute the crypto directory by from machine A and machine B. Here is an example with scp:

scp -r crypto USER@MACHINE_B_IP_ADDR:/SGC_PATH/scripts/

replace USER, MACHINE_B_IP_ADDR, SGC_PATH with the actual paths.

After the crypto secrets are delivered, go back to project main directory.

Run with Environment Variables

Run FogROS2-SGC routers on the root project directory. On the machine A

export SGC_CONFIG=talker.toml
cargo run router

On the machine B

export SGC_CONFIG=listener.toml
export GATEWAY_IP=MACHINE_A_IP
cargo run router

Replace MACHINE_A_IP with the IP address of Machine A.

Note that A and B can configure with some intermediate machine C if they are not able to directly connect. Then configure GATEWAY_IP on both machines with machine C's ip address.

The talker and listener toml configuration file can be found here.

To disable the logs and run with benchmark mode, run with release option by

cargo run --release

Run ROS2 talker and listener

Now run talker and listener on ROS2.

# Machine A: 
ros2 run demo_nodes_cpp talker

and

# Machine B
ros2 run demo_nodes_cpp listener

TODOs and Known issues

  1. automatic topic discovery
  2. segmentation fault / node creation failure: not caused by our project but our underlying framework or ROS rcl itself. Restart the program and the problem should be fixed. The hypothesis is asynchronous error when the nodes are created too fast in parallel.