Skip to content
Snippets Groups Projects
user avatar
m-guberina authored
7c167ccc
History

Intro to intro

These tutorials will cover some of the basics of the software stack typically used in robotics engineering (Linux, Python), and my library for robot control.

The tutorials are meant to be bare-bones and used just to get your feet wet. The idea is to introduce the absolute minimum number of concepts, and to empower you and inspire you to learn the rest as you go.

The intended audience are mechanical engineering students at Lund university/LTH. This translates to assuming experience in programming and to knowing bachelor level engineering mathematics (calculus, linear algebra etc). The primary purpose is to get students up to speed with the software needed for student projects, but they can be used for anyone who wants to get started with the mentioned topics or see what they're about.

The videos are separated so feel free to skip the parts you're familiar with. I do recommend watching or at least skipping though all of them to ensure you know the specifics.

In particular we will cover,

1. Linux, CLI basics


  1. why Linux - 1 video
    • no other option
    • open source
    • is the best: fastest and most robust
    • OS itself is customizable for a task
    • can be server - example: ai training
    • can be raspberry pi - example: chalmers car
  2. Linux as a daily driver - 1 bonus video
    • blazing fast: example - old hardware
    • easily customizable: distributions
    • pretty: r/unixporn, wal color changing
    • tailor-made workflows (ex. no mouse like my setup)
    • random cool stuff: kde connect
  3. GNU/Linux system outline, terminology - 1 video
    • users (root vs other)
    • package manager
    • absolute and relative paths
    • everything is a (text) file
    • terminal emulator
    • shell
  4. CLI most basic commands
    • sudo
    • apt - example update and install htop
    • ls
    • --help - example: use ls -l
    • cd
    • pwd
    • grep
    • empowerment points:
      • example reading error messing (bad install)
      • man
  5. Docker - 1 video
    • basically Linux virtual machines
    • but can be combine with the host (internet access, memory,...) -> VERY fast
    • images vs containers
  6. advanced basics: - 1 bonus video
    • piping
    • forming a script
    • using git (cloning, add, commit, push, pull (example in docker)) - 1 bonus video
  7. networking - 1 bonus video, needed for robot control
  8. vim - bonus
    • just do vimtutor and look at my keystrokes
    • :help something is very well written and useful
    • vim - editing at the speed of thought is book if you want to be an expert

2. Python - basics, key packages


  1. basic facts - 1 video
    • made for quickly writing short code and prototyping (fast for user)
    • very slow (for the computer)
    • strong dynamic typing
    • no compilation
    • executes one command at a time
    • huge number of available packages
  2. script vs shell + jupyter-notebooks
  3. variables
  4. types
  5. built-in data structures:
    • list (dynamic linked list)
    • dictionary (key-value hashmap)
  6. loops
    • for
    • iterators
    • while loop
  7. functions
    • chunk of code to be reused
    • input/output (API) NOT ENFORCED
    • lists are ONLY PASSED BY REFERENCE
  8. classes
    • associations of data and functions
    • have some predefined functions like init, hash, str, ge,...
    • only public atributes
  9. many many more things
    • list comperhensions (actually show)
    • sockets
    • multithreading (not real due to GIL) and multiprocessing (real)
    • IPC
    • decorators
  10. numpy - 1 video
    • wrappers around fast c code
    • vectorization into real arrays
    • arange
    • linspace
    • basic math
    • matrix multiplication
    • matrix inversion
    • many many more
  11. matplotlib
    • plotting numpy arrays
    • completely intuitive for basics, can get weird otherwise
  12. openCV - 1 video just for this
    • open up the laptop camera
    • open up ip_webcam over LAN
    • show some basic transformations like negative
    • show classic object detection example in action
    • show yolov4 in action
  13. scipy - go over - 1 video, other libraries
    • many many things
    • linear algebra
    • optimization
    • regression
    • ...
  14. other noteworthy packages
    • sympy
    • scikit-learn for classic ML
    • pytorch for neural networks
    • pandas for tables (eats SQL, Excell, csv no problem)
    • yolo-v8 - the end all be all of CNN based object detection
    • control - classic control

3. Simple Manipulator Control - overview, code, usage examples


  1. basic info - 1 video
    • alternative to ros (less generalization, less code, more math)
    • intended users are mechanics engineering students, i.e. people strong in engineering math, but no necessarily software engineering
    • exposes the math
    • nearly exclusively based on reading the state and sending speed and torque commands
  2. Simple Manipulator Control - 1 video
    • pure python, will get rewritten to C++ with python bindings in the future
    • atm only UR5e is supported, but other robots will be added
    • every parameter is an argument
    • RobotManager
      • handles I/O with the robot for you
      • manages pinocchio in step()
      • just call step and use getters
    • ControlLoopManager
      • first show the math, explain partial, then go into ControlLoopManager
      • does book-keeping around your control loop math
      • ensures timing is right
      • manages real time visualization and plotting
      • handles killing of the program
    • visualization
      • meshcat server, handled by separate process
    • real-time plotting
      • matplotlib base, handled in separate process
      • can plot whatever vectors you give it, just send an example in a dictionary
    • logging
      • select what you want to track by providing an example dictionary
      • saves the entire run (dictionary of vectors) as a pickle, along with the pickle of the arguments used
  3. pinocchio - 1 video
    • look at their documentation, do their tutorials if you want more
    • data and model
    • load robot as urdf
    • lie algebra
    • body vs space frames
    • cheatsheet overview
    • forwardKinematics
    • just mention dynamics calls
  4. clik math - 1 video
    • write the equations down
  5. clik in code
    • just go over the code and explain it line by line
  6. all examples run in the robotlab --> need help to film that

4. project management


  • introduction
  • git tutorial