PhysicalAI Workshop

Hands-on Robotics with Minipupper V2

Li Bai

Temple University

May 2, 2026

Special Thanks to

This workshop is made possible by the generous support of:

Mangdang Robotics  |  IEEE MGA SI  |  IEEE Foundation

https://temple.short.gy/physicalAI

Mangdang

A quadruped robot dog originated from a stanford project click here

  • A Mangdang v2 and a Raspberry Pi Compute Module 4 2GB

  • software development is done using Windows 10/11 WSL
    • Linux, Python 3
  • ReInvent Workshop 2022 for Dance Robot (Gan and Hansen 2022)

System Requirements

  • One PC Windows 11 (Home edition or Professional edition)

    • windows subsystem linux on windows feature enabled
    • virtual machine on windows feature enabled
  • 32GB Micro-SD Card (flashed)

  • Minipupper V2

Agenda

flowchart LR
  A(("1. WiFi Setup")) --> B(("2. Hardware Check"))
  B --> C(("3. Dance Lab"))
  C --> D(("4. Gemini AI"))

  classDef blue fill:#1f5096,color:#fff,stroke:#333,stroke-width:2px,width:150px
  classDef red fill:#c0392b,color:#fff,stroke:#333,stroke-width:2px,width:150px
  classDef purple fill:#8e44ad,color:#fff,stroke:#333,stroke-width:2px,width:150px

  class A,B,C blue
  class D red


  click A "#method_3"
  click B "#hardware"
  click C "#dance"
  click D "#gemini"

Block Topic Time Outcome
1 WiFi Setup & Robot Activation 0:00–0:25 Robot online, web UI responsive
2 Hardware Check + ieee2026.ipynb 0:25–0:45 Camera, audio, touch verified; env ready
3 Dance Movement Lab (Jupyter) 0:45–1:20 Motion routines running from notebook
4 Gemini AI Demo (optional) 1:20–1:45 AI-driven motion demo
5 Q&A 1:45–2:00

Re-flash SD Card (Balena Etcher)

Only needed if your SD card image must be updated. Workshop SD cards come pre-flashed — skip this section during the event.

  • Check to ensure your SD card is selected to flash to SDHC, NOT your computer!

NOTE: the following step will not apply to you if you own a computer using Windows

WiFi Setup

  • Three WiFi connection options available:
    • eduroam: Enterprise WiFi using password hash (for university networks)
    • WPA2 Router: Standard password WiFi (e.g., workshop router IEEER2_5G)
    • WPA2 Hotspot: Mobile hotspot from Windows/phone

Important

Connection requirement: your laptop and the robot must be on the same network segment with peer-to-peer traffic allowed. On eduroam and many campus/enterprise networks, client-to-client communication is blocked by default — use the workshop router or a personal hotspot if the robot’s IP is unreachable from your laptop.

Generate WiFi Credential

Type SSID Password
eduroam your_email@temple.edu your password (auto-hashed)
WPA2 Router IEEER2_5G ieeer25g
WPA2 Hotspot your hotspot name your hotspot pwd (>8 chars)
  • Config file supports 3 access points: AP1 (WPA2 Router), AP2 (WPA2 Hotspot), eduroam (Enterprise WiFi)

  • Download the file as 50-cloud-init.yaml
  • Make sure the file is named 50-cloud-init.yaml
  • If your browser downloads as 50-cloud-init (1).yaml or 50-cloud-init (2).yaml, rename it to 50-cloud-init.yaml
  • Delete any old 50-cloud-init.yaml files in Downloads folder before downloading
  • make sure you see a new drive called system-boot
  • drag and drop 50-cloud-init.yaml to the system-boot drive

(Note: Image shows wireless.txt but your file should be named 50-cloud-init.yaml)

  • IP address does not show up on first time boot up, wait for power on sound, then disconnect power and reconnect

  • reboot second time, you can see the IP address

Web Control - Activate the robot

  • If you see the IP address on the screen in the second time power on, type http://[ipaddress]:8080 for a web remote control

Revise the WiFi in Jupyter Lab

  • Open a browser, type http://[ipaddress]:8888
  • password mangdang

sudo nano /etc/netplan/50-cloud-init.yaml

  • at least keep one connection working

  • 50-cloud-init.yaml is indentation sensitive, any mistake will have no IP address shown

  • If file changed, try the following commands to ensure if you have any errors before reboot

sudo netplan apply
sudo netplan generate --debug
  • may need to use an HDMI monitor and a USB keyboard to troubleshoot the YAML file

JupyterLab Interface

  • Open browser → http://<robot-ip>:8888
  • Terminal: click Other → Terminal to open a shell
  • Run a cell: Shift+Enter or click ▶ in the toolbar
  • Run all cells: Run → Run All Cells

Hardware Check

  • download the mangdang using the following command
git clone http://github.com/lbaitemple/mangdang
  • run ieee2025.ipynb

  • run camera_test.ipynb
  • you check camera by running each cell in jupyter notebook

  • run lcd_test.ipynb
  • add different pictures
  • record 5 second audio and play back
cd ~/mini_pupper_bsp/demos/
python audio_test.py 

  • use amixer to check what speaker you use
cd ~/mini_pupper_bsp/demos/
python touch_test.py
  • can you display the touch on the LCD screen
  • Use Ctrl-C to quit

How Jupyter Notebook Cells Work

Cell status indicators

Indicator Meaning
[ ] Not yet run
[*] Running — wait for it
[1], [2]… Done — execution order

Cells share a single kernel (memory)

  • Variables live in RAM for the entire session
  • A cell that ran keeps its values — no need to re-run
  • Only re-run a cell when its inputs change
  • ieee2025.ipynb setup: re-run only when credentials or packages change

Example — Shift+Enter to run each cell

# Cell [1] — run once at startup
robot_speed = 1.0        # stored in memory
HOST = get_ip_address()  # stored in memory
# Cell [2] — only re-run if speed changes
Move.move_forward(speed=robot_speed)
# Cell [*] ← still running, shows * until done
sender = SocketSender(HOST, level2)
sender.command_dance()
# Cell [3] — independent; run anytime
Move.look_left()

Tip

Run setup cells once per session. Re-run only the cell whose variable changed.

Quick Linux + Jupyter Navigation

Linux terminal basics

pwd          # show current folder
ls -la       # list files/folders
cd ~/StanfordQuadruped
# run python code
python IMU.Balancing.MP2.py  

In Jupyter notebook cells

%pwd
%ls
%cd ~/mangdang/StanfordQuadruped
%%bash
pwd
ls

Find process (server/debug)

ps aux | grep JupyterServer
pgrep -af python

Check Python interpreter

which python
python -V
python -c "import sys; print(sys.executable)"
import sys
print(sys.executable)

Tip

Use the same folder and interpreter in terminal and notebook to avoid path/package mismatch.

Inverse Kinematics

What is IK? Foot (y, z) → joint angles   \(\theta = f^{-1}(y,z)\)

  • FK: angles → position; IK: position → angles
  • Mini Pupper: 3 DOF/leg, 12 joints total

Stanford IK — law of cosines per leg:

r = sqrt(y**2 + z**2)
theta_knee = arccos((r**2 - L1**2 - L2**2) / (2*L1*L2))
theta_hip  = arctan2(z, y) - arctan2(L2*sin(theta_knee),
                                      L1 + L2*cos(theta_knee))

Frameworks on this robot

Stanford Quadruped MIT CHAMP
IK Analytical (geometry) Analytical (geometry)
Control Python, Jupyter ROS 2
Interface MovementGroup.py URDF + controllers
Use here ✅ Dance & Tug-of-War reference only

Stanford - Dance Move using Jupyter

1 — Clone & start server

mkdir -p ~/mangdang && cd ~/mangdang
git clone -b lcd https://github.com/lbaitemple/StanfordQuadruped
cd StanfordQuadruped
python src/JupyterServer.py   # run once; keep running

Branches: mini_pupper · lcd · tug

2 — Open notebook: Jupyter Client / Jupyter Client for Mini Pupper.ipynb

3 — Define move list & run

from Command_Sender import SocketSender
level1 = ["Move.look_right()", "Move.look_upperleft()", "Move.stop()"]
level2 = ["Move.head_move(20,0,0.5,0.5)", "Move.height_move(0.02,1,0.5)",
          "Move.gait_uni(0.3,0)",
          "Move.foreleg_lift(leg_index='left',ht=0.03,time_uni=0.2,time_acc=0.5)"]
level3 = ["Move.head_ellipse()", "Move.body_cycle()", "Move.stop()"]

sender = SocketSender(HOST, level2)   # swap list to change routine
sender.command_dance()

Dance Lab — Threads & Demo

4 — Run dance + LCD face simultaneously

import threading
from MangDang.LCD.ST7789 import ST7789
from PIL import Image

def show_face(image_path):
    disp = ST7789()
    img = Image.open(image_path).resize((320, 240))
    disp.ShowImage(img)

t1 = threading.Thread(
    target=lambda: SocketSender(HOST, level2).command_dance())
t2 = threading.Thread(
    target=show_face, args=("happy_face.png",))
t1.start(); t2.start()
t1.join();  t2.join()

Tip

Both threads run independently — robot moves and shows expressions simultaneously.

Gemini AI

  • download the code:
cd ~
git clone -b physicalAI https://github.com/lbaitemple/apps-md-robots
cd apps-md-robots
sudo apt install -y libgl1 portaudio19-dev 
pip install -r requirements.txt  --break-system-packages
  • add credential file (Pregenerated)
mkdir -p ~/.gemini
cp ~/minipupper_creds.json ~/.gemini/creds.json
cp env.sample .env
  • Run the app
python ai_app/ai_app.py 
  • Reset LCD screen to show IP
sudo systemctl restart robot  

Appendix

RPi camera Setup

camera

cable

open board connector

close board connector

complete setup
Gan, Afreez, and Matt Hansen. 2022. “Dance of the Cloud Connected Robots.” 2022. https://github.com/lbaitemple/StanfordQuadruped.