-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc_ros
25 lines (24 loc) · 859 Bytes
/
.bashrc_ros
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Must be executed towards the end of the .bashrc file, after PS1 has been set
set-ros-prompt () {
if [ -n "$ROS_DISTRO" ]; then
# Update commandline
export PS1=${PS1/\\\@\\\n/\\\@ ${RED}${ROS_DISTRO}\\\n}
echo "Using ros ${ROS_DISTRO}"
elif [ -d "/opt/ros/" ]; then
# If ROS is installed, but not being sourced, let the person know
echo "Ros distro not initialized"
fi
}
# Sets the ROS_MASTER_URI variable approprately
# Example 'ros-master set atrv.lan'
ros-master () {
if [ $# -eq 0 ] ; then
echo $ROS_MASTER_URI
elif [ $1 = "set" ] && [ $# -eq 2 ] ; then
export ROS_MASTER_URI=http://$2:11311
else
echo "USAGE:"
echo "ros-master displays the ROS_MASTER_URI"
echo "ros-master set <address> sets the rosmaster address"
fi
}