| #!/bin/bash |
| |
| |
| |
| |
| |
| |
|
|
| set -e |
|
|
| ENV_NAME="${1:-teleop_ros}" |
| PY_VERSION="3.10" |
|
|
| |
| 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 |
|
|
| |
| echo "βοΈ Removing 'defaults' channel if present..." |
| conda config --env --remove channels defaults || true |
|
|
| echo "π¦ Installing ROS 2 Humble Desktop from RoboStack..." |
| |
| |
| |
| 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 <<EOF |
| |
| βΉοΈ Each new shell that runs gear_sonic with --input-source ros2 must compose |
| the env in this order. Add to your workflow (not auto-handled): |
| |
| conda activate $ENV_NAME |
| source "\$CONDA_PREFIX/setup.bash" # ROS env (PATH, AMENT_PREFIX_PATH, ...) |
| source .venv_teleop/bin/activate # gear_sonic deps on top |
| export ROS_LOCALHOST_ONLY=1 # match the publisher container |
| |
| See docs/source/tutorials/vr_wholebody_teleop.md (Isaac Teleop / CloudXR |
| alternative section) for the full env-composition rationale. |
| EOF |
|
|