diff --git a/.devcontainer/setup_alias.sh b/.devcontainer/setup_alias.sh index 8cd78a8..c03386f 100644 --- a/.devcontainer/setup_alias.sh +++ b/.devcontainer/setup_alias.sh @@ -23,10 +23,51 @@ setup_alias_in_bash "wssetup" "source ${ROOT}/devel/setup.bash" ## It will automatically set ROS_MASTER_URI to the IP address of the SMB NUC and ROS_IP to the IP address of the host machine ## based on the default gateway IP address (the IP address of the router on the SMB) ## Note: The ip address of every SMB is 10.0.x.5 where x is the last digit of SMB Robot Number. Example: For SMB 261 the on-board computer IP address is 10.0.1.5 -cat <<'EOF' >> ~/.bashrc -connect-smb() { - export ROS_MASTER_URI=http://$(ip route show default | grep -oP 'via \K\d+\.\d+\.\d+').5:11311 - export ROS_IP=$(ip route get 8.8.8.8 | grep -oP '(?<=src )\S+') +# cat <<'EOF' >> ~/.bashrc +# connect-smb() { +# export ROS_MASTER_URI=http://$(ip route show default | grep -oP 'via \K\d+\.\d+\.\d+').5:11311 +# export ROS_IP=$(ip route get 8.8.8.8 | grep -oP '(?<=src )\S+') +# echo 'ROS_MASTER_URI and ROS_IP set to ' +# printenv ROS_MASTER_URI +# printenv ROS_IP +# } +# EOF + +# cat <<'EOF' >> ~/.zshrc +# connect-smb() { +# export ROS_MASTER_URI=http://$(ip route show default | grep -oP 'via \K\d+\.\d+\.\d+').5:11311 +# export ROS_IP=$(ip route get 8.8.8.8 | grep -oP '(?<=src )\S+') +# echo 'ROS_MASTER_URI and ROS_IP set to ' +# printenv ROS_MASTER_URI +# printenv ROS_IP +# } +# EOF + +# Aliases for ROS_MASTER_URI and ROS_IP for connecting to SMB +cat <<'EOF' >> ~/.zshrc +connect-smb261() { + export ROS_MASTER_URI=http://10.0.1.5:11311 + export ROS_IP=$(hostname -I | awk '{print $1}') + echo 'ROS_MASTER_URI and ROS_IP set to ' + printenv ROS_MASTER_URI + printenv ROS_IP +} +EOF + +cat <<'EOF' >> ~/.zshrc +connect-smb262() { + export ROS_MASTER_URI=http://10.0.2.5:11311 + export ROS_IP=$(hostname -I | awk '{print $1}') + echo 'ROS_MASTER_URI and ROS_IP set to ' + printenv ROS_MASTER_URI + printenv ROS_IP +} +EOF + +cat <<'EOF' >> ~/.zshrc +connect-smb263() { + export ROS_MASTER_URI=http://10.0.3.5:11311 + export ROS_IP=$(hostname -I | awk '{print $1}') echo 'ROS_MASTER_URI and ROS_IP set to ' printenv ROS_MASTER_URI printenv ROS_IP @@ -34,9 +75,9 @@ connect-smb() { EOF cat <<'EOF' >> ~/.zshrc -connect-smb() { - export ROS_MASTER_URI=http://$(ip route show default | grep -oP 'via \K\d+\.\d+\.\d+').5:11311 - export ROS_IP=$(ip route get 8.8.8.8 | grep -oP '(?<=src )\S+') +connect-smb264() { + export ROS_MASTER_URI=http://10.0.4.5:11311 + export ROS_IP=$(hostname -I | awk '{print $1}') echo 'ROS_MASTER_URI and ROS_IP set to ' printenv ROS_MASTER_URI printenv ROS_IP