1 of 15

Lab 5: Follow me Pupper

CS 123 Team

CS 123

2 of 15

Let’s make Pupper See!

CS 123

3 of 15

Fisheye lens

  • Pupper is shipped with a (not very good) fisheye lens
  • Very wide view
  • Very hard to detect april tags & run YOLO reliably due to distortion (painful experience from past quarters)
  • No infrared blocker (by default camera looks weird)

3

4 of 15

Image Unwarping & Post-processing (implemented for you!)

  • Implemented in robots/fisheye_converter.py
    • Makes image rectangular, filters out infrared color
  • Should make vision-based final projects more feasible 😉

4

Before Infrared Filter

After Infrared Filter

5 of 15

Lab Overview

We have implemented for you:

  1. A yolo-seg object detector that runs on board on Pupper

​

Your Job:

  1. Tune a P controller to have Pupper track you as you move!
    1. We call this method visual servoing
  2. Implement a state machine for tracking and searching
  3. Let Pupper follow the same person by the optical flow assumption
  4. Let Pupper remain a polite distance with you (so it doesn’t hump into you when close)
  5. Follow the same person more accurately with segmentation mask (optional)
  6. Walk around obstacles when chasing a person (also optional)

5

6 of 15

State Machines

  • State machines are a way to define states and transitions, and are very common in robotics
    • especially in decision making

6

Credit: DALL-E

States:

  • walking
  • stopped

​

Transitions:

  • object detected
  • free path

7 of 15

The State Machine in Lab 5 (main part)

  • Quiz 2 will ask you to draw this
  • Very important to understand (for lab 6 too!)

7

8 of 15

Breakpoint Tutorial

  • Open pdb with breakpoint()

​

​

​

​

​

​

​

Common pdb commands: p (print), c (continue), s (step), n (next line)

ctrl + d (or exit) to quit

Reference: https://kapeli.com/cheat_sheets/Python_Debugger.docset/Contents/Resources/Documents/index

​

8

9 of 15

Stepping through ROS Messages

  1. ROS messages typically have a BUNCH of fields
    1. Reference each file using the dot syntax
  2. View ROS message documentation

​

​

​

msg

​

​

detections

​

​

data

​

​

[i]

​

​

detection

​

​

bbox

​

​

Pose2D

​

​

center

​

​

x

​

​

indicates a field of the left side object

​

​

9

10 of 15

When you have two (or more) People in the Box…

How do you make sure you’re tracking the same person?

10

11 of 15

Small Motion Assumption in Optical Flow

Solution: You keep the last tracking position, and return the detection closest to that

11

12 of 15

But… Can we do Better? (optional)

  • Yolo-seg also includes segmentation mask!
    • With the masks’ mean (r, g, b) given in detections
  • Use the mean color of segmentation masks to identify different people!

​

12

In practice… After 3+ hours of debugging by Wenhao, Jie, and me, it worked like a charm at Jie’s house—only to fail spectacularly during our demo for Stuart at his house. 🫠

13 of 15

Poor Man’s Obstacle Avoidance (optional)

13

14 of 15

Safety Tips

Please ask the TAs if you have any questions, and come to OH if you need help/more time

​

Thank you, and have fun! ;)

​

  1. Don’t test the robot on the table, test on the ground
  2. Make sure to replace your battery often and keep a spare charging (these vision and API calls drain batteries quickly)
  3. EXTREMELY IMPORTANT:
    1. Work with low tracking velocity first
    2. Have Control-C (or a person to shut down Pupper) all the time
    3. NEVER guide your Pupper into walls/ stairs

​

14

15 of 15

Final Project Logistics

  • General Logistics will be updated shortly; you will need to submit
    • Project proposal & Discussion with (at least) one member of the teaching team (20%)
    • Progress report (20%)
    • Final Demo Video (20%)
    • Final Demo Day Presentation (30%)
    • Blog Post and Project Codebase by final time (10%)
  • Brainstorm about final project ideas, and talk to us (you can get a sneak peak at lab 6 too, things are still getting modified) 😎

15