Skip to content

ShadowHound Environment Variables Reference

Purpose

Comprehensive reference for all environment variables used throughout the ShadowHound stack, their relationships, and configuration guidelines.

Prerequisites

  • Understanding of shell environment variable syntax
  • Familiarity with .env file format
  • Knowledge of ShadowHound deployment architecture

Overview

This document clarifies the environment variables used throughout the ShadowHound stack and their relationships.


Primary Variables (User-Facing)

GO2_IP

Purpose: Robot's IP address (WiFi or Ethernet)
Set in: .env file
Used by: All ShadowHound scripts and components

# For WebRTC mode (WiFi)
GO2_IP=192.168.1.103

# For CycloneDDS mode (Ethernet)
GO2_IP=192.168.10.167

Important: This is the ONLY IP variable you need to configure!


CONN_TYPE

Purpose: Connection protocol for Unitree Go2
Set in: .env file
Values: webrtc (WiFi) or cyclonedds (Ethernet)
Default: webrtc (if not set)

# For DIMOS high-level commands (sit, stand, wave)
CONN_TYPE=webrtc

# For basic teleop only (no high-level commands)
CONN_TYPE=cyclonedds

ROS_DOMAIN_ID

Purpose: ROS2 network isolation
Set in: .env file
Default: 0

# Standard domain (use unless you have conflicts)
ROS_DOMAIN_ID=0

# Change if you have multiple ROS2 systems on same network
ROS_DOMAIN_ID=42

RMW_IMPLEMENTATION

Purpose: ROS2 middleware implementation
Set in: .env file
Default: rmw_cyclonedds_cpp

# Recommended for best performance
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

Internal Variables (Auto-Configured)

ROBOT_IP

Purpose: SDK-specific variable (go2_ros2_sdk compatibility)
Set by: start.sh and test scripts automatically
Derived from: GO2_IP

# Automatically set by scripts:
export ROBOT_IP=$GO2_IP

You do NOT need to set this manually! It's automatically exported from GO2_IP.

Why both exist? - GO2_IP: ShadowHound convention (clear, descriptive) - ROBOT_IP: go2_ros2_sdk convention (from upstream SDK) - Scripts bridge the two automatically


Variable Relationships

User Config (.env)              Internal (Auto-set)
─────────────────              ───────────────────
GO2_IP=192.168.1.103     →     ROBOT_IP=192.168.1.103
                                (exported by scripts)

CONN_TYPE=webrtc         →     Used by SDK driver
                                (passed to launch file)

ROS_DOMAIN_ID=0          →     ROS2 network domain
                                (ROS environment)

Configuration Files

.env (Primary Configuration)

# Robot address - SET THIS!
GO2_IP=192.168.1.103

# Connection mode - IMPORTANT!
CONN_TYPE=webrtc

# ROS2 settings
ROS_DOMAIN_ID=0
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

# OpenAI API
OPENAI_API_KEY=sk-your-key-here

Shell Environment Setup

Use your standard .env directly and export variables in your shell when needed. We do not recommend generating bespoke environment files.


Common Patterns

Launching with Environment

# start.sh automatically:
# 1. Loads .env
# 2. Exports GO2_IP
# 3. Sets ROBOT_IP=$GO2_IP
# 4. Passes to SDK launch file

./start.sh

Manual Launch (Advanced)

# If launching SDK manually
export GO2_IP=192.168.1.103
export ROBOT_IP=$GO2_IP  # SDK compatibility
export CONN_TYPE=webrtc
export ROS_DOMAIN_ID=0

ros2 launch go2_robot_sdk robot.launch.py

Testing Commands

# All scripts handle ROBOT_IP automatically
./scripts/test_webrtc_direct.sh

# Just set GO2_IP in .env and you're good!

Environment Precedence

  1. Command line (highest priority) bash GO2_IP=192.168.1.200 ./start.sh

  2. Shell environment bash export GO2_IP=192.168.1.200 ./start.sh

  3. .env file (standard) bash # .env contains GO2_IP=192.168.1.103 ./start.sh # Uses 192.168.1.103

  4. Script defaults (lowest priority) bash # If GO2_IP not set anywhere # Scripts use: ${GO2_IP:-192.168.1.103}


Troubleshooting

"Cannot reach robot"

# Check what IP is being used
echo $GO2_IP
echo $ROBOT_IP

# Verify it's correct
ping $GO2_IP

"ROBOT_IP vs GO2_IP mismatch"

# This should NEVER happen - they should always match
# If you see this, the scripts have a bug

echo "GO2_IP: $GO2_IP"
echo "ROBOT_IP: $ROBOT_IP"

# They should be identical

"Which one should I set?"

# ONLY set GO2_IP in .env
# ROBOT_IP is automatically derived

# .env file:
GO2_IP=192.168.1.103     # ✅ Set this
# ROBOT_IP=...           # ❌ Don't set this

SDK Launch File Reference

The go2_ros2_sdk launch file reads these variables:

# From go2_robot_sdk/launch/robot.launch.py
self.robot_token = os.getenv('ROBOT_TOKEN', '')
self.robot_ip = os.getenv('ROBOT_IP', '')      # ← SDK reads ROBOT_IP
self.conn_type = os.getenv('CONN_TYPE', 'webrtc')

Our scripts ensure ROBOT_IP is set from GO2_IP:

# start.sh line 782
export ROBOT_IP=$go2_ip  # where go2_ip=${GO2_IP:-192.168.10.167}

Best Practices

✅ DO:

  • Set GO2_IP in .env file
  • Set CONN_TYPE in .env file
  • Use ./start.sh to launch (handles everything)
  • Re-source or export from your standard .env in other terminals as needed

❌ DON'T:

  • Set ROBOT_IP manually (scripts do this)
  • Mix different IP values for GO2_IP and ROBOT_IP
  • Forget to update GO2_IP when switching networks
  • Use Ethernet IP when in WebRTC mode

Quick Reference Card

Variable Where to Set Purpose Example
GO2_IP .env Robot IP address 192.168.1.103
CONN_TYPE .env Connection protocol webrtc or cyclonedds
ROS_DOMAIN_ID .env ROS2 network ID 0
RMW_IMPLEMENTATION .env ROS2 middleware rmw_cyclonedds_cpp
ROBOT_IP Auto-set SDK compatibility Same as GO2_IP
OPENAI_API_KEY .env LLM API key sk-...

Summary

One simple rule:

Set GO2_IP in .env, everything else is automatic!

The scripts handle the ROBOT_IP translation for SDK compatibility, so you never need to think about it.


  • WebRTC Configuration: docs/webrtc_configuration.md
  • WebRTC Testing: docs/networking/webrtc_direct_test.md
  • Environment Setup: .env.development, .env.production

Validation

  • [ ] Legacy guidance reviewed for accuracy and converted to the new workflow where applicable.
  • [ ] Links updated to use vault-friendly wikilinks or confirmed for external references.
  • [ ] Outstanding migration work captured as tasks in the backlog.

References