Skip to content

Instantly share code, notes, and snippets.

@brikeats
Created September 11, 2016 22:03
Show Gist options
  • Save brikeats/099839e261a1c255241e99e19c9329bc to your computer and use it in GitHub Desktop.
Save brikeats/099839e261a1c255241e99e19c9329bc to your computer and use it in GitHub Desktop.
Run ROS initialization script with ROS_MASTER set to the local IP. Suitable for running ROS stuff on a single machine.
source /opt/ros/indigo/setup.bash
source /home/brian/robotics_code/ROS/workspace/devel/setup.bash
export ROS_IP=`ifconfig|grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"|tail -n 3|head -n 1`
export ROS_MASTER_URI=http://$ROS_IP:11311/
echo "ROS is now ready to run, with ROS_MASTER set to $ROS_MASTER_URI."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment