fogros2 repository

Repository Summary

Checkout URI
VCS Type git
VCS Version humble
Last Updated 2024-04-28
CI status No Continuous Integration
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)


Name Version
fogros2 0.1.7
fogros2_examples 0.1.7



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.



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.

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

git clone -b humble
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
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 ..


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
aws configure

source /opt/ros/<your-ros2-distro>/setup.bash
mkdir -p ~/fog_ws/src
cd ~/fog_ws/src
git clone -b humble
cd ../
colcon build  # re-build the workspace
source install/setup.bash

Launch ROS 2 computational graphs in the cloud

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

(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.)


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

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* 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 Your installation should still work.
  2. [WARN] [1652044293.921367226] [fogros2.scp]: [Errno None] Unable to connect to port 22 on, 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: This warning is often seen when installing packages on the cloud instance, but can be ignored.
  4. docker: permission denied... . Depending on your permissions, you may need to run docker commands with sudo.

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.


[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.


No found.