From dab3fccde232c7f603494515f9b3b8e3d6bcdf82 Mon Sep 17 00:00:00 2001 From: Stash Pomichter Date: Thu, 13 Nov 2025 17:01:42 -0800 Subject: [PATCH 1/4] Added ROBOT_IP for docker preconfig if using webrtc connection on unitree g1 or go2 --- docker/navigation/.env.hardware | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/navigation/.env.hardware b/docker/navigation/.env.hardware index 2d8866b179..75192623e4 100644 --- a/docker/navigation/.env.hardware +++ b/docker/navigation/.env.hardware @@ -16,6 +16,11 @@ ROS_DOMAIN_ID=42 # Robot configuration ('mechanum_drive', 'unitree/unitree_g1', 'unitree/unitree_g1', etc) ROBOT_CONFIG_PATH=mechanum_drive +# Robot IP address on local network for connection over WebRTC +# For Unitree Go2, Unitree G1, if using WebRTCConnection +# This can be found in the unitree app under Device settings or via network scan +ROBOT_IP= + # ============================================ # Mid-360 Lidar Configuration # ============================================ From ee3033d35616ed91e59c24ecd9e621ddfce5d4a7 Mon Sep 17 00:00:00 2001 From: Stash Pomichter Date: Thu, 13 Nov 2025 17:29:47 -0800 Subject: [PATCH 2/4] Added robot ip check to dockerfile --- docker/navigation/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/navigation/Dockerfile b/docker/navigation/Dockerfile index aceb3f1726..69378ea7c7 100644 --- a/docker/navigation/Dockerfile +++ b/docker/navigation/Dockerfile @@ -210,6 +210,11 @@ EOF\n\ echo "Generated MID360_config.json with LIDAR_COMPUTER_IP=${LIDAR_COMPUTER_IP} and LIDAR_IP=${LIDAR_IP}"\n\ fi\n\ \n\ + # Display Robot IP configuration if set\n\ + if [ -n "${ROBOT_IP}" ]; then\n\ + echo "Robot IP configured on local network: ${ROBOT_IP}"\n\ + fi\n\ + \n\ fi\n\ \n\ # Execute the command\n\ From ebd6accc8909e46782c3fc7a2bfee32ec3a39f4f Mon Sep 17 00:00:00 2001 From: Stash Pomichter Date: Thu, 13 Nov 2025 17:43:42 -0800 Subject: [PATCH 3/4] Readme updates --- docker/navigation/README.md | 21 ++++++++++++--------- docker/navigation/docker-compose.yml | 2 ++ docker/navigation/start.sh | 9 +++++++++ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/docker/navigation/README.md b/docker/navigation/README.md index f518cf7674..10e7999164 100644 --- a/docker/navigation/README.md +++ b/docker/navigation/README.md @@ -115,6 +115,7 @@ LIDAR_INTERFACE=eth0 # Your ethernet interface (find with: ip link LIDAR_COMPUTER_IP=192.168.1.5 # Computer IP on the lidar subnet LIDAR_GATEWAY=192.168.1.1 # Gateway IP address for the lidar subnet LIDAR_IP=192.168.1.116 # Full IP address of your Mid-360 lidar +ROBOT_IP= # IP addres of robot on local network (if using WebRTC connection) # Motor Controller MOTOR_SERIAL_DEVICE=/dev/ttyACM0 # Serial device (check with: ls /dev/ttyACM*) @@ -136,20 +137,22 @@ docker exec -it dimos_hardware_container bash ### In the container -In the container you can run any of the ROS or Python code. +In the container to run the full navigation stack you must run both the dimensional python runfile with connection module and the navigation stack. -#### ROS +#### Dimensional Python + Connection Module +For the Unitree G1 ```bash -cd /ros2_ws/src/ros-navigation-autonomy-stack -./system_real_robot_with_route_planner.sh +dimos-robot run unitree-g1 +ROBOT_IP=XX.X.X.XXX dimos-robot run unitree-g1 # If ROBOT_IP env variable is not set in .env ``` -### Python - -Demo which moves the robot 2 meters forward and 2 meters left. +#### Navigation Stack ```bash -source /opt/dimos-venv/bin/activate -python3 dimos/navigation/demo_ros_navigation.py +cd /ros2_ws/src/ros-navigation-autonomy-stack +./system_real_robot_with_route_planner.sh ``` + +Now you can place goal points/poses in RVIZ by clicking the "Goalpoint" button. The robot will navigate to the point, running both local and global planners for dynamic obstacle avoidance. + diff --git a/docker/navigation/docker-compose.yml b/docker/navigation/docker-compose.yml index 8678297e95..f26b7fbabd 100644 --- a/docker/navigation/docker-compose.yml +++ b/docker/navigation/docker-compose.yml @@ -26,6 +26,7 @@ services: - NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:-all} - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-42} - ROBOT_CONFIG_PATH=${ROBOT_CONFIG_PATH:-mechanum_drive} + - ROBOT_IP=${ROBOT_IP:-} - HARDWARE_MODE=false # Volume mounts @@ -90,6 +91,7 @@ services: - NVIDIA_DRIVER_CAPABILITIES=all - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-42} - ROBOT_CONFIG_PATH=${ROBOT_CONFIG_PATH:-mechanum_drive} + - ROBOT_IP=${ROBOT_IP:-} - HARDWARE_MODE=true # Mid-360 Lidar configuration - LIDAR_INTERFACE=${LIDAR_INTERFACE:-} diff --git a/docker/navigation/start.sh b/docker/navigation/start.sh index cd05dff69b..5b6ad4065b 100755 --- a/docker/navigation/start.sh +++ b/docker/navigation/start.sh @@ -86,6 +86,14 @@ if [ "$MODE" = "hardware" ]; then echo "Set LIDAR_GATEWAY to the gateway IP address for the lidar subnet" fi + # Check for robot IP configuration + if [ -n "$ROBOT_IP" ]; then + echo -e "${GREEN}Robot IP configured: $ROBOT_IP${NC}" + else + echo -e "${YELLOW}Note: ROBOT_IP not configured in .env${NC}" + echo "Set ROBOT_IP if using network connection to robot" + fi + # Check for serial devices echo -e "${GREEN}Checking for serial devices...${NC}" if [ -e "${MOTOR_SERIAL_DEVICE:-/dev/ttyACM0}" ]; then @@ -143,6 +151,7 @@ if docker info 2>/dev/null | grep -q nvidia; then fi else echo -e "${YELLOW}NVIDIA Docker runtime not found. GPU acceleration disabled.${NC}" + export DOCKER_RUNTIME=runc fi # Set container name for reference From 6f9bcc438ad634822eeac5d1af92fb6d98fafc39 Mon Sep 17 00:00:00 2001 From: Stash Pomichter Date: Thu, 13 Nov 2025 17:44:07 -0800 Subject: [PATCH 4/4] Force lidar ethernet setup in start.sh --- docker/navigation/start.sh | 62 +++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/docker/navigation/start.sh b/docker/navigation/start.sh index 5b6ad4065b..4347006957 100755 --- a/docker/navigation/start.sh +++ b/docker/navigation/start.sh @@ -105,15 +105,61 @@ if [ "$MODE" = "hardware" ]; then fi # Check network interface for lidar - if [ -n "$LIDAR_INTERFACE" ]; then - echo -e "${GREEN}Checking network interface for lidar...${NC}" - if ip link show "$LIDAR_INTERFACE" &>/dev/null; then - echo -e " Network interface $LIDAR_INTERFACE found" - else - echo -e "${YELLOW} Warning: Interface $LIDAR_INTERFACE not found${NC}" - echo -e "${YELLOW} Available interfaces:${NC}" - ip link show | grep -E "^[0-9]+:" | awk '{print " " $2}' | sed 's/:$//' + echo -e "${GREEN}Checking network interface for lidar...${NC}" + + # Get available ethernet interfaces + AVAILABLE_ETH="" + for i in /sys/class/net/*; do + if [ "$(cat $i/type 2>/dev/null)" = "1" ] && [ "$i" != "/sys/class/net/lo" ]; then + interface=$(basename $i) + if [ -z "$AVAILABLE_ETH" ]; then + AVAILABLE_ETH="$interface" + else + AVAILABLE_ETH="$AVAILABLE_ETH, $interface" + fi fi + done + + if [ -z "$LIDAR_INTERFACE" ]; then + # No interface configured + echo -e "${RED}================================================================${NC}" + echo -e "${RED} ERROR: ETHERNET INTERFACE NOT CONFIGURED!${NC}" + echo -e "${RED}================================================================${NC}" + echo -e "${YELLOW} LIDAR_INTERFACE not set in .env file${NC}" + echo "" + echo -e "${YELLOW} Your ethernet interfaces: ${GREEN}${AVAILABLE_ETH}${NC}" + echo "" + echo -e "${YELLOW} ACTION REQUIRED:${NC}" + echo -e " 1. Edit the .env file and set:" + echo -e " ${GREEN}LIDAR_INTERFACE=${NC}" + echo -e " 2. Run this script again" + echo -e "${RED}================================================================${NC}" + exit 1 + elif ! ip link show "$LIDAR_INTERFACE" &>/dev/null; then + # Interface configured but doesn't exist + echo -e "${RED}================================================================${NC}" + echo -e "${RED} ERROR: ETHERNET INTERFACE '$LIDAR_INTERFACE' NOT FOUND!${NC}" + echo -e "${RED}================================================================${NC}" + echo -e "${YELLOW} You configured: LIDAR_INTERFACE=$LIDAR_INTERFACE${NC}" + echo -e "${YELLOW} But this interface doesn't exist on your system${NC}" + echo "" + echo -e "${YELLOW} Your ethernet interfaces: ${GREEN}${AVAILABLE_ETH}${NC}" + echo "" + echo -e "${YELLOW} ACTION REQUIRED:${NC}" + echo -e " 1. Edit the .env file and change to one of your interfaces:" + echo -e " ${GREEN}LIDAR_INTERFACE=${NC}" + echo -e " 2. Run this script again" + echo -e "${RED}================================================================${NC}" + exit 1 + else + # Interface exists and is configured correctly + echo -e " ${GREEN}✓${NC} Network interface $LIDAR_INTERFACE found" + echo -e " ${GREEN}✓${NC} Will configure static IP: ${LIDAR_COMPUTER_IP}/24" + echo -e " ${GREEN}✓${NC} Will set gateway: ${LIDAR_GATEWAY}" + echo "" + echo -e "${YELLOW} Network configuration mode: Static IP (Manual)${NC}" + echo -e " This will temporarily replace DHCP with static IP assignment" + echo -e " Configuration reverts when container stops" fi fi