• Stars
    star
    171
  • Rank 220,939 (Top 5 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Adaptive and Extensible Platform for Cloud and Fog Robotics Using ROS 2

FogROS2

FogROS2 extends ROS 2 [1] for cloud deployment of computational graphs in a security-conscious manner. It allows researchers to easily and securely deploy ROS abstractions across cloud providers with minimal effort, thus gaining access to additional computing substrates including CPU cores, GPUs, FPGAs, or TPUs, as well as pre-deployed software made available by other researchers. To do so, FogROS2 extends the ROS 2 launch system, introducing additional syntax to allow roboticists to specify at launch time which components of their architecture will be deployed to the cloud and which components will be deployed on the edge.

Install

Quickstart

If you are new to ROS and Ubuntu, and want to install FogROS 2 (and ROS 2) and its requisites from scratch, follow instructions here.

Docker (Recommended)

Alternatively, you can simplify reproduction using an OS virtualization environment with Docker. You can also watch our video tutorial here.

git clone -b humble https://github.com/BerkeleyAutomation/FogROS2
cd FogROS2

# Install AWS CLI
sudo apt install awscli

# Configure AWS Basic Settings. To run the next command, you need to have your security credentials, an output format and AWS Region. See https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
aws configure

#Build Docker Image
docker build -t fogros2 .

By default, this command will build a docker image for ROS Rolling and Ubuntu 22.04 (jammy). These defaults can be changed using the --build-arg flag (e.g., docker build -t fogros2:focal-humble . --build-arg UBUNTU_DISTRO=focal --build-arg ROS_DISTRO=humble will build a ROS Humble image with Ubuntu 20.04 (focal)). Note: the Dockerfile is cooked for x86_64. If you're using a workstation with an Arm-based architecture (e.g. an M1), build the container with the docker build --platform linux/amd64 -t fogros2 ..

Natively

FogROS2 is actually a ROS meta-package, so you can just fetch it in your workspace, build it, source the workspace as an overlay and start using its capabilities. You can also watch our video tutorial here.

Install Dependencies

ROS 2 dependencies:

# If using Ubuntu 22.04
sudo apt install ros-rolling-rmw-cyclonedds-cpp

FogROS 2 dependencies:

sudo apt install python3-pip wireguard unzip
sudo pip3 install wgconfig boto3 paramiko scp

# Install AWS CLI
sudo apt install awscli

# Configure AWS Basic Settings. To run the next command, you need to have your security credentials, an output format and AWS Region. See https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
aws configure
source /opt/ros/<your-ros2-distro>/setup.bash
mkdir -p ~/fog_ws/src
cd ~/fog_ws/src
git clone -b humble https://github.com/BerkeleyAutomation/FogROS2
cd ../
colcon build  # re-build the workspace
source install/setup.bash

Launch ROS 2 computational graphs in the cloud

Docker (Recommended)

You can see this in our video tutorial here

# launch fogros2 container
docker run -it --rm --net=host -v $HOME/.aws:/root/.aws --cap-add=NET_ADMIN fogros2

# launch talker node on the cloud
ros2 launch fogros2_examples talker.aws.launch.py

(Note: the Dockerfile is cooked for x86_64. If you're using a workstation with an Arm-based architecture (e.g. an M1), run the container with the docker run -it --platform linux/amd64 --rm --net=host --cap-add=NET_ADMIN fogros2.)

Native

Note: These commands must be run from the root of your ROS workspace. You can see this in our video tutorial here.

source /opt/ros/<your-ros2-distro>/setup.bash
source install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp 
export CYCLONEDDS_URI=file://$(pwd)/install/fogros2/share/fogros2/configs/cyclonedds.ubuntu.$(lsb_release -rs | sed 's/\.//').xml

ros2 launch fogros2_examples talker.aws.launch.py

Run your own robotics applications

If using, for example, Docker take the following steps:

Step 1: Mount your robotics application to docker's folder. For example,

docker run -it --rm \
    --net=host --cap-add=NET_ADMIN \
       ....
    -v FOLDER_IN_YOUR_LOCAL_DIR:/home/root/fog_ws/src/YOUR_PKG_NAME \
       ...
    keplerc/ros2:latest /bin/bash

You may also git clone your development repo to the docker container instead.

Step 2: Write the FogROS2 launch file. Examples of launch files can be found in the talker*.launch.py here.

Setting Up Automatic Image Transport

Step 1: Identify all topics that need to use a compressed transport.

Step 2: In a fogros2.CloudNode, add the parameter stream_topics=[], where stream_topics is a list of tuples where each tuple is just a pair of (TOPIC_NAME, TRANSPORT_TYPE) values.

TOPIC_NAME is the string that represents the name of the topic that publishes sensor_msgs/Image

Valid TRANSPORT_TYPE values are compressed, theora, and raw if only image-transport and image-transport-plugins are installed on the system. h264 is another valid TRANSPORT_TYPE if step 3 is followed.

Step 3 (Optional): If using H.264, please also clone the H.264 decoder found here into the workspace's src directory. The current repo only contains the encoder and the full image transport pipeline will not work without the decoder also.

Example of stream_topics argument:

stream_topics=[('/camera/image_raw', 'h264'), ('/camera2/image_raw', 'compressed')]

Adding the above argument to a fogros2.CloudNode makes the topic /camera/image_raw publish using the h264 image_transport, and makes the topic /camera2/image_raw publish using the compressed image_transport.

Please note that all cloud nodes that are expecting raw images will be remapped to TOPIC_NAME/cloud to remove any topic naming conflicts. (TODO: Automate remapping)

Command Line Interface

We currently support the following CLI commands for easier debugging and development.

# List existing FogROS instances
ros2 fog list

# Connect via SSH to the corresponding instance (e.g., named "ascent-corona")
# the instance name can be found by the list command above
ros2 fog connect ascent-corona

# delete the existing FogROS instance (e.g. named "ascent-corona")
ros2 fog delete ascent-corona
# or all of the existing instances
ros2 fog delete all

Some Common Issues

  1. Warning: 2 packages has stderr outputs: fogros2 fogros2_examples after running colcon build. This warning occurs in Ubuntu 22.04 (jammy) builds, but does not affect functionality. See #45. Your installation should still work.
  2. [WARN] [1652044293.921367226] [fogros2.scp]: [Errno None] Unable to connect to port 22 on xx.xx.xx.xxx, retrying... . This warning occurs when AWS has not yet started the instance. This message should eventually be replaced by SCP Connected! once the instance is started.
  3. WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behavior with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. This warning is often seen when installing packages on the cloud instance, but can be ignored.

Running Examples:

We have used FogROS for 3 example use-cases (motion planning, grasp planning, and SLAM map building). Please see our examples repo for these and how to run them.

References

[1] Macenski Steven, Foote Tully, Gerkey Brian, Lalancette Chris, and Woodall William, “Robot Operating System 2: Design, architecture, and uses in the wild,” Science Robotics, vol. 7, no. 66, p. eabm6074, doi: 10.1126/scirobotics.abm6074.

More Repositories

1

gqcnn

Python module for GQ-CNN training and deployment with ROS integration.
Python
306
star
2

dex-net

Repository for reading the Dex-Net 2.0 HDF5 database of 3D objects, parallel-jaw grasps, and robust grasp metrics
Python
296
star
3

sd-maskrcnn

Code for SD Mask R-CNN Project
C++
212
star
4

meshrender

A set of Python utilities for rendering 3D meshes with OpenGL
Python
135
star
5

rlqp

Accelerating Quadratic Optimization with Reinforcement Learning
84
star
6

autolab_core

Core utilities for Berkeley AutoLab.
Python
81
star
7

AlphaGarden

A fast, first order open-access simulator that integrates single plant growth models with inter-plant competition for sun light and water.
Python
78
star
8

perception

AUTOLab perception toolkit
Python
69
star
9

yumipy

Python control interface for interacting with the ABB YuMi Robot
Python
61
star
10

FogROS

Please see FogROS 2, which is under active development and part of ROS 2. FogROS v1 (this repo) is deprecated.
Python
49
star
11

DART

Python
46
star
12

meshpy

A 3-D triangular mesh package for Python.
Python
42
star
13

ipc-graspsim

C++
35
star
14

ifl_benchmark

Interactive Fleet Learning Benchmark
Python
35
star
15

Urban_Driving_Simulator

FLUIDS is a lightweight driving simulator for benchmarking Deep Reinforcement and Imitation learning algorithms.
Python
23
star
16

dex-nerf-datasets

Datasets for Dex-NeRF: Using a Neural Radiance field to Grasp Transparent Objects
22
star
17

HIL-MT

Multi-Task Hierarchical Imitation Learning of Robot Skills
Python
20
star
18

cloth_simulation

Classes and functions related to 3D fabric simulation
Python
19
star
19

tsc-dl

Visual Transition State Clustering
Python
13
star
20

fog_x

Python
9
star
21

visualization

Visualization tools for the autolab
Python
8
star
22

RAPID

First-order agriculture simulator and datasets.
Python
8
star
23

mirage

Mirage: a zero-shot cross-embodiment policy transfer method. Benchmarking code for cross-embodiment policy transfer.
Python
8
star
24

OpenRAVE-motion-planner

Python
7
star
25

rlqp-python

Python interface for RQLP (Accelerating Quadratic Optimization with RL)
Python
6
star
26

IL_ROS_HSR

For performing various learning-based tasks with ROS-based robots.
Python
5
star
27

optimal_manipulation_simulator

generate YuMi optimal manipulation via simulation in ROS for learning 3D motion and collision avoidance
Python
5
star
28

dvrkCalibration

Python
5
star
29

fogros2-rt-x

Python
5
star
30

Traffic_Camera_Pipeline

Python
4
star
31

jointseg

Joint Segmentation of 3D Meshes
Python
4
star
32

FLSpegtransferHO

Python
4
star
33

rlqp_train

Environment and training for RQLP (Accelerating Quadratic Optimization with RL)
Python
3
star
34

LifelongLERFROS

Drivers for the insta360 cameras
Python
3
star
35

RAPID-MOLT

RAPID-MOLT: A Meso-Scale, Open-Source, Low-Cost, Testbed for Robot Assisted Precision Irrigation and Delivery.
Python
3
star
36

h264_image_transport

C++
3
star
37

caging

C++
3
star
38

xray

X-Ray: Mechanical Search for an Occluded Object by Minimizing Support of Learned Occupancy Distributions
Python
3
star
39

endoscope_calibration

This repository contains the scripts used to calibrate the endoscope stereoscopic cameras. It also contains scripts to test the calibration.
Python
3
star
40

IIFL

Implicit Interactive Fleet Learning
Python
3
star
41

Orienting_Novel_3D_Objects

Orienting Novel 3D Objects Using Self-Supervised Learning of Rotation Transforms
Python
2
star
42

RobotToolChanger

Tool-changer and tool for collaborative and service robots
2
star
43

FETCH_CORE

Python
2
star
44

bags

Website for ICRA submission on manipulating cables, fabrics, and bags.
HTML
2
star
45

exploratory-grasping

Repo for "Exploratory Grasping: Asymptotically Optimal Algorithms for Grasping Challenging Polyhedral Objects"
Python
2
star
46

RL-experiments

Experiments for RL
Jupyter Notebook
2
star
47

dvrk-vismpc

DVRK code for VisMPC + Fabric project
Python
2
star
48

metarl

Meta RL Project
Jupyter Notebook
2
star
49

masters_control

Python
2
star
50

SkillHub

Python
2
star
51

DSDR

Distributed Spectral Dimensionality Reduction (DSDR)
Scala
2
star
52

malasakit

Malasakit is a customizable participatory assessment platform that collects and integrates quantitative assessment, qualitative feedback, and peer-to-peer collaborative filtering on ways local communities can become better prepared for typhoons and floods.
Python
2
star
53

Kit-Net

Python
2
star
54

dvrk-hierarchical-control

This package is a hierarchical control package for the Da Vinci Research Kit
Python
2
star
55

FLUIDS_IL

Imitation Learning Code for The FLUIDS Simulator
Python
2
star
56

omni_master

Code for using Phantom Omnis as master controllers
C++
2
star
57

PolyPoD

Everything I'll be working on in alphagarden prefs project
Python
2
star
58

dexnet_gui

A GUI for Dex-Net based on ROS and PyQt4
Python
2
star
59

nix

Shell
1
star
60

fcgqcnn

Fully-Convolutional version of GQ-CNN
CSS
1
star
61

google_goggles_project

Cloud robotics grasping project using Google Goggles
C++
1
star
62

jester

PHP
1
star
63

ur5py

Python
1
star
64

shiv

1
star
65

HierSupCASE

HTML
1
star
66

line_cutting

This repository contains scripts used for the DVRK cutting experiments.
Python
1
star
67

gym_fluids

OpenAI Gym interface to the FLUIDS simulator
Python
1
star
68

toppling

Python
1
star
69

mplambda

Motion Planning Lambdas
C++
1
star
70

fast_grasp_detect

For supporting our IL_ROS_HSR code
Python
1
star
71

query-incentive-model

Django application to collect emails over internet and run query incentive algorithm on the code
JavaScript
1
star
72

evo-nerf-datasets

corl2022
1
star
73

FLSpegtransfer

Python
1
star
74

yumiplanning

Repo for planning/IK code for the YuMi robot
Python
1
star
75

berkeleyautomation.github.io

JavaScript
1
star
76

fogros2-examples

Examples Applications With FogROS2
C++
1
star
77

legs_ros_ws

C++
1
star