🤖 ROS 2 robot setup and local Ubuntu Desktop image generation for Raspberry Pi 5
QUESTiX publishes setup and image-generation scripts. Each user obtains an official Ubuntu Desktop image and generates their own Pi 5 SD image locally; this repository does not build, validate or distribute completed OS images through GitHub Actions. See Pi Desktop イメージ生成ガイド.
- Target: Desktop/laptop development machines
- OS: Ubuntu 24.04 LTS with ROS2 Jazzy
- Tools: Full desktop environment, development tools, ROS2 Desktop
- Workspace: Shell aliases pre-configured for
~/ros2_ws
- Target: Raspberry Pi 5 robotics projects
- OS: Ubuntu 24.04 LTS with ROS2 Jazzy
- Hardware: GPIO, I2C, SPI interfaces pre-configured
- Tools: Robotics libraries, hardware abstraction layers
- Workspace: Pre-configured
~/robot_ws
There are two local setup paths: run the AMD64 playbook on the development machine and run the ARM64 kit playbook on the Raspberry Pi 5 itself.
On an x86_64 machine running Ubuntu 24.04, run Ansible against localhost.
-
Install prerequisites
sudo apt update sudo apt install -y git ansible python3-vcstool
-
Clone the repository
git clone https://github.com/scramble-robot/questix.git cd questix -
Run the setup script (AMD64)
./setup_dev.sh
This installs ROS 2 Jazzy Desktop, colcon, developer tooling, and configures shell aliases for
~/ros2_ws. -
Fetch workspace dependencies and build
mkdir -p ~/ros2_ws/src vcs import ~/ros2_ws/src < dependency.repos cd ~/ros2_ws source /opt/ros/jazzy/setup.bash rosdep update rosdep install --from-paths . src --ignore-src -r -y colcon build --symlink-install source install/setup.bash
rosdep installresolves workspace package dependencies declared inpackage.xmlfiles. In the current tree, this includes packages such aslibgpiod-dev,joint_state_publisher, andxacro. -
Verify
ros2 -h printenv ROS_DISTRO ros2 topic list
ros2 --versionis not used here because the ROS 2 CLI does not accept that option in this environment.
Flash Ubuntu 24.04 (64-bit) onto the Raspberry Pi 5 and boot it. The setup is
performed on the Pi itself by running the bundled setup.sh, which invokes
the kit playbook against localhost.
-
Prepare the Raspberry Pi 5
- Use Raspberry Pi Imager (or similar) to flash Ubuntu 24.04 Desktop for Raspberry Pi (arm64) to the microSD card / SSD.
- On first boot, create a user and connect to the network.
-
Install Git and Ansible on the Pi
sudo apt update sudo apt install -y git ansible
-
Clone the repository on the Pi
git clone https://github.com/scramble-robot/questix.git cd questix -
Run the setup script
./setup.sh
This runs
ansible-playbook ansible/playbooks/setup_kit.yamllocally and installs ROS 2 Jazzy, enables GPIO/I2C/SPI, applies udev rules, and builds the QUESTiX workspace (the checkout, e.g.~/questix:dependency.reposimported intosrc/, rosdep,colcon build --symlink-install). It reports the setup as completed only after the QUESTiX packages resolve.For an existing teaching SD, keep the existing OS/kernel/ROS package versions from being upgraded together during migration:
./setup.sh -e questix_os_upgrade=false # A checkout from before the executable-mode fix can use: # bash ./setup.sh -e questix_os_upgrade=false
questix_os_upgradedefaults totrue(the previous behavior).falsedisables only the role'sapt upgrade: dist; apt cache refresh and required package installation still occur. This is not a package-version pin or a rollback. Both setup entry scripts forward extra Ansible arguments. -
Reboot and verify
sudo reboot # After logging back in: source ~/.bashrc ros2 --version gpio_status # list the GPIO lines (read-only, gpiochip4) rw # cd into the workspace
questix_core/
├── .github/workflows/ # GitHub Actions CI/CD
│ └── ansible-check.yaml # Setup-script checks (no OS image build)
├── ansible/ # Ansible automation
│ ├── roles/ros2/ # ROS2 installation role
│ └── playbooks/ # Environment setup playbooks
├── scripts/ # Local image recipes and robot management
│ ├── build-pi-image.sh # Pi Desktop .img.xz
│ ├── iso/README.md # Local generation and validation
│ ├── prepare-base-system.sh
│ ├── apply-ansible-config.sh
│ └── build-iso.sh
├── docker/ # Docker support
└── Makefile # Local development commands
The default build target is Ubuntu 24.04 + ROS 2 Jazzy. Normal builds do not require
setting ROS2_DISTRO or UBUNTU_VERSION.
# Advanced: override only the architecture when calling the internal target directly
make _build ARCHITECTURE=amd64Modify the Ansible playbooks in ansible/playbooks/:
setup_dev.yaml- Development environmentsetup_kit.yaml- Robotics kit environment
Add packages to the ros2_additional_packages variable in playbooks:
ros2_additional_packages:
- ros-jazzy-navigation2
- ros-jazzy-slam-toolbox
- ros-jazzy-moveitThe base is the official Ubuntu 24.04 preinstalled Desktop for Raspberry Pi
.img.xz, pinned by filename and SHA-256 in scripts/iso/pi-desktop-base.env.
It retains the FAT boot + ext4 root partitions. Generic ARM64 ISO and Server
images are not accepted. The output includes ROS 2 Jazzy and a built QUESTiX workspace.
After obtaining the official base and installing the host tools described in the イメージ生成ガイド:
make test-pi-image
make build-kit BASE_IMAGE=/absolute/path/to/official-desktop.img.xzAdd IMAGE_USER=robot to choose the login/service account (default: ubuntu).
The password is set by the user at first boot; there is no build-time password option.
The second command is a privileged, networked local build: it mounts a scratch
image and installs packages inside it. It does not write to an SD card. Results
are under output/pi/; select the generated .img.xz with Raspberry Pi Imager's
Use custom option. First boot needs a monitor and keyboard.
There is no image build/validation/upload/release workflow on GitHub Actions. The existing AMD64 ISO scripts remain a separate legacy local path; they do not produce Pi images, and their installer path is not validated by this change. The Pi image's actual boot, desktop and hardware still require Pi 5 validation.
A QUESTiX custom image has no initial password and no passwordless sudo rule:
- The selected account (default:
ubuntu) is locked and SSH is disabled. - On the first boot, the console (tty1, a screen and keyboard) asks for a new password for that account
(
questix-first-boot.service,scripts/iso/questix-first-boot-enroll.sh). - Once it is set, SSH is enabled and the normal login starts.
sudoasks for that password. - If the enrollment fails or is interrupted, the account stays locked, SSH stays disabled, and the next boot asks again.
The image is built from the checkout that runs scripts/apply-ansible-config.sh:
- That commit is cloned to
/home/<user>/questix(tracked files only, owned by the selected user). - The workspace is built there by that user (
questix_image_build=true), so the first boot needs no download. - The build fails if the finished tree breaks the first-enrollment policy (
scripts/iso/image-build-lib.sh).
Robots set up from an older image or installer: scripts/update-robot-manager.sh,
scripts/install-robot-manager.sh and the setup playbooks run scripts/cleanup_legacy_privileges.py.
- It removes the legacy polkit
.pkla. - It removes the old image's
/etc/sudoers.d/ubuntuonly when the file is exactly that rule and the user has a safe password. - While
ubuntustill has the old known passwordubuntu, it stops with exit 2 and asks forsudo passwd ubuntu. The update, the installer and the setup stop there too. - It exits 0 when clean, 1 when a real run would remove something, and 2 when an operator has to act.
# Validate Ansible
make test-ansible
# Check the local Pi image recipe (no root or image build)
make test-pi-image
# Legacy AMD64 ISO only (requires QEMU; does not validate Pi boot)
make test-iso-amd64
# Test GitHub Actions locally (requires act)
make github-testDevelopment Environment (AMD64):
# After installation
source ~/.bashrc
ros2 --version
ros2 topic list
cw # Navigate to workspaceRobotics Kit (ARM64):
# After installation and reboot
source ~/.bashrc
ros2 --version
gpio_status # List GPIO lines (read-only, gpiochip4)
rw # Navigate to robot workspace- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Test changes (
make test-ansible) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Ubuntu 24.04 with ROS 2 Jazzy
- About 40 GiB free disk space for the Pi Desktop image build
- Internet connection for package downloads
- sudo privileges
Required for building packages:
libgpiod-dev- headers and libraries used bygpio_reader
Required when launching visualization or robot description flows:
ros-jazzy-xacroros-jazzy-joint-state-publisher
The launcher package expects the following packages to be available in the same colcon workspace. They are source/workspace dependencies, not apt packages:
ydlidar_ros2_driveresc_motor_control_cppddt_motor_control
For Jazzy operation, confirm that each selected branch or tag in dependency.repos
is compatible with ROS 2 Jazzy before using it. A successful vcs import only
confirms that the repositories were fetched; it does not guarantee runtime behavior.
- AMD64: Any x86_64 PC with 4GB+ RAM
- ARM64: Raspberry Pi 5 with 4GB+ RAM
- Pi Desktop image: 32 GB+ SD card / SSD (default raw image: 24 GiB)
Pi image build fails:
See イメージ生成・復旧ガイド. The script reports its private scratch directory and any loop device that could not be detached. Do not delete a directory while it still contains mounted filesystems.
QEMU emulation issues:
sudo update-binfmts --enable qemu-aarch64Network issues in chroot:
# Check DNS resolution
cat /etc/resolv.confEnable verbose output:
make build-dev VERBOSE=1QUESTiX のコードには リポジトリのライセンス が適用されます。 同梱ソフトウェアにはそれぞれの利用条件があります。生成したイメージを外部へ提供する場合は、 生成ガイドの利用・配布について を確認してください。
- ROS2 Community for the excellent robotics framework
- Ubuntu for the solid foundation
- Ansible for infrastructure automation
任意で起動できる questix_blockly パッケージで、前進・回転などをブロックから操作し、
ブラウザとRVizに同じ走行を表示できます。Blockly/ゲームコントローラーの切替に対応します。
既存の実機起動設定は変更しません。
ビルド・起動・対応範囲は QUESTiX Blockly を参照してください。