Skip to content

Instantly share code, notes, and snippets.

View clungzta's full-sized avatar

Alex McClung clungzta

View GitHub Profile
@clungzta
clungzta / ros-network.sh
Last active October 13, 2019 05:13 — forked from marc-hanheide/ros-network.sh
ROS network setup depending on route to MASTER
#!/bin/bash
# This script configures the ROS environment variables according to the route
# to the ROS_MASTER. ROS_MASTER can either be defined as an evironment variable
# itself or given as first argument to this script. The ROS_IP and ROS_HOSTNAME
# are set according to the IP that is sitting on the route to this master.
# The ROS_MASTER_URI is also set, using port 11311. ROS_MASTER needs to be defined
# as a numeric IP address, not a hostname.
if [ "$1" ]; then