1 of 9

Lab 1: ROS Introduction and PD Control

Ankush

CS 123

2 of 9

Course Website

Strongly recommend bookmarking this!!

2

3 of 9

Deliverables

All deliverables are marked in bold. Keep these in mind as you progress through the lab, taking videos as you complete milestones

    • Once you are done, upload all deliverables (outlined in Lab document) to Gradescope in a pdf file
      1. Lab Document answers
      2. Videos (uploaded to Google Drive, provide link in the write-ups. Remember to share view access!)
    • In the lab document, link a GitHub contained your completed code for the lab. Share this with JC and Ankush (your fork)

3

4 of 9

Checklist

  • Battery
  • Charger
  • Pi
  • Top frame
  • Bottom frame
  • Hdmi
  • Motor 1 + wire
  • Speaker
  • Pcb holder
  • Wires cover
  • Screen
  • Stand
  • Stand base -> m2.5x15 (dif screw - can damage robot)
  • Pi cooler
  • Internet cable (not yet available for all groups)
  • Control board wire
  • Screwdriver
  • Ethernet adapter

4

5 of 9

Battery Safety

We use 20V Lithium ion batteries for Pupper, which are often used with power tools

  1. The batteries will last ~45 minutes. Switch out the battery every 45 minutes to prevent any damage to the battery or Pupper
  2. Don’t plug in the battery into Pupper until it is fully assembled
  3. Keep an extra battery charging so that you dont have to wait while working on the robot
  4. If actuators go limp, that indicates that the battery is low

5

6 of 9

Dev Tools and Environment

  • Gather all material
    1. Assembled Lab 1 Hardware Kits
    2. Monitor Setup (Screen, keyboard, mouse)
    3. HDMI cable (micro HDMI port on the robot)
    4. plug in the usb boot drive (Ubuntu 24.04 inside)
  • Install all prereqs, listed in the lab spec
    • The Raspberry Pi and USB drive will come with all prereqs installed
    • If something is not working for you, ask a TA
    • Connect to the WiFi - use Stanford networks
  • Once you have connected to wifi, then you can connect over SSH
    • Different hostnames per group (pupper1, pupper2, etc.)
  • Install and use VSCode

6

7 of 9

ROS Overview

We use ROS2 (Robot Operating System 2) for all controlling the Pupper in this class

    • Provides tools, libraries, and conventions that allow different parts of a robot (like sensors, actuators, and decision-making systems) to communicate with each other.
    • Creates publishers and subscribers to send message data between nodes
    • Launch files allow you to start up and configure a number of executables containing ROS 2 nodes simultaneously

7

8 of 9

Lab Overview

  1. For lab today, we will need to connect the Puppers to wifi, so use Option 2 on Part 0 Setup
  2. Experiment with basic controllers
    1. Bang-bang controller
    2. PD control
      1. Loop Rates
      2. Periodic Motion
      3. how delays affect PD control

2. If you finish early, try more advanced topics:

a. PID control

b. leader-follower setup (manually dial one joint, while the other joint follows this leader joint via PD control)

8

9 of 9

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

Thank you, and have fun!

Due date on gradescope

9