From acb4c924a1251be185541979fbee184588cbaa78 Mon Sep 17 00:00:00 2001 From: Kavya Chennoju Date: Tue, 17 Mar 2026 15:38:29 -0700 Subject: [PATCH 1/3] Add setup.sh and streamline GUIDE.md setup instructions - Add setup.sh: handles uv install, Python 3.12, venv creation, and package installation in one command - Simplify GUIDE.md setup to two steps: install and start a robot - Replace manual Python/venv/pip steps with setup.sh reference - Add screen session management for running the robot in the background --- strands_robots/device_connect/GUIDE.md | 24 +++++------- strands_robots/device_connect/setup.sh | 53 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 14 deletions(-) create mode 100755 strands_robots/device_connect/setup.sh diff --git a/strands_robots/device_connect/GUIDE.md b/strands_robots/device_connect/GUIDE.md index 3f37df2..cd1f6d3 100644 --- a/strands_robots/device_connect/GUIDE.md +++ b/strands_robots/device_connect/GUIDE.md @@ -71,33 +71,29 @@ No Docker needed. No env vars. Devices discover each other directly on the LAN v #### Setup -Clone the repo and create a virtual environment: +##### 1. Install ```bash git clone --branch feat/device-connect-integration-draft https://github.com/atsyplikhin/robots.git cd robots - -python3.12 --version # verify Python 3.12 is installed -# If not installed, see https://www.python.org/downloads/ or use your package manager: -# macOS: brew install python@3.12 -# Ubuntu: sudo apt install python3.12 python3.12-venv - -python3.12 -m venv .venv # Python 3.12 recommended (MuJoCo has no 3.14 wheels) +bash strands_robots/device_connect/setup.sh source .venv/bin/activate - -pip install -e ".[sim]" # install from source; sim = MuJoCo, Device Connect SDK is a core dep - -export PYTHONPATH="$PWD:$PYTHONPATH" # only needed when running from source checkout ``` -**Start a robot (keep running in a separate terminal):** +This installs `uv`, Python 3.12, creates a venv, and installs all dependencies. -```python +##### 2. Start a robot + +```bash +screen -S robot # start a persistent session python -c " from strands_robots import Robot r = Robot('so100') r.run() " +# once online, Ctrl+a then d to detach +# screen -ls to list sessions +# screen -r robot to reattach ``` Expected output: diff --git a/strands_robots/device_connect/setup.sh b/strands_robots/device_connect/setup.sh new file mode 100755 index 0000000..0c10fad --- /dev/null +++ b/strands_robots/device_connect/setup.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# setup.sh — one-command environment setup for Strands Robots + Device Connect +# +# Usage: +# bash strands_robots/device_connect/setup.sh +# +set -euo pipefail + +PYTHON_VERSION="3.12" +VENV_DIR=".venv" +REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" + +echo "============================================================" +echo " Strands Robots — Environment Setup" +echo "============================================================" +echo "" + +# ── 0. Install uv (if needed) ──────────────────────────────────────────────── +if ! command -v uv &>/dev/null; then + echo "[0/2] uv not found — installing..." + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" +else + echo "[0/2] uv $(uv --version) ✓" +fi + +# ── 1. Install Python (if needed) ──────────────────────────────────────────── +if ! uv python find "$PYTHON_VERSION" &>/dev/null; then + echo "[1/2] Python $PYTHON_VERSION not found — installing via uv..." + uv python install "$PYTHON_VERSION" +else + echo "[1/2] Python $PYTHON_VERSION ✓" +fi + +# ── 2. Create virtual environment and install ──────────────────────────────── +if [ ! -d "$REPO_ROOT/$VENV_DIR" ]; then + echo "[2/2] Creating virtual environment and installing packages..." + uv venv --python "$PYTHON_VERSION" "$REPO_ROOT/$VENV_DIR" +else + echo "[2/2] Virtual environment exists, installing packages..." +fi + +# shellcheck disable=SC1091 +source "$REPO_ROOT/$VENV_DIR/bin/activate" +uv pip install -e "$REPO_ROOT[sim]" + +echo "" +echo "============================================================" +echo " Setup complete" +echo "============================================================" +echo "" +echo "Activate the environment:" +echo " source $REPO_ROOT/$VENV_DIR/bin/activate" From 03fc9ca4f923479b41a33184103ee19cbdbf1615 Mon Sep 17 00:00:00 2001 From: Kavya Chennoju Date: Tue, 17 Mar 2026 16:33:04 -0700 Subject: [PATCH 2/3] Use ./setup.sh instead of bash setup.sh --- strands_robots/device_connect/GUIDE.md | 2 +- strands_robots/device_connect/setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/strands_robots/device_connect/GUIDE.md b/strands_robots/device_connect/GUIDE.md index cd1f6d3..ada0163 100644 --- a/strands_robots/device_connect/GUIDE.md +++ b/strands_robots/device_connect/GUIDE.md @@ -76,7 +76,7 @@ No Docker needed. No env vars. Devices discover each other directly on the LAN v ```bash git clone --branch feat/device-connect-integration-draft https://github.com/atsyplikhin/robots.git cd robots -bash strands_robots/device_connect/setup.sh +./strands_robots/device_connect/setup.sh source .venv/bin/activate ``` diff --git a/strands_robots/device_connect/setup.sh b/strands_robots/device_connect/setup.sh index 0c10fad..4f73565 100755 --- a/strands_robots/device_connect/setup.sh +++ b/strands_robots/device_connect/setup.sh @@ -2,7 +2,7 @@ # setup.sh — one-command environment setup for Strands Robots + Device Connect # # Usage: -# bash strands_robots/device_connect/setup.sh +# ./strands_robots/device_connect/setup.sh # set -euo pipefail From 510d3dbd44df33c58abb452babd73bd9649f012e Mon Sep 17 00:00:00 2001 From: Kavya Chennoju Date: Tue, 17 Mar 2026 16:37:53 -0700 Subject: [PATCH 3/3] Move setup.sh description to note before code block --- strands_robots/device_connect/GUIDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strands_robots/device_connect/GUIDE.md b/strands_robots/device_connect/GUIDE.md index ada0163..143f8f7 100644 --- a/strands_robots/device_connect/GUIDE.md +++ b/strands_robots/device_connect/GUIDE.md @@ -73,6 +73,8 @@ No Docker needed. No env vars. Devices discover each other directly on the LAN v ##### 1. Install +> `setup.sh` installs `uv`, Python 3.12, creates a venv, and installs all dependencies. + ```bash git clone --branch feat/device-connect-integration-draft https://github.com/atsyplikhin/robots.git cd robots @@ -80,8 +82,6 @@ cd robots source .venv/bin/activate ``` -This installs `uv`, Python 3.12, creates a venv, and installs all dependencies. - ##### 2. Start a robot ```bash