#!/bin/bash # install_ros.sh # Sets up the `teleop_ros` conda env with RoboStack ROS 2 Humble for the # Isaac Teleop / CloudXR ROS bridge. Pinned to Python 3.10 to compose with # .venv_teleop (created by install_pico.sh). # # Usage: bash install_scripts/install_ros.sh (run from repo root) set -e ENV_NAME="${1:-teleop_ros}" PY_VERSION="3.10" # Source conda's shell hooks so `conda activate` works in a non-interactive script. source "$(conda info --base)/etc/profile.d/conda.sh" if conda env list | awk '{print $1}' | grep -qx "$ENV_NAME"; then echo "โ™ป๏ธ Reusing existing conda env: $ENV_NAME" else echo "๐Ÿ†• Creating conda env '$ENV_NAME' with Python $PY_VERSION..." conda create -n "$ENV_NAME" "python=$PY_VERSION" -y fi conda activate "$ENV_NAME" echo "๐Ÿ”„ Cleaning up incomplete or cached packages..." conda clean --packages --tarballs --yes echo "๐Ÿ”ง Adding RoboStack and conda-forge channels to the current environment..." conda config --env --add channels conda-forge conda config --env --add channels robostack-staging # Optional: remove defaults to avoid conflicts (ignore error if not present) echo "โš™๏ธ Removing 'defaults' channel if present..." conda config --env --remove channels defaults || true echo "๐Ÿ“ฆ Installing ROS 2 Humble Desktop from RoboStack..." # RoboStack recommends mamba over conda; conda+libmamba hits a post-link # ordering bug in ros-humble-ros-workspace, and conda+classic is very slow # on aarch64. Install mamba into base if it isn't already there. if ! command -v mamba &>/dev/null; then echo "๐Ÿ†• Installing mamba into base env..." conda install -n base -c conda-forge -y mamba fi mamba install -y ros-humble-desktop echo "โœ… Sourcing ROS environment from current conda env..." source "$CONDA_PREFIX/setup.bash" echo "๐Ÿงช Verifying rclpy import..." python -c "import rclpy; print('โœ… rclpy imported')" cat <