{"id":21741355,"url":"https://github.com/keplerc/fogros2-ls","last_synced_at":"2026-05-08T15:03:25.414Z","repository":{"id":175736416,"uuid":"654394315","full_name":"KeplerC/fogros2-ls","owner":"KeplerC","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-20T00:23:19.000Z","size":1669,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-21T03:29:29.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"data-capsule/fogros2-sgc","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeplerC.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,"dei":null}},"created_at":"2023-06-16T03:16:57.000Z","updated_at":"2024-10-10T09:18:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3d49497-618a-481a-96e4-5484a98b3262","html_url":"https://github.com/KeplerC/fogros2-ls","commit_stats":null,"previous_names":["keplerc/fogros2-sgc","keplerc/fogros2-ls"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KeplerC/fogros2-ls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeplerC%2Ffogros2-ls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeplerC%2Ffogros2-ls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeplerC%2Ffogros2-ls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeplerC%2Ffogros2-ls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeplerC","download_url":"https://codeload.github.com/KeplerC/fogros2-ls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeplerC%2Ffogros2-ls/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266189677,"owners_count":23890065,"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:26.855Z","updated_at":"2026-05-08T15:03:25.329Z","avatar_url":"https://github.com/KeplerC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"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## 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## Setup FogROS2 SGC \nThe following are instructions of setting up 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\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#### Certificate Generation\nEither you run it as a ROS node, or as a standalone process, you need to generate a certificate unique to the task as the globally unique identifier. This set of certificate should be shared by all the robots that you wish to be connected. \n\nThe certificates can be generated by \n```\ncd sgc_launch/configs\n./generate_crypto.sh\n```\nEvery directory in `./sgc_launch/configs/crypto` contains the cryptographic secrets needed for communication. \n\nDistribute the `crypto` directory by from machine A and machine B. This can be done with USB copying, typing or SSH. Here is an example with `scp`: \n```\nscp -r crypto USER@MACHINE_B_IP_ADDR:/SGC_PATH/sgc_launch/configs/\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\n## (Recommended) Run as a ROS2 node\n\n#### Step1: Create a ROS workspace and clone this repo to the workspace and build it\n```\ncd ~\nmkdir -p fog_ws/src\ncd ~/fog_ws/src\ngit clone https://github.com/KeplerC/fogros2-sgc.git\n\ncd ~/fog_ws \ncolcon build\n```\nPlease make sure that the repo is cloned directly under the `src` directory. \n\n#### Step2: Run with ros2 launch  \nMachine A: \n```\nros2 launch sgc_launch talker.launch.py\n```\n\nMachine B: \n```\nros2 launch sgc_launch listener.launch.py\n```\nNote that machine A and machine B do not need to configure any IP address, and they automatically connect. \n\nPlease refer to the  [README](./sgc_launch/README.md) for writing the launch file for your application. FogROS2-SGC supports automatic topic discovery, but it is recommended to expose the public interface only if intended. \n\n## Run as a standalone process\n### Build and Run\n\nThe repo can be built with \n```\ncargo run router\n```\nIf you want to deploy with production system, use `cargo build --release` option for optimization level and removal of debug logs. \n\nTo disable the logs and run with high optimization, run with `release` option by \n`\ncargo run --release router\n`\ninstead.\n\nAdding and removing topics requires REST API. Example of such is \n```\ncurl -X POST http://localhost:3000/topic \\\n   -H 'Content-Type: application/json' \\\n   -d '{\"api_op\":\"add\",\"ros_op\":\"pub\", \"crypto\":\"test_cert\", \"topic_name\":\"/chatter\", \"topic_type\":\"std_msgs/msg/String\"}'\n```\nThe port for the REST interface can be changed via `SGC_API_PORT` environment variable.\n\n## Notes \nThe 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\n#### How is it different from IROS 2023 version\nIn the updated version, we removed all the setup about protocols, ports, ips and gateways.\nPrevious 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. \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#### Deploying Your Own Routing Infrastructure\nIf you don't want to use Berkeley's infrastructure, having one on your own is very easy. \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).\nThen update the config files by replacing the IP address to your server's IP address.  \n\n\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. The common root cause is that the firewall bans the ports larger than 50000, which may happen in some enterprise or restrictive settings. If you have one side of the machine (like cloud) that opens the port greater than 50000, it should be able to connect. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeplerc%2Ffogros2-ls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeplerc%2Ffogros2-ls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeplerc%2Ffogros2-ls/lists"}