{"id":21741319,"url":"https://github.com/data-capsule/fogros2-sgc","last_synced_at":"2025-07-18T22:31:10.351Z","repository":{"id":153629273,"uuid":"630058275","full_name":"data-capsule/fogros2-sgc","owner":"data-capsule","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-25T17:37:45.000Z","size":1497,"stargazers_count":10,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-17T16:11:48.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/data-capsule.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-19T15:21:24.000Z","updated_at":"2024-04-17T16:11:48.211Z","dependencies_parsed_at":"2023-05-28T17:15:27.362Z","dependency_job_id":"68daa3c5-07f8-4617-bec3-4c8d07df2570","html_url":"https://github.com/data-capsule/fogros2-sgc","commit_stats":null,"previous_names":["data-capsule/fogros2-sgc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-capsule%2Ffogros2-sgc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-capsule%2Ffogros2-sgc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-capsule%2Ffogros2-sgc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/data-capsule%2Ffogros2-sgc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/data-capsule","download_url":"https://codeload.github.com/data-capsule/fogros2-sgc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226449266,"owners_count":17626899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T06:18:21.820Z","updated_at":"2024-11-26T06:18:23.436Z","avatar_url":"https://github.com/data-capsule.png","language":"Rust","funding_links":[],"categories":["Platforms"],"sub_categories":["Network Platforms"],"readme":"# FogROS2 SGC \n\nFogROS2-SGC is a cloud robotics platform for connecting disjoint ROS2 networks across different physical locations, networks, and Data Distribution Services. \n\n\\[[Website](https://sites.google.com/view/fogros2-sgc)\\] \\[[Video](https://youtu.be/hVVFVGLcK0c)\\] \\[[Arxiv](https://arxiv.org/abs/2306.17157)\\]\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Local Demo](#local-demo)\n- [Build FogROS2 SGC](#build-fogros2-sgc)\n  - [Install dependencies](#install-dependencies)\n    - [Install Rust](#install-rust)\n    - [Install ROS](#install-ros)\n  - [Build the repo](#build-the-repo)\n- [Run with Different Machines](#run-with-different-machines)\n    - [Certificate Generation](#certificate-generation)\n    - [Run ROS2 talker and listener](#run-ros2-talker-and-listener)\n    - [Run with Environment Variables](#run-with-environment-variables)\n- [From SGC to SGC-lite](#from-sgc-to-sgc-lite)\n    - [Why Lite version](#why-lite-version)\n    - [Deploying Your Own Routing Infrastructure](#deploying-your-own-routing-infrastructure)\n    - [Notes on using Berkeley's Public Servers](#notes-on-using-berkeleys-public-servers)\n    - [TODOs](#todos)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n\n## Local Demo \nIf you want to get a taste of FogROS2 SGC without setting up the environment, just run \n```\ndocker compose build \u0026\u0026 docker compose up \n```\nwith docker ([install](https://docs.docker.com/get-docker/)) and docker compose ([install](https://docs.docker.com/compose/install/linux/)). \nIt takes some time to build. You will see two docker containers running `talker` and `listener` are connected securely with FogROS2-SGC.\n\n\n## Build FogROS2 SGC \nThe following are instructions of building FogROS2 SGC. \n\n### Install dependencies \n```\nsudo apt update\nsudo apt install build-essential curl pkg-config libssl-dev protobuf-compiler clang\n```\n\n#### Install Rust \n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -y\nsource \"$HOME/.cargo/env\"\n```\n\n#### Install ROS \nROS2 ~Dashing~ ~Eloquent~ Foxy Galactic Humble Rolling should work fine with FogROS2 SGC. \n\nHere we show the instruction of installing ROS2 rolling with Debian packages. \n\nFirst, install ROS2 from binaries with [these instructions](https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html).\n\nSetup your environment with [these instructions](https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html#environment-setup).\n\nEvery terminal should be configured with \n```\nsource /opt/ros/rolling/setup.bash\n```\n\nIf you have custom types in a specific ROS colcon directory, `source` the `setup.bash` in that directory. \n\n\n### Build the repo \n\nThe repo is built with \n```\ncargo build\n```\nIf you want to deploy with production system, use `cargo build --release` option for optimization level and removal of debug logs. \n\n## Run with Different Machines\nIn the example, we use two machines to show talker (machine A) and listener (machine B) example. \n\n#### Certificate Generation\nThe certificates can be generated by \n```\ncd scripts\n./generate_crypto.sh\n```\nEvery directory in `./scripts/crypto` contains the cryptographic secrets needed for communication. \n\nDistribute the `crypto` directory by from machine A and machine B. Here is an example with `scp`: \n```\nscp -r crypto USER@MACHINE_B_IP_ADDR:/SGC_PATH/scripts/\n```\nreplace `USER`, `MACHINE_B_IP_ADDR`, `SGC_PATH` with the actual paths.\n\nAfter the crypto secrets are delivered, go back to project main directory. \n\n#### Run ROS2 talker and listener\nNow run talker and listener on ROS2. \nMachine A:\n```\nros2 run demo_nodes_cpp talker\n```\nand\nMachine B \n```\nros2 run demo_nodes_cpp listener\n```\n\nThe listener may not get messages from Machine A. If they are in the same local network/machine, SGC is not needed.\n\n#### Run with Environment Variables \nRun FogROS2-SGC routers on the root project directory. \nOn the machine A\n```\nexport SGC_CONFIG=talker.toml\ncargo run router\n```\nOn the machine B\n```\nexport SGC_CONFIG=listener.toml\ncargo run router\n```\n\nThe talker and listener toml configuration file can be found [here](./src/resources/README.md). The configuration is currently coded with a Berkeley's signaling server that facilitates the routing inforamtion exchange. See [Making your own signaling server](#making-your-own-signaling-server) section for creating your own signaling server.\nThe system should also work if you don't specify the configuration file, then it uses automatic mode that \nconstantly checking for new topics. We note that it is only a convenient interface and not FogROS2-SGC is designed for.\nAs long as the talker and listener use the same crypto, the system should work.\n\nTo disable the logs and run with high optimization, run with `release` option by \n`\ncargo run --release router\n`\ninstead.\n\n\n## From SGC to SGC-lite\nThe updated configuration file format can be found [here](./src/resources/README.md), which we removed all the setup about protocols, ports, ips and gateways. Only one change on the signaling server field `signaling_server_address = \"ws://128.32.37.42:8000\"` is required to the old config file. The default signaling server is provided by Berkeley, but feel free to make your own server by the following instructions.\n\n(Note: remember to migrate the credentials from `./scripts` to the new repo as well!)\n\n\n#### Why Lite version \n\nThe FogROS2-SGC carries a bag of protocols to support heterogenous demands and requirements. \nIn this version, we streamline the routing setup by [webrtc](./docs/webrtc.md) instead of building all protocols with raw DTLS sockets.\nwebrtc is generally not compatible with the previous protocol. As a result, we make a lite version with only webrtc version. \n\n\n#### Deploying Your Own Routing Infrastructure\nThe simplest routing infrastructure consists a signaling server and a routing information base(RIB). \nThis can be done by running \n```\ndocker compose up -d signal rib\n```\nThe only requirement is to expose port 8000 and 8002 to other robots/machines. \n\nSignaling server faciliates the communication by exchanging the address information of webrtc. The details about how signaling server works can be found [HERE](./docs/webrtc.md).\n\n#### Notes on using Berkeley's Public Servers\nBerkeley's public servers are for experimental purposes and do not intend to be used for production system. We do not provide any guarantee on avaialbility. Please use your own signaling server for benchmarking and deployment.\nThe security guarnatees of FogROS2-SGC prevents other users/Berkeley from learning sensitive information, such as your ROS2 topic name and type, and on the actual data payload. What is visible is a random 256 bit name are published and subscribed by other random 256 bit names. \n\n#### Underdocumented Code\nWe have some unpublished code [https://github.com/KeplerC/fogros2-ls] which has a ROS node that launches SGC. We will port the code soon!\n\n#### TODOs \n1. expiration time for stale keys (this may happen if the subscriber suddenly drops off and does not connect to an existing publisher)\n2. in some rare cases, the IP address and port provided cannot connect, which blocks the publisher and subscriber. I noticed this only when running docker's talker on the edge and docker's listener on the cloud. (it works fine even if one of them is native) This happens periocially and sometime it just works. I don't know why. My hypothesis is some NAT issues with docker engine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdata-capsule%2Ffogros2-sgc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdata-capsule%2Ffogros2-sgc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdata-capsule%2Ffogros2-sgc/lists"}