Skip to content

Task 0 — Instructions


If Ubuntu 22.04 is already on the machine, skip to step 2.

ResourceLink
Download ISOubuntu-22.04.5-desktop-amd64.iso
Installation walkthroughInstall Ubuntu Desktop — Canonical

Follow Canonical’s tutorial screen by screen. One choice in it matters for this theme: take Normal installation, not Minimal.

Then confirm the version:

Terminal window
lsb_release -a

Release must say 22.04 and Codename must say jammy. Anything else and you are on an untested setup — the versions of Python and the system libraries differ, and e-Yantra cannot support it.

Finally, update the fresh system:

Terminal window
sudo apt update
sudo apt upgrade

MuJoCoMulti-Joint dynamics with Contact — is the physics engine that runs the maze. This theme uses MuJoCo 3.11, installed through its official Python bindings.

Ubuntu 22.04 ships Python 3.10, which is what this theme uses. You only need pip:

Terminal window
sudo apt update
sudo apt install python3-pip
Terminal window
python3 --version # 3.10.x
pip3 --version

Install the exact version — not the latest:

Terminal window
pip3 install mujoco==3.11.0

Check the version Python reports:

Terminal window
python3 -c "import mujoco; print(mujoco.__version__)"

It must print 3.11.0. Then open the interactive viewer:

Terminal window
python3 -m mujoco.viewer

A window should open with an empty scene, a grid floor, and the control panels down the left side. Dragging with the mouse should orbit the camera.

To confirm the physics engine itself is stepping — not just the window drawing — open the Simulation panel on the left and use its pause/play button (the space bar does the same). The simulation time next to it should climb while it is running and freeze the moment you pause. If the window opens but that clock never moves, the viewer is up but the engine is not stepping.


MQTT is the messaging layer between your code and the simulation. You need two pieces: the broker that routes messages, and the Python client your code will use.

Mosquitto is the broker this theme uses:

Terminal window
sudo apt update
sudo apt install mosquitto mosquitto-clients

The service starts on install. Confirm it, and make it start on every boot:

Terminal window
systemctl status mosquitto
sudo systemctl enable mosquitto

Active: active (running) is what you want. Press q to exit the status view.

This needs two terminals. In the first, subscribe to a test topic and leave it running:

Terminal window
mosquitto_sub -h localhost -t eyrc/pacbot/test

In the second, publish to the same topic:

Terminal window
mosquitto_pub -h localhost -t eyrc/pacbot/test -m "hello pacbot"

hello pacbot should appear in the first terminal straight away. A publish that returns silently while the subscriber prints nothing means the broker is not running — check the status command above.

Terminal window
pip3 install paho-mqtt
Terminal window
python3 -c "import paho.mqtt.client; print('paho ok')"