GubiLabsAcademy

MODULE 05 / DIGITAL WORKSHOP

Your software workbench

Create a separate course workspace, run a small Python calculation, deliberately fix an error, and save a version with Git. Learn the tools needed for later simulation labs.

120–180 min6 lab steps3 knowledge checks In progress

By the end, you can…

  • Explain a terminal, interpreter, package and virtual environment.
  • Run a Python file using the intended interpreter.
  • Inspect and reverse a small code change using version control.
BRING WITH YOU

Forces, units & motion

EXPLORE THE PROCESSA digital robot is built from evidence.
STEP 1

Physical robot

Measure lengths, mass, joint axes, mounting offsets and materials. Record uncertainty.

The process loops: measurements improve the model. Exporting a mesh supplies shape, but does not automatically supply correct joints, inertia or control settings.
01

The terminal is a place to name actions precisely

Finder or File Explorer lets you navigate by clicking; a terminal lets you name a program and its inputs. Every terminal has a current working directory. A relative path is interpreted from there, while an absolute path identifies a location from the filesystem root. Many “file not found” errors are correct filenames used from the wrong directory.

A command is not Python just because you are working on a Python project. Shell commands start programs. Python code runs inside the interpreter or a .py file. Copy code into the right place, and read what it will create or modify. The examples below create a separate learning folder, leaving the reference robot files available for comparison.

02

Keep one interpreter and its packages together

The Python interpreter executes your code. Packages supply additional capabilities such as physics simulation or graphing. A virtual environment gives a project its own package directory and interpreter entry point. It prevents an unrelated project’s upgrade from silently changing your simulation environment.

This course targets Python 3.12 and later pins the simulation packages to the tested versions. The official uv tool can install a current Python 3.12 build and create an environment. It uses Astral’s Python distributions; it is not the Python.org installer. If Python 3.12 is already available, it can create the environment directly. Record the actual patch version rather than assuming it matches another computer.

03

A few programming ideas go a long way

A variable gives a value a name. A list stores an ordered collection. A loop repeats an operation for its members. A function groups a calculation so it can be reused with different inputs. We will use these to calculate loads, run comparable experiments and save results. You do not need to become a general software engineer before running the first lab.

An error traceback is evidence. Read the final error description, then find the relevant line in your own file. A misspelled name, missing package and missing input file are different problems. Changing several unrelated things at once makes diagnosis harder. Fix one suspected cause, rerun, and keep the new output.

04

Save a state you can return to

Git records selected file changes as commits. A commit is a snapshot with a message; a branch is a movable name for a line of commits. GitHub can host a repository, but local Git work does not require publishing anything. A downloaded ZIP is useful source material without necessarily being a Git working copy.

Keep source code and compact notes in version control. Exclude your virtual environment and generated bulk output. Before restoring a file, inspect the difference so you know which uncommitted changes will be discarded. Use this habit on your learning files before touching a large robot project.

The command git diff displays differences in your tracked files so you can inspect your edits. The command git restore filename normally replaces that file’s working copy with its staged version, or the last committed version when nothing is staged. Uncommitted edits to that working copy can be discarded. Reading a diff does not create a backup, so save any experiment you want to keep before restoring.

WORDS YOU NOW KNOW

Interpreter
The program that executes Python code.
Dependency
A package or tool a program needs to run.
Commit
A recorded snapshot of selected repository changes.
Working directory
The folder from which relative paths are interpreted.

YOUR CALL

Finished with this module?

0 of 6 lab steps checked. 0 of 3 questions answered. You decide when the module is complete. Revisiting or editing it will not change your decision.

You can reopen it later. Checking every box will not automatically complete it.

Go to the source

Primary references for this module. Use the version and hardware revision named in the lesson.

Python virtual environmentsInstalling uvPython versions with uvGit tutorial