-
Notifications
You must be signed in to change notification settings - Fork 6
/
bash_includes
29 lines (25 loc) · 958 Bytes
/
bash_includes
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
26
27
28
29
###### ROS Support ######
if (($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==16));then
ROS_VERSION="kinetic"
OS_VERSION="xenial"
function ifip { /sbin/ifconfig $1 | grep "inet addr" | awk -F: '{print $2}' |awk '{print $1}'; }
else
if (($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==18)); then
ROS_VERSION="melodic"
OS_VERSION="bionic"
function ifip { ip -4 addr show $1 | grep -oP '(?<=inet\s)\d+(\.\d+){3}' ;}
fi
fi
echo "using ros version: $ROS_VERSION"
echo "on OS: $OS_VERSION"
source /opt/ros/${ROS_VERSION}/setup.bash
source ~/catkin_ws/devel/setup.bash
export ROS_MASTER_URI=http://localhost:11311
#export ROS_IP=`ifip wlp58s0`
# Set display if unset or empty string
: ${DISPLAY:=:0}
# and put it in the enviromnet
export DISPLAY
##### For making npm work #####
export NPM_CONFIG_PREFIX=~/.npm-global
export PATH=~/.npm-global/bin:$PATH