• Stars
    star
    1,458
  • Rank 32,260 (Top 0.7 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Stanford Quadruped

Overview

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

Pupper CC Max Morse

Video of pupper in action: https://youtu.be/NIjodHA78UE

Project page: https://stanfordstudentrobotics.org/pupper

Documentation & build guide: https://pupper.readthedocs.io/en/latest/

How it works

Overview diagram The main program is run_robot.py which is located in this directory. The robot code is run as a loop, with a joystick interface, a controller, and a hardware interface orchestrating the behavior.

The joystick interface is responsible for reading joystick inputs from a UDP socket and converting them into a generic robot command type. A separate program, joystick.py, publishes these UDP messages, and is responsible for reading inputs from the PS4 controller over bluetooth. The controller does the bulk of the work, switching between states (trot, walk, rest, etc) and generating servo position targets. A detailed model of the controller is shown below. The third component of the code, the hardware interface, converts the position targets from the controller into PWM duty cycles, which it then passes to a Python binding to pigpiod, which then generates PWM signals in software and sends these signals to the motors attached to the Raspberry Pi. Controller diagram This diagram shows a breakdown of the robot controller. Inside, you can see four primary components: a gait scheduler (also called gait controller), a stance controller, a swing controller, and an inverse kinematics model.

The gait scheduler is responsible for planning which feet should be on the ground (stance) and which should be moving forward to the next step (swing) at any given time. In a trot for example, the diagonal pairs of legs move in sync and take turns between stance and swing. As shown in the diagram, the gait scheduler can be thought of as a conductor for each leg, switching it between stance and swing as time progresses.

The stance controller controls the feet on the ground, and is actually quite simple. It looks at the desired robot velocity, and then generates a body-relative target velocity for these stance feet that is in the opposite direction as the desired velocity. It also incorporates turning, in which case it rotates the feet relative to the body in the opposite direction as the desired body rotation.

The swing controller picks up the feet that just finished their stance phase, and brings them to their next touchdown location. The touchdown locations are selected so that the foot moves the same distance forward in swing as it does backwards in stance. For example, if in stance phase the feet move backwards at -0.4m/s (to achieve a body velocity of +0.4m/s) and the stance phase is 0.5 seconds long, then we know the feet will have moved backwards -0.20m. The swing controller will then move the feet forwards 0.20m to put the foot back in its starting place. You can imagine that if the swing controller only put the leg forward 0.15m, then every step the foot would lag more and more behind the body by -0.05m.

Both the stance and swing controllers generate target positions for the feet in cartesian coordinates relative the body center of mass. It's convenient to work in cartesian coordinates for the stance and swing planning, but we now need to convert them to motor angles. This is done by using an inverse kinematics model, which maps between cartesian body coordinates and motor angles. These motor angles, also called joint angles, are then populated into the state variable and returned by the model.

How to Build Pupper

Main documentation: https://pupper.readthedocs.io/en/latest/

You can find the bill of materials, pre-made kit purchasing options, assembly instructions, software installation, etc at this website.

Help

More Repositories

1

Pupper

Build instructions and code documentation for the Stanford Pupper project.
53
star
2

Pupper-Raspi-PDB

28
star
3

PS4Joystick

Collection of methods of using a PS4 controller with UDPComms
Python
23
star
4

DJIC610Controller

A Teensy 4.0 Library (Arduino) to control the DJI C610 motor controllers. These controllers pair with the M2006 brushless gear motor to make a moderately transparent, high torque-density actuator.
C++
21
star
5

fusion360EquationCurve

Python
15
star
6

PupperKeyboardController

Pygame-based keyboard controller for Stanford Pupper
Python
13
star
7

PupperCommand

Python
12
star
8

pupperv3-independent-study

Course materials
12
star
9

UDPComms

This is a simple library to enable communication between different processes (potentially on different machines) over a network using UDP. It's goals a simplicity and easy of understanding
Python
12
star
10

rover_drive_controller

An experimental CANopen-based ROS motor controller for the Stanford Mars Rover
C++
7
star
11

RoverCam

Streams camera data from the rover over the UDP network
Python
6
star
12

stanfordroboticsclub.github.io

Stanford Student Robotics Website
HTML
6
star
13

RoverODrive

Uses an RPi as a bridge between udp messages and serial sent to an oDrive
Python
6
star
14

Pupper-V2-Interface

Python
5
star
15

uSlam

Python
5
star
16

RepositoryGuide

Contains a description of some of our modules
4
star
17

LTC2440ArduinoLibrary

Teensy/Arduino library for reading data from the LTC2440 24-bit high resolution ADC
C++
4
star
18

QuadrupedController

A library to control 12dof, position-based quadruped robots.
Python
4
star
19

PupperSimulatorInterface

3
star
20

boat-autonomy

Code for autonomy for boat project
Python
3
star
21

AttitudeEstimators

Python
3
star
22

RemoteVPN

Allows to connect to the robot from anywhere in the world
Shell
3
star
23

Cart-Pole-Simulation

Python
3
star
24

Pupper-pdb

Pupper power distribution board
3
star
25

PupperIMU

C++
3
star
26

arm-blender

Use Blender to control a robotic arm
Python
2
star
27

reacher-lab

Python
2
star
28

IntroWorkshops

Jupyter Notebook
2
star
29

rover_viz

A collection of packages to read from the sensor board and display the data
C
2
star
30

LidarUDP

Publishes UDP packets with data from an RPLidar
Python
2
star
31

RoverArm

Python
2
star
32

minislam

Particle filter based slam for teaching purposes
Python
1
star
33

rover_arm_controller

A repository for managing arm URDFs and code for arm manipulation
Python
1
star
34

RoverAutonomous

Makes Rover smart
Python
1
star
35

Swarm

Python
1
star
36

DoggoCommand

Python
1
star
37

karel-pupper-api

Python
1
star
38

UDPComms-Arduino

C++
1
star
39

RoverAruco

Python
1
star
40

RoverGPS

Publishes the rover's GPS location to the UDP network
Python
1
star
41

independent-study-lab2

C++
1
star
42

clover_auto

Autonomous code written for URC 2018 in literally one night by Stanford Robotics
CMake
1
star
43

DynamixelPupper

C++
1
star
44

RoverCommand

Package used to send commands to the Rover
Python
1
star
45

RoverVision

Visual perception tasks on the rover.
Python
1
star
46

RoverPCB

Collection of KiCad PCB projects for the rover
1
star