Created
February 13, 2019 03:38
-
-
Save zhanghanduo/77882611016a3f6b32a83acc3582f92f to your computer and use it in GitHub Desktop.
ros info neofetch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This program setting ROS environment | |
| # Please keyin {ROS_BUILDWS_NAME}, {USER_NAME} and {ROS_CATKINWS_NAME} string, then edit .bashrc add one line "source ~/myros.sh" | |
| # | |
| #PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
| #export PATH | |
| USER_NAME='hd' | |
| ROS_USE_ROSBUILD='0' | |
| ROS_INFO_TIME='1' | |
| # ROS_BUILDWS_NAME='catkin_ws' | |
| ROS_CATKINWS_NAME='catkin_ws' | |
| ROS_REMOTE_IP='' | |
| # ROS_REMOTE_IP='192.168.0.101' | |
| #Link MasterMind IP Address: 192.168.1.110 | |
| #Link MiniPC: 192.168.1.15 | |
| #Link NCU MiniPC: 192.168.1.194 | |
| #==Do not edit below======================================================== | |
| black='\e[0;30m' | |
| blue='\e[0;34m' | |
| green='\e[0;32m' | |
| cyan='\e[0;36m' | |
| red='\e[0;31m' | |
| purple='\e[0;35m' | |
| brown='\e[0;33m' | |
| lightgray='\e[0;37m' | |
| darkgray='\e[1;30m' | |
| lightblue='\e[1;34m' | |
| lightgreen='\e[1;32m' | |
| lightcyan='\e[1;36m' | |
| lightred='\e[1;31m' | |
| lightpurple='\e[1;35m' | |
| yellow='\e[1;33m' | |
| white='\e[1;37m' | |
| nc='\e[0m' | |
| reset="\[\033[0m\]" | |
| #Colors for less pager (man pages) | |
| export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking | |
| export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold | |
| export LESS_TERMCAP_me=$'\E[0m' # end mode | |
| export LESS_TERMCAP_se=$'\E[0m' # end standout-mode | |
| export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box | |
| export LESS_TERMCAP_ue=$'\E[0m' # end underline | |
| export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline | |
| if [ "$ROS_USE_ROSBUILD" = "1" ]; then | |
| #Setting ROS rosbuild workspace | |
| echo -e "${lightblue} ROS_PACKAGE_PATH (ROSBUILD) is setting.${nc}" | |
| source ~/${ROS_BUILDWS_NAME}/setup.zsh | |
| export ROS_PACKAGE_PATH=/home/${USER_NAME}/${ROS_BUILDWS_NAME}:${ROS_PACKAGE_PATH} | |
| #Add the NTU_Research_Group_ROS workspace | |
| #export ROS_PACKAGE_PATH=/home/chencl/NTU_Research_Group_ROS:${ROS_PACKAGE_PATH} | |
| else | |
| #Setting ROS catkin workspace | |
| #echo -e "${lightblue} ROS_PACKAGE_PATH (CATKIN) is setting.${nc}" | |
| source ~/${ROS_CATKINWS_NAME}/devel/setup.zsh | |
| fi | |
| echo -e "${lightblue} ROS_PACKAGE_PATH: ${nc} $ROS_PACKAGE_PATH" | |
| echo -e "${lightblue} PYTHONPATH: ${nc} $PYTHONPATH" | |
| #Setting ROS INFO Time in Display | |
| if [ "$ROS_INFO_TIME" = "1" ]; then | |
| export ROSCONSOLE_FORMAT='[${severity}] [Wall | Sim: ${time}]: ${message}' | |
| echo -e "ROS_INFO_TIME: ${lightcyan}VISIBLE${nc}" | |
| else | |
| export ROSCONSOLE_FORMAT='[${severity}]: ${message}' | |
| echo -e "ROS_INFO_TIME: ${lightcyan}INVISIBLE${nc}" | |
| fi | |
| #Get current using Wi-Fi information | |
| WLAN_IP=`ifconfig | grep 'inet addr:172.21\|10.27' | sed 's/^.*addr://g' | sed 's/Bcast:.*$//g'` | |
| if [ "$WLAN_IP" = "" ]; then | |
| echo -e "${red}!!!!!No Local Network connect!!!!!${nc}" | |
| export ROS_MASTER_URI=http://localhost:11311 | |
| echo -e "ROS_MASTER_URI: ${lightcyan}$ROS_MASTER_URI${nc}" | |
| else | |
| echo -e "Network IP Address: ${lightcyan}$WLAN_IP${nc}" | |
| WLAN_SSID=`iwgetid -r` | |
| echo -e "Wi-Fi AP SSID: ${lightcyan}$WLAN_SSID${nc}" | |
| #Print ROS IP Setting | |
| export ROS_HOSTNAME=${WLAN_IP} | |
| export ROS_IP=${WLAN_IP} | |
| if [ "$ROS_REMOTE_IP" = "" ]; then | |
| export ROS_MASTER_URI=http://localhost:11311 | |
| else | |
| export ROS_MASTER_URI=http://${ROS_REMOTE_IP}:11311 | |
| fi | |
| #echo "ROS_HOSTNAME: $ROS_HOSTNAME" | |
| echo -e "ROS_IP: ${lightcyan}$ROS_IP${nc}" | |
| echo -e "ROS_MASTER_URI: ${lightcyan}$ROS_MASTER_URI${nc}" | |
| fi | |
| #Print all ROS Environment Variable | |
| #env | grep ROS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment