Skip to content

NirajPatelRobots/simplewalker

Repository files navigation

Simplewalker

A two-legged walking robot

A raspberry pi zero, the Main Computer, calculates state, balance and dynamics. A pi pico is the low level motor controller and sensor reader.

Download Instructions

Download the repo to a raspberry pi zero (or another SBC).

Requirements:

  • C++ 17
  • cmake 3.23+
  • Eigen 3.4.8
  • python 3.11
    • main computer requires pyserial
    • base python dependencies handled by uv
  • rapidxml
  • googletest 1.17 (installed by cmake)
  • wiringPi (apt-get install libwiringpi-dev to build on ubuntu)
  • MPU6050 pico code: https://github.com/NirajPatelRobots/pico-examples

To develop for pico on a non-pi computer: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

Microcontroller Instructions

  1. To develop for pico on the Zero, go to https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf Chapter 1 "Quick Pico Setup"

  2. In the microcontroller/ directory, build the pico program:

    mkdir microcontroller/build
    export PICO_SDK_PATH=~/pico/pico-sdk/
    cp ~/pico/pico-sdk/external/pico_sdk_import.cmake microcontroller/
    cd microcontroller/build
    cmake ..
    make
    
  3. Unplug the pico, then hold down the BOOTSEL button on the pico. Plug in the pico and keep the button held down until the green light on the zero stabilizes.

  4. Check the pico is connected, then load the built .uf2 file onto the pico:

    sudo picotool info -a
    sudo picotool load <name>.uf2 -v -x
    

To read output from printf, use USB. Can change to UART in CMakeLists.txt. minicom -b 115200 -o -D /dev/ttyACM0 to listen to the output. To exit minicom, use CTRL-A followed by X.

Single Board Computer instructions

In the simplewalker/build folder of the repository, run

cmake ..    # once, to set up cmake
make simplewalker 
cd ..
build/simplewalker

to make and run the main program.

The built executables are simplewalker, test_localization, unittests, and collect_sensor_cal_data.

Calibration

IMU Calibration

collect_sensor_cal_data saves files in data/stationary_calibration_[number].log. Copy these to the base computer and run sensorAnalysis.py on them to get sensor calibration values.

Motor Calibration

  • To collect motor calibration data, run python3 runMotorCalibration.py on the main computer (SBC).
  • Copy that data to the Base computer with rsync -zic pi@raspberrypi:/home/pi/simplewalker/data/*.motortest ./data/.
  • To run the calibration and get motor parameters, run uv run --extra calibration calibrate/calibrate.py [file_glob]
  • To run the interactive calibration with a UI, run uv run --extra interactive_calibration calibrate/interactive_calibrate.py
  • To run the motor calibration as a notebook, run uv run -w jupyter -w ipympl --extra interactive_calibration jupyter lab

CI

Build Simplewalker and Build Simplewalker Microcontroller jobs do what it sounds like they do. Build Simplewalker also runs unit tests and test_localization, which is printed to job results.

Calibrate Motor runs motor calibration on checked-in motor test data and prints results to job results.


Niraj made this

About

Two-legged walking robot (Work in Progress)

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors