Robot Control using Raspberry Pi

Lecture 2 - AWS Academy Robomaker

Li Bai

Temple University

September 9, 2023

Mangdang

A quadruped robot dog originated from a stanford project click here

  • software development is done using AWS Robomaker and AWS Cloud 9
    • Virtualization, Docker, Linux, Python 3
    • Robot Operating System (ROS) and Gazebo
  • ReInvent Workshop 2022 for Dance Robot (Gan and Hansen 2022)

AWS RoboMaker Workflow

Note

  • Simulation in Robomaker (or DCV) using Gazebo (simulation_ws)
  • Deployment using IoT Greengrass 2.0 (robot_ws)
  • Docker container registry (contain OS integrity)
  • Cloud storage (S3 - Simple Storage Services)

AWS Greengrass Deployment Process

Note

  • container can run a complete different OS than robot OS (x86 and arm64)
  • container deployed from AWS ECR
  • message call from MQTT bridge

Github

  • What is a Github?

  • How to signup a Github account

    Github Signup

  • How to create a repository and document in README.md

  • How to clone a repository

https://github.com/ros2/demos/tree/foxy

Add your name in the msg (line 46) - will be used later classes

https://github.com/ros2/demos/blob/foxy/demo_nodes_cpp/src/topics/talker.cpp

MinPupper AWS

  • using Robomaker (minimum access in terminals - long setup time, but more computing process)
  • using DCV (multiple terminal windows - short setup time)

MiniPupper AWS Dancing Robot

Note

Follow the instruction on Github(Gan and Bai 2022)

git clone -b ros2 http://github.com/lbaitemple/mini-pupper-aws
  • A Cloud 9 Approach
  • c4.xlarge (7.5vPU and 4GB)
  • A Robomaker approach using AWS Docker Container Registry
  • 15 vCPU core

MiniPupper AWS Dancing Robot

  • Cloud 9 terminal
  • copy and past one line at a time
cd mini-pupper-aws/simulation_ws
cd src && vcs import < .minipupper.repos --recursive && cd ..
pip install Inject==3.5.4 setuptools==58.2.0
sudo apt install python3-rosdep2 -y
rosdep update
rosdep install --from src -i -y  --skip-keys=ecl_threads
colcon build
  • Cloud 9 terminal using the following commands
cd mini-pupper-aws
docker build . -t mini-pupper-base:2.0 -f Dockerfile-Base
docker build . -t mini-pupper-simulation:2.0 -f Dockerfile-Simulation

MiniPupper AWS Dancing Robot

  • Open three Cloud 9 terminals and run the following command in each terminal
export DISPLAY=:0
bash ../scripts/simulation-entrypoint.sh
  • easy way then use AWS ECR on AWS console (mini-pupper-simulation)
aws ecr create-repository --repository-name mini-pupper-simulation | grep repositoryUri
  • skip step 2, and remove latest with 2.0, and replace 169615523284 with your account number
docker tag mini-pupper-simulation:2.0 169615523284.dkr.ecr.us-east-1.amazonaws.com/mini-pupper-simulation:2.0
docker push 169615523284.dkr.ecr.us-east-1.amazonaws.com/mini-pupper-simulation:2.0

MiniPupper AWS Dancing Robot

  • Cloud 9 terminal 1
source ./install/setup.bash
ros2 launch mini_pupper_gazebo gazebo.launch.py rviz:=false
  • Cloud 9 terminal 2
sudo apt-get install -y ros-humble-teleop-twist-keyboard
  • Go to AWS Robomaker in AWS console

  • Go to robomaker setup click here

  • setup simulation job using the robot application and simualtion application from AWS ECR docker instances

GAZEBO_MASTER_URI=http://ROBOMAKER_SIM_APP_IP:11345
ROS_IP=ROBOMAKER_SIM_APP_IP
ROS_MASTER_URI=http://ROBOMAKER_ROBOT_APP_IP:11311
  • Add tool window, set Name to xterm, and Command to /usr/bin/xterm

MiniPupper AWS Dancing Robot

  • Cloud 9 terminal 3
source /opt/ros/humble/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard
  • check the dog in the move
  • open simulation job
  • open xterm app
./move.sh

DCV Gazebo

DCV Gazebo - Move Minipuuer

Robomaker Setup

Robomaker Setup Applications

- give a name mini-pupper-simulation-app

Robomaker Setup Simulation Application

Robomaker Simulation Application Options

ros2, launch, mini_pupper_gazebo, gazebo.launch.py, rviz:=false

GAZEBO_MASTER_URI
http://ROBOMAKER_SIM_APP_IP:11345
ROS_IP
ROBOMAKER_SIM_APP_IP
ROS_MASTER_URI
http://ROBOMAKER_ROBOT_APP_IP:11311

Robomaker Simulation Add tools

/usr/bin/xterm

Robomaker Simulation Application Options

AWS Robomaker Excercise*

  • Create a new cloud 9 instance
  • Follow the steps in the readme.MD file or “Activity 2” in workshop(Gan and Hansen 2022)
  • setup three melodic docker instances as described
  • setup the simulation as shown in the processs
  • show to find out the docker image
  • show where is the docker image store in ECR?
  • show the robot dog moves

When you submit a report, please include the corrected procedures and give the screen shots based on the checkoff.

Preparation for next week’s class

References

Gan, Afreez, and Li Bai. 2022. “MiniPupper AWS - ROS1.” 2022. https://github.com/lbaitemple/mini-pupper-aws.
Gan, Afreez, and Matt Hansen. 2022. “Dance of the Cloud Connected Robots.” 2022. https://catalog.us-east-1.prod.workshops.aws/workshops/511d7599-73bd-4142-bd6b-fa83dbe3d8ce/en-US.
Robots, Building Cloud Connected. 2021. “Building Cloud Connected Robots.” 2021. https://catalog.us-east-1.prod.workshops.aws/workshops/fa208b8e-83d6-4cc1-8356-bfa5b6184fae/en-US.