-
Notifications
You must be signed in to change notification settings - Fork 57
/
.robotics_setup
196 lines (165 loc) · 5.53 KB
/
.robotics_setup
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# for bash and zsh
# https://github.com/ahundt/robotics_setup
# Loads configuration of installed utilities
# while skipping things that aren't set up
# ROS.org Robot Operating System
# version: kinetic
if [ -z "$ZSH_VERSION" ]; then
# assume Zsh
if [ -d /opt/ros/kinetic ] ; then
source /opt/ros/kinetic/setup.zsh
fi
# ROS.org Robot Operating System
# version: indigo
if [ -d /opt/ros/indigo ] ; then
source /opt/ros/indigo/setup.zsh
fi
elif [ -z "$BASH_VERSION" ]; then
# assume Bash
if [ -d /opt/ros/kinetic ] ; then
source /opt/ros/kinetic/setup.bash
fi
# ROS.org Robot Operating System
# version: indigo
if [ -d /opt/ros/indigo ] ; then
source /opt/ros/indigo/setup.bash
fi
fi
# byobu shell session manager installed from source
# see byobu-source.sh
if [ -d $HOME/byobu/bin ] ; then
export PATH=$HOME/byobu/bin:$PATH
fi
# costar_ws https://github.com/cpaxton/costar_stack
# see costar.sh
if [ -d ~/src/costar_ws ] ; then
if [ -d /opt/ros ] ; then
if [ -z "$ZSH_VERSION" ]; then
# assume Zsh
test -e "$HOME/src/costar_ws/devel/setup.zsh" && source "$HOME/src/costar_ws/devel/setup.zsh"
elif [ -z "$BASH_VERSION" ]; then
# assume Bash
test -e "$HOME/src/costar_ws/devel/setup.bash" && source "$HOME/src/costar_ws/devel/setup.bash"
fi
fi
fi
# linuxbrew http://linuxbrew.sh/
if [ -d $HOME/.linuxbrew ]; then
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
export PATH="$HOME/.linuxbrew/sbin:$PATH"
fi
# check for homebrew https://brew.sh
# and make its binaries first on PATH
which -s brew > /dev/null
if [[ $? == 0 ]] ; then
brew_path=`brew --prefix`
export PATH="${brew_path}/bin:$PATH"
# Check for brewed python https://docs.brew.sh/Homebrew-and-Python.html,
# and if it is found make it the first python on the PATH
brew ls --versions python > /dev/null
if [[ $? == 0 ]] ; then
# add homebrew python to the path
export PATH="${brew_path}/opt/python/libexec/bin:$PATH"
fi
fi
# nvidia cuda gpu compiler
if [ -d /usr/local/cuda ] ; then
export PATH=$PATH:/usr/local/cuda/bin
fi
# golang aka google go
# https://golang.org/
# https://github.com/golang/go/wiki/Ubuntu
if [ -d $HOME/go ] ; then
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
fi
# github.com/cfinn/gps
if [ -d ~/src/gps ] ; then
# load libraries for guided_policy_search.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/src/gps/build/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/src/gps/build/lib
export PYTHONPATH=$PYTHONPATH:$HOME/src/gps/build/lib
fi
if [ -d /usr/local/cuda ] ; then
# for tensorflow.sh build
# see https://github.com/tensorflow/tensorflow/issues/15142#issuecomment-352773470
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs
fi
# github.com/tensorflow/models
if [ -d ~/src/tf_models ] ; then
# load libraries for tensorflow object detection api
export PYTHONPATH=$PYTHONPATH:$HOME/src/tf_models/research/:$HOME/src/tf_models/research/slim
fi
# locally installed libraries
if [ -d $HOME/lib ] ; then
# load libraries and programs installed locally
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/lib
export PYTHONPATH=$PYTHONPATH:$HOME/lib
fi
# locally installed binaries
if [ -d $HOME/bin ] ; then
export PATH=$PATH:$HOME/bin
fi
# pip installs user packages here, for example:
# pip3 install numpy --upgrade --user
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUSERBASE
if [ -d $HOME/.local/bin ] ; then
export PATH=$HOME/.local/bin:$PATH
fi
# pip installs user packages here, for example:
# pip3 install numpy --upgrade --user
if [ -d $HOME/.local ] ; then
export PYTHONUSERBASE=$HOME/.local/
fi
# locally installed python libraries
if [ -d $HOME/.local/lib ] ; then
# load python libraries and programs installed locally
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/.local/lib
export PYTHONPATH=$PYTHONPATH:$HOME/.local/lib
fi
# locally installed python binaries
if [ -d $HOME/.local/bin ] ; then
export PATH=$PATH:$HOME/.local/bin
fi
# autoenv for automatic environment variable loading
# on a per project basis (overrides cd)
#
# DEPRECATED
#
# if [ -d ~/.autoenv ] ; then
# source ~/.autoenv/activate.sh
# fi
# Check if we are running on a SLURM supercomputer cluster
if [ -x "$(command -v srun)" ] ; then
# based on http://stackoverflow.com/a/26759734/99379
source ~/src/robotics_setup/marcc-config.sh
fi
if [ -d ~/src/hub ] ; then
# shell completions for https://github.com/hub
# https://github.com/github/hub/tree/master/etc
eval "$(hub alias -s)"
fpath=(~/.zsh/completions $fpath)
autoload -U compinit && compinit
fi
# http://sourabhbajaj.com/mac-setup/iTerm/zsh.html
# Add env.sh
if [ -f ~/Projects/config/env.sh ] ; then
source ~/Projects/config/env.sh
fi
# https://www.iterm2.com/documentation-shell-integration.html
if [ -f ~/.iterm2_shell_integration.zsh ] ; then
if [ -z "$ZSH_VERSION" ]; then
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
fi
elif [ -f ~/.iterm2_shell_integration.bash ] ; then
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
fi
# https://www.iterm2.com/documentation-shell-integration.html
# add access to iterm2 imgcat and other utilities
if [ -d $HOME/.iterm2 ] ; then
export PATH="$PATH:$HOME/.iterm2"
fi