├── .autoenv ├── .bashrc ├── .byobu └── .tmux.conf ├── .config └── xonsh │ └── config.json ├── .robotics_setup ├── .theanorc ├── .xonshrc ├── .zpreztorc ├── .zshrc ├── LICENSE.txt ├── README.md ├── apps.sh ├── autoenv.sh ├── bazel.sh ├── brew.sh ├── bullet.sh ├── byobu-source.sh ├── caffe ├── Makefile.config └── caffe.sh ├── camodocal.sh ├── cartographer_ros.sh ├── ceres.sh ├── ceres ├── include │ └── internal │ │ └── config.h └── share │ └── Ceres │ ├── CeresConfig.cmake │ ├── CeresConfigVersion.cmake │ ├── CeresTargets-release.cmake │ ├── CeresTargets.cmake │ ├── FindEigen.cmake │ └── FindGlog.cmake ├── cmake-basis.sh ├── cmake_source.sh ├── co-fusion.sh ├── coco.sh ├── commandline_utils.sh ├── copyme.sh ├── costar.sh ├── cuda.sh ├── cuda_9.0_cudnn_7.0.sh ├── cudnn.sh ├── datasets ├── README.md ├── coco.sh ├── google_brain_robot_data │ ├── depth_image_encoding.py │ ├── download_grasp_listing.sh │ ├── download_push_listing.sh │ ├── grab_train_images.py │ ├── grasp_listing.txt │ └── push_listing.txt ├── imagenet.sh └── pascal_voc.sh ├── direnv.sh ├── docker.sh ├── download.sh ├── eigen3.sh ├── flatbuffers.sh ├── git.sh ├── golang.sh ├── googletest.sh ├── gpustat.sh ├── gpyopt.sh ├── grl_kuka.sh ├── gslicr.sh ├── guided_policy_search.sh ├── homebrew-robotics.sh ├── hub.sh ├── ide.sh ├── kalibr.sh ├── keras.sh ├── linux.sh ├── linuxbrew.sh ├── locomotion_robotics.sh ├── marcc-config.sh ├── marcc-install.sh ├── meshlab.sh ├── mongodb.sh ├── mujoco.sh ├── nn_grasp.sh ├── nodejs.sh ├── nvidia-docker.sh ├── nvidia.sh ├── openai.sh ├── opencv.sh ├── openimages.sh ├── pangolin.sh ├── pcl-python.sh ├── pip.sh ├── plotJuggler.sh ├── py_tools.sh ├── python.sh ├── pytorch.sh ├── qdirstat.sh ├── qt5.sh ├── reinforcement_learning.sh ├── remote_utils.sh ├── robot_grasp_detection.sh ├── robotics_tasks.sh ├── ros.sh ├── rtl8812AU_8821AU_linux.sh ├── sacred.sh ├── setup.sh ├── sonnet.sh ├── spdlog.sh ├── ssh.sh ├── tensorflow.sh ├── tensorflow_models.sh ├── tensorflow_slurm_manager.sh ├── tensorlayer.sh ├── tensorpack.sh ├── textmate.sh ├── tf-image-segmentation.sh ├── torch.sh ├── trtk.sh ├── video.sh ├── vrep.sh ├── xonsh.sh ├── zsh.sh └── zshpreztolinks.zsh /.autoenv: -------------------------------------------------------------------------------- 1 | 2 | # WARNING: OUTDATED, USE https://github.com/direnv/direnv 3 | 4 | # To use this file first install autenv.sh 5 | # Then copy this file from robotics_setup/.autoenv 6 | # to ~/src/.env 7 | # 8 | # This is the .env file that belongs in ~/src 9 | # which loads environment variables for the utilities 10 | # provided in github.com/ahundt/robotics_setup 11 | # once in the right location it will be loaded 12 | # by the autoenv app whenever you cd into the 13 | # ~/src directory. 14 | 15 | if [ -d $HOME/src/tf-image-segmentation ]; then 16 | export PYTHONPATH=$PYTHONPATH:$HOME/src/tf-image-segmentation 17 | fi 18 | 19 | if [ -d $HOME/src/tensorflow_slurm_manager ]; then 20 | export PYTHONPATH=$PYTHONPATH:$HOME/src/tensorflow_slurm_manager 21 | fi -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | 2 | source $HOME/.robotics_setup -------------------------------------------------------------------------------- /.byobu/.tmux.conf: -------------------------------------------------------------------------------- 1 | 2 | set -g default-shell /usr/bin/zsh 3 | set -g default-command /usr/bin/zsh 4 | # set -g default-shell ~/.local/bin/xonsh 5 | # set -g default-command ~/.local/bin/xonsh 6 | 7 | # from https://codeyarns.com/2016/01/28/how-to-use-mouse-in-byobu/ 8 | set -g mouse-select-pane on 9 | set -g mouse-select-window on 10 | set -g mouse-resize-pane on 11 | set -g mouse-utf8 on 12 | -------------------------------------------------------------------------------- /.config/xonsh/config.json: -------------------------------------------------------------------------------- 1 | {"env": { 2 | "SHELL_TYPE": "prompt_toolkit", 3 | "AUTO_SUGGEST": true, 4 | "PROMPT": "{env_name:{} }{INTENSE_PURPLE}{user}{NO_COLOR}@{DARK_YELLOW}{hostname}{BOLD_BLUE} {cwd}{branch_color}{curr_branch: {}}{NO_COLOR} {BOLD_BLUE}\n{prompt_end}{NO_COLOR} ", 5 | "XONSHRC": ["/etc/xonshrc", "~/.xonshrc"] 6 | }, 7 | "xontribs": ["mpl", "fzf-widgets", "prompt_ret_code"], 8 | "foreign_shells": [ 9 | {"shell": "bash", 10 | "login": true, 11 | "extra_args": ["--rcfile", "~/.bashrc"] 12 | }, 13 | {"shell": "zsh"} 14 | ] 15 | } -------------------------------------------------------------------------------- /.robotics_setup: -------------------------------------------------------------------------------- 1 | # for bash and zsh 2 | # https://github.com/ahundt/robotics_setup 3 | # Loads configuration of installed utilities 4 | # while skipping things that aren't set up 5 | 6 | 7 | ######################################## 8 | # Homebrew Setup in.zshrc file 9 | 10 | # Explanation: 11 | # - This script sets up the necessary environment variables for Homebrew. 12 | # - It prioritizes the Homebrew version matching the currently running architecture 13 | # and ensures its directory is at the beginning of the PATH. 14 | # - It uses 'command -v brew' to find a Homebrew installation, checks if it matches the 15 | # current architecture, and falls back to checking common locations if needed. 16 | # - It then runs 'brew shellenv' to set up the environment and checks if it succeeded. 17 | # - If any issues are detected, it prints informative warning messages. 18 | # 19 | # Variables set by 'brew shellenv': 20 | # - HOMEBREW_PREFIX: The directory where Homebrew is installed. 21 | # - HOMEBREW_REPOSITORY: The directory where Homebrew stores its core files. 22 | # - HOMEBREW_CELLAR: The directory where Homebrew installs packages. 23 | # - PATH: The variable that determines where your shell looks for executable files. 24 | # 'brew shellenv' adds the Homebrew bin directory to your PATH. 25 | 26 | # echo "Setting up Homebrew in your .zshrc file..." 27 | 28 | # Determine the architecture 29 | machine_arch=$(uname -m) 30 | if [ $? -ne 0 ] || [ -z "$machine_arch" ]; then 31 | echo "Warning: Failed to determine architecture using 'uname -m' in your .zshrc file." 32 | echo " Homebrew setup might not work correctly. Please check your system configuration." 33 | # Exit to prevent further execution with an unknown architecture 34 | return 1 35 | fi 36 | 37 | # Get the initial PATH 38 | initial_path="$PATH" 39 | 40 | # Determine the architecture-specific Homebrew location 41 | if [ "$machine_arch" = "arm64" ]; then 42 | arch_brew_path="/opt/homebrew/bin/brew" 43 | elif [ "$machine_arch" = "x86_64" ]; then 44 | arch_brew_path="/usr/local/bin/brew" 45 | else 46 | # Fallback for unknown architectures, use which brew 47 | arch_brew_path=$(which brew) 48 | fi 49 | 50 | # Check if the architecture-specific Homebrew exists 51 | if [ -f "$arch_brew_path" ]; then 52 | # Prioritize the architecture-specific Homebrew by adding it to the beginning of PATH 53 | export PATH="$arch_brew_path:$PATH" 54 | eval "$($arch_brew_path shellenv)" 55 | if [ $? -ne 0 ]; then 56 | echo "Warning: 'brew shellenv' failed in your .zshrc file." 57 | fi 58 | else 59 | # If the architecture-specific Homebrew is not found, check common locations 60 | if [ -f /opt/homebrew/bin/brew ]; then 61 | brew_path="/opt/homebrew/bin/brew" 62 | elif [ -f /usr/local/bin/brew ]; then 63 | brew_path="/usr/local/bin/brew" 64 | fi 65 | if [ -n "$brew_path" ]; then 66 | eval "$($brew_path shellenv)" 67 | if [ $? -ne 0 ]; then 68 | echo "Warning: 'brew shellenv' failed in your .zshrc file." 69 | fi 70 | fi 71 | fi 72 | 73 | # Check if 'brew shellenv' successfully set up the environment 74 | if [ "$PATH" = "$initial_path" ]; then 75 | echo "Warning: 'brew shellenv' did not modify PATH as expected in your .zshrc file." 76 | echo " Your architecture is $machine_arch." 77 | echo "Please make sure Homebrew is installed and configured correctly. You might need to" 78 | echo "update your PATH manually or reinstall Homebrew." 79 | fi 80 | 81 | # Check if necessary variables are set 82 | if ! [ -v HOMEBREW_PREFIX ] || ! [ -v HOMEBREW_REPOSITORY ] || ! [ -v HOMEBREW_CELLAR ]; then 83 | echo "Warning: Some Homebrew environment variables are not set in your .zshrc file." 84 | echo " Please check your Homebrew installation and configuration." 85 | fi 86 | 87 | # end Homebrew Setup in.zshrc file 88 | ####################################### 89 | 90 | # Source Prezto. 91 | if [ -n "$ZSH_VERSION" ]; then 92 | if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then 93 | source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" 94 | fi 95 | fi 96 | 97 | # ROS.org Robot Operating System 98 | # version: kinetic 99 | if [ -z "$ZSH_VERSION" ]; then 100 | # assume Zsh 101 | if [ -d /opt/ros/kinetic ] ; then 102 | source /opt/ros/kinetic/setup.zsh 103 | fi 104 | 105 | # ROS.org Robot Operating System 106 | # version: indigo 107 | if [ -d /opt/ros/indigo ] ; then 108 | source /opt/ros/indigo/setup.zsh 109 | fi 110 | elif [ -z "$BASH_VERSION" ]; then 111 | # assume Bash 112 | if [ -d /opt/ros/kinetic ] ; then 113 | source /opt/ros/kinetic/setup.bash 114 | fi 115 | 116 | # ROS.org Robot Operating System 117 | # version: indigo 118 | if [ -d /opt/ros/indigo ] ; then 119 | source /opt/ros/indigo/setup.bash 120 | fi 121 | fi 122 | 123 | 124 | # byobu shell session manager installed from source 125 | # see byobu-source.sh 126 | if [ -d $HOME/byobu/bin ] ; then 127 | export PATH=$HOME/byobu/bin:$PATH 128 | fi 129 | 130 | # costar_ws https://github.com/cpaxton/costar_stack 131 | # see costar.sh 132 | if [ -d ~/src/costar_ws ] ; then 133 | if [ -d /opt/ros ] ; then 134 | if [ -z "$ZSH_VERSION" ]; then 135 | # assume Zsh 136 | test -e "$HOME/src/costar_ws/devel/setup.zsh" && source "$HOME/src/costar_ws/devel/setup.zsh" 137 | elif [ -z "$BASH_VERSION" ]; then 138 | # assume Bash 139 | test -e "$HOME/src/costar_ws/devel/setup.bash" && source "$HOME/src/costar_ws/devel/setup.bash" 140 | fi 141 | fi 142 | fi 143 | 144 | # linuxbrew http://linuxbrew.sh/ 145 | if [ -d $HOME/.linuxbrew ]; then 146 | export PATH="$HOME/.linuxbrew/bin:$PATH" 147 | export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH" 148 | export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH" 149 | export PATH="$HOME/.linuxbrew/sbin:$PATH" 150 | fi 151 | 152 | # check for homebrew https://brew.sh 153 | # and make its binaries first on PATH 154 | which -s brew > /dev/null 155 | if [[ $? == 0 ]] ; then 156 | brew_path=`brew --prefix` 157 | export PATH="${brew_path}/bin:$PATH" 158 | 159 | # Check for brewed python https://docs.brew.sh/Homebrew-and-Python.html, 160 | # and if it is found make it the first python on the PATH 161 | brew ls --versions python > /dev/null 162 | if [[ $? == 0 ]] ; then 163 | # add homebrew python to the path 164 | export PATH="${brew_path}/opt/python/libexec/bin:$PATH" 165 | fi 166 | fi 167 | 168 | # nvidia cuda gpu compiler 169 | if [ -d /usr/local/cuda ] ; then 170 | export PATH=$PATH:/usr/local/cuda/bin 171 | fi 172 | 173 | # golang aka google go 174 | # https://golang.org/ 175 | # https://github.com/golang/go/wiki/Ubuntu 176 | if [ -d $HOME/go ] ; then 177 | export GOPATH=$HOME/go 178 | export PATH=$PATH:$GOPATH/bin 179 | fi 180 | 181 | # github.com/cfinn/gps 182 | if [ -d ~/src/gps ] ; then 183 | # load libraries for guided_policy_search.sh 184 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/src/gps/build/lib 185 | export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/src/gps/build/lib 186 | export PYTHONPATH=$PYTHONPATH:$HOME/src/gps/build/lib 187 | fi 188 | 189 | if [ -d /usr/local/cuda ] ; then 190 | # for tensorflow.sh build 191 | # see https://github.com/tensorflow/tensorflow/issues/15142#issuecomment-352773470 192 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs 193 | fi 194 | 195 | # github.com/tensorflow/models 196 | if [ -d ~/src/tf_models ] ; then 197 | # load libraries for tensorflow object detection api 198 | export PYTHONPATH=$PYTHONPATH:$HOME/src/tf_models/research/:$HOME/src/tf_models/research/slim 199 | fi 200 | 201 | # locally installed libraries 202 | if [ -d $HOME/lib ] ; then 203 | # load libraries and programs installed locally 204 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib 205 | export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/lib 206 | export PYTHONPATH=$PYTHONPATH:$HOME/lib 207 | fi 208 | 209 | # locally installed binaries 210 | if [ -d $HOME/bin ] ; then 211 | export PATH=$PATH:$HOME/bin 212 | fi 213 | 214 | # pip installs user packages here, for example: 215 | # pip3 install numpy --upgrade --user 216 | # https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUSERBASE 217 | if [ -d $HOME/.local/bin ] ; then 218 | export PATH=$HOME/.local/bin:$PATH 219 | fi 220 | 221 | # pip installs user packages here, for example: 222 | # pip3 install numpy --upgrade --user 223 | if [ -d $HOME/.local ] ; then 224 | export PYTHONUSERBASE=$HOME/.local/ 225 | fi 226 | 227 | # locally installed python libraries 228 | if [ -d $HOME/.local/lib ] ; then 229 | # load python libraries and programs installed locally 230 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib 231 | export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/.local/lib 232 | export PYTHONPATH=$PYTHONPATH:$HOME/.local/lib 233 | fi 234 | 235 | # locally installed python binaries 236 | if [ -d $HOME/.local/bin ] ; then 237 | export PATH=$PATH:$HOME/.local/bin 238 | fi 239 | 240 | # autoenv for automatic environment variable loading 241 | # on a per project basis (overrides cd) 242 | # 243 | # DEPRECATED 244 | # 245 | # if [ -d ~/.autoenv ] ; then 246 | # source ~/.autoenv/activate.sh 247 | # fi 248 | 249 | 250 | # Check if we are running on a SLURM supercomputer cluster 251 | if [ -x "$(command -v srun)" ] ; then 252 | # based on http://stackoverflow.com/a/26759734/99379 253 | source ~/src/robotics_setup/marcc-config.sh 254 | fi 255 | 256 | 257 | if [ -d ~/src/hub ] ; then 258 | # shell completions for https://github.com/hub 259 | # https://github.com/github/hub/tree/master/etc 260 | eval "$(hub alias -s)" 261 | fpath=(~/.zsh/completions $fpath) 262 | autoload -U compinit && compinit 263 | fi 264 | 265 | 266 | # http://sourabhbajaj.com/mac-setup/iTerm/zsh.html 267 | # Add env.sh 268 | if [ -f ~/Projects/config/env.sh ] ; then 269 | source ~/Projects/config/env.sh 270 | fi 271 | 272 | 273 | # https://www.iterm2.com/documentation-shell-integration.html 274 | if [ -f ~/.iterm2_shell_integration.zsh ] ; then 275 | if [ -z "$ZSH_VERSION" ]; then 276 | test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" 277 | fi 278 | elif [ -f ~/.iterm2_shell_integration.bash ] ; then 279 | test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" 280 | fi 281 | 282 | 283 | # https://www.iterm2.com/documentation-shell-integration.html 284 | # add access to iterm2 imgcat and other utilities 285 | if [ -d $HOME/.iterm2 ] ; then 286 | export PATH="$PATH:$HOME/.iterm2" 287 | fi 288 | 289 | # Ensure the 'trash' command is available for safely deleting files: 290 | # - The 'trash' command (from Homebrew, macOS) moves files to ~/.Trash instead of permanently deleting them, 291 | # providing a safer alternative to 'rm'. 292 | # - This block only runs on macOS (OSTYPE=darwin*), and only adds Homebrew's trash to PATH if not already available. 293 | # - This avoids overriding a system or user-installed version and ensures consistent behavior in scripts and interactive shells. 294 | if [[ "$OSTYPE" == "darwin"* ]] && ! command -v trash &> /dev/null && [ -f /opt/homebrew/opt/trash/bin/trash ]; then 295 | export PATH="/opt/homebrew/opt/trash/bin:$PATH" 296 | fi 297 | -------------------------------------------------------------------------------- /.theanorc: -------------------------------------------------------------------------------- 1 | [cuda] 2 | root = /usr/local/cuda/ -------------------------------------------------------------------------------- /.xonshrc: -------------------------------------------------------------------------------- 1 | ## adjust some paths 2 | 3 | $PROMPT = "{env_name:{} }{INTENSE_PURPLE}{user}{NO_COLOR}@{INTENSE_YELLOW}{hostname}{BOLD_BLUE} {cwd}{branch_color}{curr_branch: {}}{NO_COLOR} {BOLD_BLUE}\n{prompt_end}{NO_COLOR} " 4 | 5 | # Set the home directory for your projects 6 | $PROJECT_DIRS = ['~/src'] 7 | 8 | # add local bin dir to path 9 | $PATH.append($HOME + '/bin') 10 | $PATH.append($HOME + '.local/bin') 11 | 12 | #$LD_LIBRARY_PATH = ['/home/scopatz/.local/lib', '/home/scopatz/miniconda3/lib', ''] 13 | # 14 | ## alias to quit AwesomeWM from the terminal 15 | #def _quit_awesome(args, stdin=None): 16 | # lines = $(ps ux | grep "gnome-session --session=awesome").splitlines() 17 | # pids = [l.split()[1] for l in lines] 18 | # for pid in pids: 19 | # kill @(pid) 20 | # 21 | #aliases['qa'] = _quit_awesome 22 | # 23 | ## some customization options, see https://xon.sh/envvars.html for details 24 | #$MULTILINE_PROMPT = '`·.,¸,.·*¯`·.,¸,.·*¯' 25 | #$XONSH_SHOW_TRACEBACK = True 26 | #$XONSH_STORE_STDOUT = True 27 | $XONSH_HISTORY_MATCH_ANYWHERE = True 28 | $COMPLETIONS_CONFIRM = True 29 | $XONSH_AUTOPAIR = True 30 | 31 | xontrib load autojump autoxsh coreutils jedi mpl vox vox_tabcomplete avox powerline 32 | 33 | #@events.on_chdir 34 | #def add_to_file(olddir, newdir, **kw): 35 | # with open(g`~/.dirhist`[0], 'a') as dh: 36 | # print(newdir, file=dh) 37 | -------------------------------------------------------------------------------- /.zpreztorc: -------------------------------------------------------------------------------- 1 | # 2 | # Sets Prezto options. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | 8 | # 9 | # General 10 | # 11 | 12 | # Set case-sensitivity for completion, history lookup, etc. 13 | # zstyle ':prezto:*:*' case-sensitive 'yes' 14 | 15 | # Color output (auto set to 'no' on dumb terminals). 16 | zstyle ':prezto:*:*' color 'yes' 17 | 18 | # Set the Zsh modules to load (man zshmodules). 19 | # zstyle ':prezto:load' zmodule 'attr' 'stat' 20 | 21 | # Set the Zsh functions to load (man zshcontrib). 22 | # zstyle ':prezto:load' zfunction 'zargs' 'zmv' 23 | 24 | # Set the Prezto modules to load (browse modules). 25 | # The order matters. 26 | zstyle ':prezto:load' pmodule \ 27 | 'environment' \ 28 | 'terminal' \ 29 | 'editor' \ 30 | 'history' \ 31 | 'directory' \ 32 | 'spectrum' \ 33 | 'utility' \ 34 | 'completion' \ 35 | 'git' \ 36 | 'syntax-highlighting' \ 37 | 'history-substring-search' \ 38 | 'prompt' 39 | 40 | # 41 | # Autosuggestions 42 | # 43 | 44 | # Set the query found color. 45 | # zstyle ':prezto:module:autosuggestions:color' found '' 46 | 47 | # 48 | # Editor 49 | # 50 | 51 | # Set the key mapping style to 'emacs' or 'vi'. 52 | zstyle ':prezto:module:editor' key-bindings 'emacs' 53 | 54 | # Auto convert .... to ../.. 55 | # zstyle ':prezto:module:editor' dot-expansion 'yes' 56 | 57 | # 58 | # Git 59 | # 60 | 61 | # Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'. 62 | # zstyle ':prezto:module:git:status:ignore' submodules 'all' 63 | 64 | # 65 | # GNU Utility 66 | # 67 | 68 | # Set the command prefix on non-GNU systems. 69 | # zstyle ':prezto:module:gnu-utility' prefix 'g' 70 | 71 | # 72 | # History Substring Search 73 | # 74 | 75 | # Set the query found color. 76 | # zstyle ':prezto:module:history-substring-search:color' found '' 77 | 78 | # Set the query not found color. 79 | # zstyle ':prezto:module:history-substring-search:color' not-found '' 80 | 81 | # Set the search globbing flags. 82 | # zstyle ':prezto:module:history-substring-search' globbing-flags '' 83 | 84 | # 85 | # Pacman 86 | # 87 | 88 | # Set the Pacman frontend. 89 | # zstyle ':prezto:module:pacman' frontend 'yaourt' 90 | 91 | # 92 | # Prompt 93 | # 94 | 95 | # Set the prompt theme to load. 96 | # Setting it to 'random' loads a random theme. 97 | # Auto set to 'off' on dumb terminals. 98 | zstyle ':prezto:module:prompt' theme 'giddie' 99 | 100 | # 101 | # Ruby 102 | # 103 | 104 | # Auto switch the Ruby version on directory change. 105 | # zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' 106 | 107 | # 108 | # Screen 109 | # 110 | 111 | # Auto start a session when Zsh is launched in a local terminal. 112 | # zstyle ':prezto:module:screen:auto-start' local 'yes' 113 | 114 | # Auto start a session when Zsh is launched in a SSH connection. 115 | # zstyle ':prezto:module:screen:auto-start' remote 'yes' 116 | 117 | # 118 | # SSH 119 | # 120 | 121 | # Set the SSH identities to load into the agent. 122 | # zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github' 123 | 124 | # 125 | # Syntax Highlighting 126 | # 127 | 128 | # Set syntax highlighters. 129 | # By default, only the main highlighter is enabled. 130 | # zstyle ':prezto:module:syntax-highlighting' highlighters \ 131 | # 'main' \ 132 | # 'brackets' \ 133 | # 'pattern' \ 134 | # 'line' \ 135 | # 'cursor' \ 136 | # 'root' 137 | # 138 | # Set syntax highlighting styles. 139 | # zstyle ':prezto:module:syntax-highlighting' styles \ 140 | # 'builtin' 'bg=blue' \ 141 | # 'command' 'bg=blue' \ 142 | # 'function' 'bg=blue' 143 | 144 | # 145 | # Terminal 146 | # 147 | 148 | # Auto set the tab and window titles. 149 | # zstyle ':prezto:module:terminal' auto-title 'yes' 150 | 151 | # Set the window title format. 152 | # zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' 153 | 154 | # Set the tab title format. 155 | # zstyle ':prezto:module:terminal:tab-title' format '%m: %s' 156 | 157 | # 158 | # Tmux 159 | # 160 | 161 | # Auto start a session when Zsh is launched in a local terminal. 162 | # zstyle ':prezto:module:tmux:auto-start' local 'yes' 163 | 164 | # Auto start a session when Zsh is launched in a SSH connection. 165 | # zstyle ':prezto:module:tmux:auto-start' remote 'yes' 166 | 167 | # Integrate with iTerm2. 168 | # zstyle ':prezto:module:tmux:iterm' integrate 'yes' 169 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # 2 | # Executes commands at the start of an interactive session. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # Andrew Hundt 7 | # 8 | 9 | # Source Prezto. 10 | if [ -n "$ZSH_VERSION" ]; then 11 | if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then 12 | source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" 13 | fi 14 | fi 15 | 16 | # Customize to your needs... 17 | 18 | if [ -f $HOME/.robotics_setup ] ; then 19 | source $HOME/.robotics_setup 20 | fi 21 | 22 | 23 | # Change terminal title so it is easier to tell 24 | # the current directory and make terminal titles more useful 25 | # This title can also be read by timing.app https://timingapp.com/ 26 | function update_terminal_title() { 27 | print -Pn "\e]0;%n :: %~/ \a" 28 | } 29 | 30 | 31 | # oh-my zsh theme 32 | #ZSH_THEME="dstufft" 33 | # similar theme on prezto: giddie 34 | 35 | export GITHUB_USERNAME=ahundt 36 | export GITRIEVAL_TOKEN=e0f06fd379507257a99663a370befe1e6a8e56d2 37 | export GITRIEVAL_TOKEN=fd68b752e3a35a712c9e90e94432ae642b285e59 38 | export GITRIEVAL_TOKEN=8ede8cdd3811f8274fc383d6325378f465e31c71 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ubuntu Setup Scripts for Robotics & Machine Learning 2 | 3 | ![Robotics Automated Setup](https://user-images.githubusercontent.com/55744/113743633-e2a92800-96d1-11eb-9c09-611af3ca626d.png) 4 | 5 | This contains a set of linux setup scripts consolidated from across the web to make it easy to set up a new computer for robotics and deep learning, with links to the original sources and brief descriptions in the comments of each script. Install scripts are kept simple and minimal so you can easily change them for your needs. 6 | 7 | Manual steps are necessary for some scripts, so be sure to check the comments! 8 | 9 | These scripts are written for: 10 | - x86_64 Ubuntu Linux 14.04, 16.04, 18.04 11 | - NVIDIA GPUs such as GeForce GTX 1080, and Titan X. 12 | 13 | There is also some support for: 14 | - [slurm compute clusters](https://slurm.schedmd.com/) 15 | - MacOS when used in combination with the [homebrew-robotics](https://github.com/ahundt/homebrew-robotics) homebrew install script repository. 16 | 17 | 18 | There are also useful config files in this repository named `.*` that may not be immediately visible, such as `.byobu/.tmux.conf`. 19 | 20 | ## Getting started 21 | 22 | 23 | Typically the source code for libraries will be put in `~/src/`, and binaries in `/usr/local`, but this rule is not hard and fast because some tools like nvidia's cuda must go elsewhere. 24 | 25 | ``` 26 | mkdir -p ~/src 27 | cd ~/src 28 | git clone git@github.com:ahundt/robotics_setup.git 29 | cd ~/src/robotics_setup 30 | # be sure to look at the script for special instructions! 31 | vim .sh 32 | ./.sh 33 | # if the above line doesn't work you can also do sh .sh 34 | ``` 35 | 36 | ### Open the shell scripts 37 | 38 | Be sure to open the install scripts before you run them. There are often manual steps, more details, and links to the reference documentation and blogs used to write these scripts. 39 | 40 | ### Command line, terminal, zsh 41 | 42 | Recommended command line utils include htop, vim, [tmux](https://github.com/tmux/tmux/wiki), [byobu](http://byobu.co/). To install them run: 43 | 44 | ``` 45 | ./commandline_utils.sh 46 | ``` 47 | 48 | The recommended terminal environment and shell is zsh with [prezto](https://github.com/sorin-ionescu/prezto) utilities, to install and configure it to run with tmux and byobu so you can have multiple terminal windows and connect via ssh without losing your place or closing your running terminal applications: 49 | 50 | ``` 51 | ./zsh.sh 52 | ``` 53 | 54 | This will automatically set up `.robotics_setup`, a configuration automatically loads other tools you can install via this repository including ROS, cuda, google go, locally installed binaries, linuxbrew, etc. 55 | 56 | ### Xonsh shell 57 | 58 | [xon.sh](https://xon.sh) is a terminal shell like bash and zsh that is like a superset of python and bash. It is very useful for robotics and machine learning if you want to do some math on robot data in your shell and run applications in a single terminal, plus retain the history of your commands so you can reproduce your work. You can install xonsh with the `xonsh.sh` instructions and then [enable it as the default shell](http://xon.sh/customization.html#set-xonsh-as-my-default-shell). 59 | 60 | [byobu](http://byobu.co), lets you have multiple terminals running over a single connection that are persistent across dropped connections. If you want to use it with xonsh, make sure to update your `~/.byobu/.tmux.conf` to specify xonsh instead of zsh: 61 | 62 | ``` 63 | # set -g default-shell /usr/bin/zsh 64 | # set -g default-command /usr/bin/zsh 65 | set -g default-shell ~/.local/bin/xonsh 66 | set -g default-command ~/.local/bin/xonsh 67 | ``` 68 | 69 | 70 | ## Additional helpful tips 71 | 72 | We highly recommend putting this repository in `~/src`, but that's not required. 73 | To make your shell utilize the tools you've installed via `robotics_setup`: 74 | 75 | # Add this to your ~/.bashrc or your ~/.zshrc 76 | # From github.com/ahundt/robotics_setup 77 | source ~/src/robotics_setup/.robotics_setup 78 | 79 | For a pile of info snippets to troubleshoot a variety of problems you might encounter see: 80 | 81 | https://github.com/ahundt/awesome-stuff 82 | 83 | For robotics resources see: 84 | 85 | https://github.com/ahundt/awesome-robotics 86 | 87 | For great instructions for some of the best tools to use for development (much applies to non-mac too) see: 88 | 89 | http://sourabhbajaj.com/mac-setup/ 90 | 91 | For other information on a huge range of topics see: 92 | 93 | https://github.com/sindresorhus/awesome 94 | 95 | # Troubleshooting 96 | 97 | All scripts are set to exit immediately on any error so it will give you a chance to fix the problem without making a mess on your computer. 98 | 99 | ## Ubuntu 100 | 101 | ### Script exited without installing the software 102 | 103 | If you run a script and the software was not installed, the most likely culprit is the repositories you have configured on ubuntu. If any repository returns an error these scripts will exit, to fix it look at which repositories are in the command line error message, and follow these instructions to remove them: 104 | 105 | - [how to remove a repository](https://askubuntu.com/questions/43345/how-to-remove-a-repository) 106 | 107 | # Alternatives 108 | 109 | For something with more advanced capabilities than this repository, though not always easier, I suggest https://brew.sh and https://linuxbrew.sh. 110 | -------------------------------------------------------------------------------- /apps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "##############" 4 | echo "# Apps Setup #" 5 | echo "##############" 6 | echo "" 7 | echo "Installs apps such as google chrome" 8 | echo "" 9 | echo "https://help.ubuntu.com/community/Repositories/Ubuntu" 10 | echo "" 11 | echo "@author Andrew Hundt " 12 | echo "" 13 | 14 | 15 | # source: https://gist.github.com/phatblat/1713458 16 | # Save script's current directory 17 | DIR=$(pwd) 18 | 19 | set -e 20 | set -u 21 | set -x 22 | 23 | sudo add-apt-repository restricted 24 | sudo add-apt-repository universe 25 | sudo add-apt-repository multiverse 26 | 27 | echo "###############" 28 | echo "# Google Chrome" 29 | echo "###############" 30 | echo "" 31 | echo "# http://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/install-google-chrome-on-ubuntu-16-04.html" 32 | echo "" 33 | 34 | # curl is necessary for downloading chrome 35 | sudo apt-get install -y curl 36 | if [ ! -f ~/Downloads/google-chrome-stable_current_amd64.deb ] 37 | then 38 | curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb --output ~/Downloads/google-chrome-stable_current_amd64.deb 39 | fi 40 | 41 | sudo apt-get install -y libxss1 libgconf2-4 libappindicator1 libindicator7 libpango1.0-0 libpangox-1.0-0 42 | sudo dpkg -i ~/Downloads/google-chrome-stable_current_amd64.deb 43 | 44 | cd $DIR 45 | -------------------------------------------------------------------------------- /autoenv.sh: -------------------------------------------------------------------------------- 1 | 2 | DIR=$(pwd) 3 | 4 | set -e 5 | set -u 6 | set -x 7 | 8 | echo "###############################################" 9 | echo "# AUTOENV IS DEPRECATED, USE DIRENV https://github.com/direnv/direnv" 10 | echo "###############################################" 11 | echo "#" 12 | echo "# github.com/jhollowayj/tensorflow_slurm_manager" 13 | echo "#" 14 | echo "# MANUAL STEPS: either install robotics_setup/.zshrc via zshrc.sh or run:" 15 | echo "# $ echo 'source ~/.autoenv/activate.sh' >> ~/.bashrc" 16 | 17 | if [ ! -d ~/.autoenv ] 18 | then 19 | git clone https://github.com/kennethreitz/autoenv ~/.autoenv 20 | fi 21 | 22 | cd ~/.autoenv 23 | git pull 24 | 25 | # TODO(ahundt): install or add to path config 26 | 27 | cd $DIR 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /bazel.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# Bazel https://bazel.build/" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# Build and test software of any size, quickly and reliably " 15 | 16 | 17 | # os specific setup 18 | OS=`uname` 19 | case $OS in 20 | 'Linux') 21 | echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list 22 | curl https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add - 23 | sudo apt-get update 24 | sudo apt-get install -y bazel 25 | sudo apt-get upgrade bazel 26 | ;; 27 | *) ;; 28 | 'Darwin') 29 | OS='Mac' 30 | brew install bazel 31 | ;; 32 | esac 33 | 34 | 35 | cd $DIR -------------------------------------------------------------------------------- /brew.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "" 4 | echo "This script is intended to setup CUDA and CUDNN" 5 | echo "@author Andrew Hundt " 6 | echo "" 7 | 8 | 9 | # source: https://gist.github.com/phatblat/1713458 10 | # Save script's current directory 11 | DIR=$(pwd) 12 | 13 | # /bin/bash 14 | set -e 15 | set -u 16 | set -x 17 | 18 | 19 | sudo apt-get -y update 20 | # minimal linuxbrew requirements 21 | sudo apt-get install -y build-essential curl git python-setuptools ruby 22 | 23 | # 24 | # Check if Homebrew is installed 25 | # 26 | if ! [ -x "$(command -v brew)" ] ; then 27 | 28 | OS=`uname` 29 | case $OS in 30 | 'Linux') 31 | OS='Linux' 32 | alias ls='ls --color=auto' 33 | curl -fsSL https://raw.githubusercontent.com/ahundt/homebrew-robotics/master/linuxbrew.sh | bash /dev/stdin 34 | 35 | # Add brew path zshrc if it isn't already present 36 | export PATH="$HOME/.linuxbrew/bin:$PATH" 37 | #export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH" 38 | #export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH" 39 | FILE=~/.zshrc 40 | grep -q "/.linuxbrew/bin" "$FILE" || echo "export PATH=\"\$HOME/.linuxbrew/bin:\$PATH\"" >> "$FILE" 41 | #grep -q "$MANPATH" "$FILE" || echo "$MANPATH" >> "$FILE" 42 | #grep -q "$INFOPATH" "$FILE" || echo "$INFOPATH" >> "$FILE" 43 | ;; 44 | 'FreeBSD') 45 | OS='FreeBSD' 46 | alias ls='ls -G' 47 | ;; 48 | 'WindowsNT') 49 | OS='Windows' 50 | ;; 51 | 'Darwin') 52 | OS='Mac' 53 | /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" 54 | ;; 55 | 'SunOS') 56 | OS='Solaris' 57 | ;; 58 | 'AIX') ;; 59 | *) ;; 60 | esac 61 | else 62 | brew update 63 | fi 64 | 65 | 66 | 67 | 68 | cd $DIR 69 | -------------------------------------------------------------------------------- /bullet.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | 5 | # source: https://gist.github.com/phatblat/1713458 6 | # Save script's current directory 7 | DIR=$(pwd) 8 | 9 | # /bin/bash 10 | set -e 11 | set -u 12 | set -x 13 | 14 | 15 | 16 | echo "###############################################" 17 | echo "# Bullet Physics and Robot Simulator" 18 | echo "###############################################" 19 | echo "# https://github.com/bulletphysics/bullet3" 20 | echo "# http://pybullet.org/" 21 | echo "#" 22 | echo "# pybullet users may just want to install manually with pip:" 23 | echo "# pip install pybullet" 24 | 25 | sudo apt-get install libglew-dev 26 | 27 | cd ~/src 28 | if [ ! -d ~/src/bullet ] 29 | then 30 | git clone https://github.com/bulletphysics/bullet3.git bullet 31 | cd bullet 32 | mkdir build 33 | fi 34 | cd ~/src/bullet 35 | git pull 36 | cd ~/src/bullet/build 37 | 38 | # get the path to the python exeuctable such as /usr/bin/python3 39 | PYTHON_EXECUTABLE=`which python3` 40 | # get the python version string such as "3.6.2" 41 | PYTHON_VERSION=`${PYTHON_EXECUTABLE} -c "import sys; print('%s' % '.'.join(map(lambda x:str(x), sys.version_info[0:3])))"` 42 | PYTHON_INCLUDE_DIR=`${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())"` 43 | PYTHON_LIB_DIR=`${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(plat_specific=1))"` 44 | 45 | cmake .. \ 46 | -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG \ 47 | -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG \ 48 | -DCMAKE_INSTALL_PREFIX=/usr/local \ 49 | -DCMAKE_BUILD_TYPE=Release \ 50 | -DCMAKE_FIND_FRAMEWORK=LAST \ 51 | -DCMAKE_VERBOSE_MAKEFILE=ON \ 52 | -Wno-dev \ 53 | -DHAVE_CLOCK_GETTIME:INTERNAL=0 \ 54 | -DINSTALL_EXTRA_LIBS=ON \ 55 | -DBUILD_UNIT_TESTS=OFF \ 56 | -DUSE_DOUBLE_PRECISION=ON \ 57 | -DBUILD_BULLET2_DEMOS=ON \ 58 | -DBUILD_PYBULLET=ON \ 59 | -DBUILD_PYBULLET_NUMPY=ON \ 60 | -DBUILD_PYBULLET_CLSOCKET=ON \ 61 | -DBUILD_PYBULLET_ENET=ON \ 62 | -DBUILD_ENET=ON \ 63 | -DBUILD_CLSOCKET=ON \ 64 | -DBUILD_SHARED_LIBS=ON \ 65 | -DPYTHON_VERSION_PYBULLET=${PYTHON_VERSION} \ 66 | -DEXACT_PYTHON_VERSION=ON 67 | 68 | # just use the cmake script to find the exact 69 | # version, disabling other items below 70 | # -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} \ 71 | # -DPYTHON_LIBRARY=${PYTHON_LIB_DIR} 72 | 73 | make -j 74 | 75 | cd .. 76 | 77 | # disable if you actually need the local version 78 | pip3 install pybullet baselines gym --upgrade --user 79 | 80 | cd $DIR -------------------------------------------------------------------------------- /byobu-source.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "#########################################################################" 10 | echo "# byobu shell session manager http://byobu.org installation from source" 11 | echo "#########################################################################" 12 | echo "# ON UBUNTU YOU PROBABLY REALLY WANT TO RUN commandline_utils.sh" 13 | echo "#" 14 | echo "# byobu makes it so you can access multiple remote shell sessions" 15 | echo "# via a single remote ssh session, and keep things from being terminated" 16 | echo "# if you get disconnected accidentally" 17 | echo "" 18 | echo "Based on instructions in:" 19 | echo " http://bazaar.launchpad.net/~kirkland/byobu/trunk/view/head:/README" 20 | echo "Installation bug on MARCC:" 21 | echo " https://bugs.launchpad.net/byobu/+bug/1673232" 22 | 23 | mkdir -p ~/src 24 | cd ~/src 25 | 26 | if [ ! -d ~/src/byobu ] ; then 27 | git clone git://github.com/dustinkirkland/byobu.git byobu 28 | fi 29 | 30 | cd byobu 31 | git pull 32 | 33 | if [ ! -f ~/src/byobu/ChangeLog ] ; then 34 | touch ~/src/byobu/ChangeLog 35 | fi 36 | 37 | aclocal 38 | automake --add-missing 39 | 40 | autoconf 41 | 42 | ./configure --prefix="$HOME/byobu" 43 | # original configure command: 44 | #./configure --prefix="$HOME/byobu" 45 | make install 46 | 47 | cd $DIR -------------------------------------------------------------------------------- /caffe/Makefile.config: -------------------------------------------------------------------------------- 1 | ## Refer to http://caffe.berkeleyvision.org/installation.html 2 | # Contributions simplifying and improving our build system are welcome! 3 | 4 | # cuDNN acceleration switch (uncomment to build with cuDNN). 5 | USE_CUDNN := 1 6 | 7 | # CPU-only switch (uncomment to build without GPU support). 8 | # CPU_ONLY := 1 9 | 10 | # uncomment to disable IO dependencies and corresponding data layers 11 | # USE_OPENCV := 0 12 | # USE_LEVELDB := 0 13 | # USE_LMDB := 0 14 | 15 | # uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary) 16 | # You should not set this flag if you will be reading LMDBs with any 17 | # possibility of simultaneous read and write 18 | # ALLOW_LMDB_NOLOCK := 1 19 | 20 | # Uncomment if you're using OpenCV 3 21 | OPENCV_VERSION := 3 22 | 23 | # To customize your choice of compiler, uncomment and set the following. 24 | # N.B. the default for Linux is g++ and the default for OSX is clang++ 25 | # CUSTOM_CXX := g++ 26 | 27 | # CUDA directory contains bin/ and lib/ directories that we need. 28 | CUDA_DIR := /usr/local/cuda 29 | # On Ubuntu 14.04, if cuda tools are installed via 30 | # "sudo apt-get install nvidia-cuda-toolkit" then use this instead: 31 | # CUDA_DIR := /usr 32 | 33 | # CUDA architecture setting: going with all of them. 34 | # For CUDA < 6.0, comment the *_50 lines for compatibility. 35 | CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ 36 | -gencode arch=compute_20,code=sm_21 \ 37 | -gencode arch=compute_30,code=sm_30 \ 38 | -gencode arch=compute_35,code=sm_35 \ 39 | -gencode arch=compute_50,code=sm_50 \ 40 | -gencode arch=compute_50,code=compute_50 41 | 42 | # BLAS choice: 43 | # atlas for ATLAS (default) 44 | # mkl for MKL 45 | # open for OpenBlas 46 | BLAS := open 47 | # Custom (MKL/ATLAS/OpenBLAS) include and lib directories. 48 | # Leave commented to accept the defaults for your choice of BLAS 49 | # (which should work)! 50 | # BLAS_INCLUDE := /path/to/your/blas 51 | # BLAS_LIB := /path/to/your/blas 52 | 53 | # Homebrew puts openblas in a directory that is not on the standard search path 54 | # BLAS_INCLUDE := $(shell brew --prefix openblas)/include 55 | # BLAS_LIB := $(shell brew --prefix openblas)/lib 56 | 57 | # This is required only if you will compile the matlab interface. 58 | # MATLAB directory should contain the mex binary in /bin. 59 | # MATLAB_DIR := /usr/local 60 | # MATLAB_DIR := /Applications/MATLAB_R2012b.app 61 | 62 | # NOTE: this is required only if you will compile the python interface. 63 | # We need to be able to find Python.h and numpy/arrayobject.h. 64 | PYTHON_INCLUDE := /usr/include/python2.7 \ 65 | /usr/lib/python2.7/dist-packages/numpy/core/include \ 66 | /usr/local/lib/python2.7/dist-packages/numpy/core/include 67 | # Anaconda Python distribution is quite popular. Include path: 68 | # Verify anaconda location, sometimes it's in root. 69 | # ANACONDA_HOME := $(HOME)/anaconda 70 | # PYTHON_INCLUDE := $(ANACONDA_HOME)/include \ 71 | # $(ANACONDA_HOME)/include/python2.7 \ 72 | # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \ 73 | 74 | # Uncomment to use Python 3 (default is Python 2) 75 | # PYTHON_LIBRARIES := boost_python3 python3.5m 76 | # PYTHON_INCLUDE := /usr/include/python3.5m \ 77 | # /usr/lib/python3.5/dist-packages/numpy/core/include 78 | 79 | # We need to be able to find libpythonX.X.so or .dylib. 80 | PYTHON_LIB := /usr/lib 81 | # PYTHON_LIB := $(ANACONDA_HOME)/lib 82 | 83 | # Homebrew installs numpy in a non standard path (keg only) 84 | # PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include 85 | # PYTHON_LIB += $(shell brew --prefix numpy)/lib 86 | 87 | # Uncomment to support layers written in Python (will link against Python libs) 88 | # WITH_PYTHON_LAYER := 1 89 | 90 | # Whatever else you find you need goes here. 91 | INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include $(PYTHON_INCLUDE) /usr/include/hdf5/serial/ 92 | LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/ /opt/ros/kinetic/lib/ 93 | 94 | # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies 95 | # INCLUDE_DIRS += $(shell brew --prefix)/include 96 | # LIBRARY_DIRS += $(shell brew --prefix)/lib 97 | 98 | # Uncomment to use `pkg-config` to specify OpenCV library paths. 99 | # (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.) 100 | # USE_PKG_CONFIG := 1 101 | 102 | # N.B. both build and distribute dirs are cleared on `make clean` 103 | BUILD_DIR := build 104 | DISTRIBUTE_DIR := distribute 105 | 106 | # Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171 107 | # DEBUG := 1 108 | 109 | # The ID of the GPU that 'make runtest' will use to run unit tests. 110 | TEST_GPUID := 0 111 | 112 | # enable pretty build (comment to see full commands) 113 | #Q ?= @ 114 | -------------------------------------------------------------------------------- /caffe/caffe.sh: -------------------------------------------------------------------------------- 1 | # Caffe deep learning installation script 2 | 3 | # cuda script should be run before this one because it 4 | # seemed to need some manual steps documented there 5 | 6 | 7 | # source: https://gist.github.com/phatblat/1713458 8 | # Save script's current directory 9 | DIR=$(pwd) 10 | 11 | # /bin/bash 12 | set -e 13 | set -u 14 | set -x 15 | 16 | 17 | # 16.04 official caffe instructions: https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide 18 | # adapted from: https://hub.docker.com/r/tleyden5iwx/caffe-gpu-master/~/dockerfile/ 19 | 20 | sudo apt-get update && sudo apt-get install -y \ 21 | bc \ 22 | cmake \ 23 | curl \ 24 | gcc \ 25 | g++ \ 26 | gfortran \ 27 | git \ 28 | libprotobuf-dev \ 29 | libgoogle-glog-dev \ 30 | libgflags-dev \ 31 | libleveldb-dev \ 32 | libsnappy-dev \ 33 | libboost-all-dev \ 34 | libhdf5-serial-dev \ 35 | liblmdb-dev \ 36 | libjpeg62 \ 37 | libfreeimage-dev \ 38 | libatlas-base-dev \ 39 | libopenblas-dev \ 40 | pkgconf \ 41 | protobuf-compiler \ 42 | python-dev \ 43 | python-pip \ 44 | unzip \ 45 | wget 46 | 47 | # OpenCV is excluded because a later one is provided by ROS 48 | # libopencv-dev \ 49 | 50 | . ../python.sh 51 | 52 | # temporarily commenting because the cuda script 53 | # seemed to need some manual steps documented there 54 | #. ../cuda.sh 55 | 56 | 57 | # This needs to be made conditional, and check that it is the right place 58 | #echo "/usr/local/cuda/lib64" > /etc/ld.so.conf.d/cuda.conf && \ 59 | # ldconfig 60 | 61 | # install https://github.com/jorisv/Eigen3ToPython 62 | cd ~/src 63 | if [ ! -d ~/src/caffe ] 64 | then 65 | git clone --recursive https://github.com/BVLC/caffe.git 66 | fi 67 | 68 | cd caffe 69 | git pull 70 | 71 | pip install -r python/requirements.txt 72 | 73 | if [ -f ~/src/caffe/Makefile.config ] 74 | then 75 | rm ~/src/caffe/Makefile.config 76 | fi 77 | 78 | cp $DIR/Makefile.config Makefile.config 79 | # Adjust Makefile.config (for example, if using Anaconda Python, or if cuDNN is desired) 80 | 81 | # to find where some files are use for example: 82 | # dpkg-query -L ros-kinetic-opencv3 83 | 84 | if [ ! -f /usr/lib/x86_64-linux-gnu/libhdf5.so ] 85 | then 86 | sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so /usr/lib/x86_64-linux-gnu/libhdf5.so 87 | sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so /usr/lib/x86_64-linux-gnu/libhdf5_hl.so 88 | fi 89 | 90 | # Assumes you are using ROS kinetic for your OpenCV installation 91 | if [ ! -f /opt/ros/kinetic/lib/libopencv_imgcodecs.so ] 92 | then 93 | sudo ln -s /opt/ros/kinetic/lib/libopencv_imgcodecs3.so /opt/ros/kinetic/lib/libopencv_imgcodecs.so 94 | fi 95 | 96 | 97 | 98 | if [ ! -f /usr/lib/x86_64-linux-gnu/libcudnn.so.5 ] 99 | then 100 | sudo ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.5 /usr/lib/x86_64-linux-gnu/libcudnn.so 101 | fi 102 | 103 | make clean # clean just to be safe 104 | make all -j $(($(nproc) + 1)) 105 | make test -j $(($(nproc) + 1)) 106 | make runtest -j $(($(nproc) + 1)) 107 | make distribute 108 | 109 | 110 | cd $DIR -------------------------------------------------------------------------------- /camodocal.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# CamOdoCal - Calibration Algorithms" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# https://github.com/hengli/camodocal" 15 | echo "# also see: https://github.com/jhu-lcsr/handeye_calib_camodocal" 16 | echo "#" 17 | echo "# Extra steps: this runs ceres.sh first!" 18 | 19 | sh ceres.sh 20 | sudo apt-get install -y libgoogle-glog-dev 21 | 22 | echo "HACK TO GET AROUND CMAKE BUILD ERROR IN UBUNTU 16.04:" 23 | echo "sudo ln -s /usr/lib/x86_64-linux-gnu/libglog.so /usr/local/lib/" 24 | if [ ! -f /usr/local/lib/libglog.so ] 25 | then 26 | sudo ln -s /usr/lib/x86_64-linux-gnu/libglog.so /usr/local/lib/ 27 | fi 28 | 29 | mkdir -p ~/src 30 | cd ~/src 31 | 32 | if [ ! -d ~/src/camodocal ] 33 | then 34 | git clone https://github.com/hengli/camodocal.git -b v1.0.1 35 | fi 36 | 37 | cd ~/src/camodocal 38 | 39 | # uncomment to pull bleeding edge version of the cloned branch 40 | # git pull 41 | 42 | if [ ! -d build ] 43 | then 44 | mkdir build 45 | fi 46 | 47 | cd build 48 | cmake .. 49 | make -j && sudo make install 50 | 51 | 52 | cd $DIR 53 | -------------------------------------------------------------------------------- /cartographer_ros.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "###############################################" 10 | echo "# Google Cartographer - ROS" 11 | echo "###############################################" 12 | echo "#" 13 | echo "# https://github.com/googlecartographer/cartographer_ros" 14 | echo "# also see: https://github.com/googlecartographer/cartographer" 15 | echo "#" 16 | echo "# Extra steps: this runs ceres.sh first!" 17 | 18 | # Install the required libraries that are available as debs. 19 | sudo apt-get update 20 | sudo apt-get install -y \ 21 | cmake \ 22 | g++ \ 23 | git \ 24 | libboost-all-dev \ 25 | libcairo2-dev \ 26 | libeigen3-dev \ 27 | libgflags-dev \ 28 | libgoogle-glog-dev \ 29 | liblua5.2-dev \ 30 | libprotobuf-dev \ 31 | libsuitesparse-dev \ 32 | ninja-build \ 33 | protobuf-compiler \ 34 | python-sphinx 35 | 36 | # install googletest from source 37 | ./googletest.sh 38 | # Install ROS 39 | ./ros.sh 40 | 41 | # Install wstool and rosdep. 42 | sudo apt-get update 43 | sudo apt-get install -y python-wstool python-rosdep ninja-build 44 | 45 | # make sure TMPDIR variable is set 46 | if [ -z ${var+x} ]; then export TMPDIR="/tmp"; fi 47 | 48 | source /opt/ros/kinetic/setup.bash 49 | 50 | cd ~/src 51 | 52 | # Create a new workspace in 'catkin_ws'. 53 | mkdir -p cartographer_ws 54 | cd cartographer_ws 55 | 56 | if [ ! -f ~/src/cartographer_ws/src/.rosinstall ] 57 | then 58 | wstool init src 59 | fi 60 | 61 | 62 | # Merge the cartographer_ros.rosinstall file and fetch code for dependencies. 63 | wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall 64 | wstool update -t src 65 | 66 | # Install deb dependencies. 67 | # The command 'sudo rosdep init' will print an error if you have already 68 | # executed it since installing ROS. This error can be ignored. 69 | if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ] 70 | then 71 | sudo rosdep init 72 | fi 73 | 74 | # make sure ROS_DISTRO variable is set 75 | if [ -z ${var+x} ]; then export ROS_DISTRO="kinetic"; fi 76 | 77 | rosdep update 78 | rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y 79 | 80 | cd ~/src/cartographer_ws 81 | 82 | 83 | # Build and install. 84 | catkin_make_isolated --install --use-ninja 85 | source install_isolated/setup.bash 86 | 87 | # Build and install. 88 | # catkin build --install --use-ninja 89 | 90 | 91 | cd $DIR 92 | -------------------------------------------------------------------------------- /ceres.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# ceres-solver with manual 16.04 workarounds" 12 | echo "############################" 13 | echo "" 14 | echo "ceres-solver.org" 15 | echo "" 16 | echo "Ubuntu 16.04 bugs:" 17 | echo "https://bugs.launchpad.net/ubuntu/+source/ceres-solver/+bug/1596296" 18 | echo "https://bugs.launchpad.net/ubuntu/+source/ceres-solver/+bug/1595692" 19 | echo "INCLUDES HACK TO GET AROUND missing package files IN UBUNTU 16.04" 20 | 21 | # TODO(ahundt) maybe we really want ceres-solver 1.12.0 for 16.04 as well? it has constrained optimization! 22 | 23 | . /etc/lsb-release # get ubuntu version number 24 | 25 | # only install 26 | if [ "$DISTRIB_RELEASE" = "16.04" ]; then 27 | sudo apt-get install -y libceres-dev 28 | sudo cp -a ceres/share/Ceres /usr/share 29 | sudo cp -a ceres/include/internal/config.h /usr/include/ceres/internal 30 | fi 31 | 32 | # only install 33 | if [ "$DISTRIB_RELEASE" = "14.04" ]; then 34 | # Special steps for Ubuntu 14.04 documented at: 35 | # http://ceres-solver.org/installation.html#linux 36 | 37 | # CMake 38 | sudo apt-get install -y cmake 39 | # google-glog + gflags 40 | sudo apt-get install -y libgoogle-glog-dev 41 | # BLAS & LAPACK 42 | sudo apt-get install -y libatlas-base-dev 43 | # Eigen3 44 | sudo apt-get install -y libeigen3-dev 45 | # SuiteSparse and CXSparse (optional) 46 | # - If you want to build Ceres as a *static* library (the default) 47 | # you can use the SuiteSparse package in the main Ubuntu package 48 | # repository: 49 | # sudo apt-get install -y libsuitesparse-dev 50 | # - However, if you want to build Ceres as a *shared* library, you must 51 | # add the following PPA: 52 | sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687 53 | sudo apt-get update 54 | sudo apt-get install -y libsuitesparse-dev 55 | 56 | cd ~/src 57 | if [ ! -d ~/src/ceres-solver ] 58 | then 59 | git clone https://ceres-solver.googlesource.com/ceres-solver -b 1.12.0 60 | cd ceres-solver 61 | mkdir build 62 | fi 63 | 64 | # uncomment to pull bleeding edge version of the cloned branch 65 | # cd ~/src/ceres-solver 66 | # git pull 67 | 68 | cd ~/src/ceres-solver/build 69 | 70 | cmake .. 71 | sudo make -j install 72 | cd ../.. 73 | 74 | fi 75 | cd $DIR 76 | -------------------------------------------------------------------------------- /ceres/include/internal/config.h: -------------------------------------------------------------------------------- 1 | // Ceres Solver - A fast non-linear least squares minimizer 2 | // Copyright 2015 Google Inc. All rights reserved. 3 | // http://ceres-solver.org/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, 9 | // this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // * Neither the name of Google Inc. nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Author: alexs.mac@gmail.com (Alex Stewart) 30 | 31 | // Default (empty) configuration options for Ceres. 32 | // 33 | // IMPORTANT: Most users of Ceres will not use this file, when 34 | // compiling Ceres with CMake, CMake will configure a new 35 | // config.h with the currently selected Ceres compile 36 | // options in /config, which will be added to 37 | // the include path for compilation, and installed with the 38 | // public Ceres headers. However, for some users of Ceres 39 | // who compile without CMake (Android), this file ensures 40 | // that Ceres will compile, with the user either specifying 41 | // manually the Ceres compile options, or passing them 42 | // directly through the compiler. 43 | 44 | #ifndef CERES_PUBLIC_INTERNAL_CONFIG_H_ 45 | #define CERES_PUBLIC_INTERNAL_CONFIG_H_ 46 | 47 | 48 | #endif // CERES_PUBLIC_INTERNAL_CONFIG_H_ 49 | -------------------------------------------------------------------------------- /ceres/share/Ceres/CeresConfigVersion.cmake: -------------------------------------------------------------------------------- 1 | # Ceres Solver - A fast non-linear least squares minimizer 2 | # Copyright 2015 Google Inc. All rights reserved. 3 | # http://ceres-solver.org/ 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Google Inc. nor the names of its contributors may be 14 | # used to endorse or promote products derived from this software without 15 | # specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | # Author: pablo.speciale@gmail.com (Pablo Speciale) 30 | # 31 | # FIND_PACKAGE() searches for a Config.cmake file and an associated 32 | # Version.cmake file, which it loads to check the version number. 33 | # 34 | # This file can be used with CONFIGURE_FILE() to generate such a file for a 35 | # project with very basic logic. 36 | # 37 | # It sets PACKAGE_VERSION_EXACT if the current version string and the requested 38 | # version string are exactly the same and it sets PACKAGE_VERSION_COMPATIBLE 39 | # if the current version is >= requested version. 40 | 41 | set(PACKAGE_VERSION 1.11.0) 42 | 43 | if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 44 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 45 | else ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 46 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 47 | if ("${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") 48 | set(PACKAGE_VERSION_EXACT TRUE) 49 | endif ("${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") 50 | endif ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 51 | -------------------------------------------------------------------------------- /ceres/share/Ceres/CeresTargets-release.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "ceres" for configuration "Release" 9 | set_property(TARGET ceres APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(ceres PROPERTIES 11 | IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "/usr/local/lib/libglog.so" 12 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libceres.so.1.11.0" 13 | IMPORTED_SONAME_RELEASE "@rpath/libceres.1.dylib" 14 | ) 15 | 16 | list(APPEND _IMPORT_CHECK_TARGETS ceres ) 17 | list(APPEND _IMPORT_CHECK_FILES_FOR_ceres "${_IMPORT_PREFIX}/lib/libceres.so.1.11.0" ) 18 | 19 | # Commands beyond this point should not need to know the version. 20 | set(CMAKE_IMPORT_FILE_VERSION) 21 | -------------------------------------------------------------------------------- /ceres/share/Ceres/CeresTargets.cmake: -------------------------------------------------------------------------------- 1 | # Generated by CMake 3.5.1 2 | 3 | if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) 4 | message(FATAL_ERROR "CMake >= 2.6.0 required") 5 | endif() 6 | cmake_policy(PUSH) 7 | cmake_policy(VERSION 2.6) 8 | #---------------------------------------------------------------- 9 | # Generated CMake target import file. 10 | #---------------------------------------------------------------- 11 | 12 | # Commands may need to know the format version. 13 | set(CMAKE_IMPORT_FILE_VERSION 1) 14 | 15 | # Protect against multiple inclusion, which would fail when already imported targets are added once more. 16 | set(_targetsDefined) 17 | set(_targetsNotDefined) 18 | set(_expectedTargets) 19 | foreach(_expectedTarget ceres) 20 | list(APPEND _expectedTargets ${_expectedTarget}) 21 | if(NOT TARGET ${_expectedTarget}) 22 | list(APPEND _targetsNotDefined ${_expectedTarget}) 23 | endif() 24 | if(TARGET ${_expectedTarget}) 25 | list(APPEND _targetsDefined ${_expectedTarget}) 26 | endif() 27 | endforeach() 28 | if("${_targetsDefined}" STREQUAL "${_expectedTargets}") 29 | set(CMAKE_IMPORT_FILE_VERSION) 30 | cmake_policy(POP) 31 | return() 32 | endif() 33 | if(NOT "${_targetsDefined}" STREQUAL "") 34 | message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") 35 | endif() 36 | unset(_targetsDefined) 37 | unset(_targetsNotDefined) 38 | unset(_expectedTargets) 39 | 40 | 41 | # Compute the installation prefix relative to this file. 42 | get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) 43 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 44 | get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 45 | 46 | # Create imported target ceres 47 | add_library(ceres SHARED IMPORTED) 48 | 49 | # Load information for each installed configuration. 50 | get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 51 | file(GLOB CONFIG_FILES "${_DIR}/CeresTargets-*.cmake") 52 | foreach(f ${CONFIG_FILES}) 53 | include(${f}) 54 | endforeach() 55 | 56 | # Cleanup temporary variables. 57 | set(_IMPORT_PREFIX) 58 | 59 | # Loop over all imported files and verify that they actually exist 60 | foreach(target ${_IMPORT_CHECK_TARGETS} ) 61 | foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) 62 | if(NOT EXISTS "${file}" ) 63 | message(FATAL_ERROR "The imported target \"${target}\" references the file 64 | \"${file}\" 65 | but this file does not exist. Possible reasons include: 66 | * The file was deleted, renamed, or moved to another location. 67 | * An install or uninstall procedure did not complete successfully. 68 | * The installation package was faulty and contained 69 | \"${CMAKE_CURRENT_LIST_FILE}\" 70 | but not all the files it references. 71 | ") 72 | endif() 73 | endforeach() 74 | unset(_IMPORT_CHECK_FILES_FOR_${target}) 75 | endforeach() 76 | unset(_IMPORT_CHECK_TARGETS) 77 | 78 | # This file does not depend on other imported targets which have 79 | # been exported from the same project but in a separate export set. 80 | 81 | # Commands beyond this point should not need to know the version. 82 | set(CMAKE_IMPORT_FILE_VERSION) 83 | cmake_policy(POP) 84 | -------------------------------------------------------------------------------- /ceres/share/Ceres/FindEigen.cmake: -------------------------------------------------------------------------------- 1 | # Ceres Solver - A fast non-linear least squares minimizer 2 | # Copyright 2015 Google Inc. All rights reserved. 3 | # http://ceres-solver.org/ 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Google Inc. nor the names of its contributors may be 14 | # used to endorse or promote products derived from this software without 15 | # specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | # Author: alexs.mac@gmail.com (Alex Stewart) 30 | # 31 | 32 | # FindEigen.cmake - Find Eigen library, version >= 3. 33 | # 34 | # This module defines the following variables: 35 | # 36 | # EIGEN_FOUND: TRUE iff Eigen is found. 37 | # EIGEN_INCLUDE_DIRS: Include directories for Eigen. 38 | # 39 | # EIGEN_VERSION: Extracted from Eigen/src/Core/util/Macros.h 40 | # EIGEN_WORLD_VERSION: Equal to 3 if EIGEN_VERSION = 3.2.0 41 | # EIGEN_MAJOR_VERSION: Equal to 2 if EIGEN_VERSION = 3.2.0 42 | # EIGEN_MINOR_VERSION: Equal to 0 if EIGEN_VERSION = 3.2.0 43 | # 44 | # The following variables control the behaviour of this module: 45 | # 46 | # EIGEN_INCLUDE_DIR_HINTS: List of additional directories in which to 47 | # search for eigen includes, e.g: /timbuktu/eigen3. 48 | # 49 | # The following variables are also defined by this module, but in line with 50 | # CMake recommended FindPackage() module style should NOT be referenced directly 51 | # by callers (use the plural variables detailed above instead). These variables 52 | # do however affect the behaviour of the module via FIND_[PATH/LIBRARY]() which 53 | # are NOT re-called (i.e. search for library is not repeated) if these variables 54 | # are set with valid values _in the CMake cache_. This means that if these 55 | # variables are set directly in the cache, either by the user in the CMake GUI, 56 | # or by the user passing -DVAR=VALUE directives to CMake when called (which 57 | # explicitly defines a cache variable), then they will be used verbatim, 58 | # bypassing the HINTS variables and other hard-coded search locations. 59 | # 60 | # EIGEN_INCLUDE_DIR: Include directory for CXSparse, not including the 61 | # include directory of any dependencies. 62 | 63 | # Called if we failed to find Eigen or any of it's required dependencies, 64 | # unsets all public (designed to be used externally) variables and reports 65 | # error message at priority depending upon [REQUIRED/QUIET/] argument. 66 | macro(EIGEN_REPORT_NOT_FOUND REASON_MSG) 67 | unset(EIGEN_FOUND) 68 | unset(EIGEN_INCLUDE_DIRS) 69 | # Make results of search visible in the CMake GUI if Eigen has not 70 | # been found so that user does not have to toggle to advanced view. 71 | mark_as_advanced(CLEAR EIGEN_INCLUDE_DIR) 72 | # Note _FIND_[REQUIRED/QUIETLY] variables defined by FindPackage() 73 | # use the camelcase library name, not uppercase. 74 | if (Eigen_FIND_QUIETLY) 75 | message(STATUS "Failed to find Eigen - " ${REASON_MSG} ${ARGN}) 76 | elseif (Eigen_FIND_REQUIRED) 77 | message(FATAL_ERROR "Failed to find Eigen - " ${REASON_MSG} ${ARGN}) 78 | else() 79 | # Neither QUIETLY nor REQUIRED, use no priority which emits a message 80 | # but continues configuration and allows generation. 81 | message("-- Failed to find Eigen - " ${REASON_MSG} ${ARGN}) 82 | endif () 83 | endmacro(EIGEN_REPORT_NOT_FOUND) 84 | 85 | # Search user-installed locations first, so that we prefer user installs 86 | # to system installs where both exist. 87 | # 88 | # TODO: Add standard Windows search locations for Eigen. 89 | list(APPEND EIGEN_CHECK_INCLUDE_DIRS 90 | /usr/local/include 91 | /usr/local/homebrew/include # Mac OS X 92 | /opt/local/var/macports/software # Mac OS X. 93 | /opt/local/include 94 | /usr/include) 95 | # Additional suffixes to try appending to each search path. 96 | list(APPEND EIGEN_CHECK_PATH_SUFFIXES 97 | eigen3 # Default root directory for Eigen. 98 | Eigen/include/eigen3 ) # Windows (for C:/Program Files prefix). 99 | 100 | # Search supplied hint directories first if supplied. 101 | find_path(EIGEN_INCLUDE_DIR 102 | NAMES Eigen/Core 103 | PATHS ${EIGEN_INCLUDE_DIR_HINTS} 104 | ${EIGEN_CHECK_INCLUDE_DIRS} 105 | PATH_SUFFIXES ${EIGEN_CHECK_PATH_SUFFIXES}) 106 | 107 | if (NOT EIGEN_INCLUDE_DIR OR 108 | NOT EXISTS ${EIGEN_INCLUDE_DIR}) 109 | eigen_report_not_found( 110 | "Could not find eigen3 include directory, set EIGEN_INCLUDE_DIR to " 111 | "path to eigen3 include directory, e.g. /usr/local/include/eigen3.") 112 | endif (NOT EIGEN_INCLUDE_DIR OR 113 | NOT EXISTS ${EIGEN_INCLUDE_DIR}) 114 | 115 | # Mark internally as found, then verify. EIGEN_REPORT_NOT_FOUND() unsets 116 | # if called. 117 | set(EIGEN_FOUND TRUE) 118 | 119 | # Extract Eigen version from Eigen/src/Core/util/Macros.h 120 | if (EIGEN_INCLUDE_DIR) 121 | set(EIGEN_VERSION_FILE ${EIGEN_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h) 122 | if (NOT EXISTS ${EIGEN_VERSION_FILE}) 123 | eigen_report_not_found( 124 | "Could not find file: ${EIGEN_VERSION_FILE} " 125 | "containing version information in Eigen install located at: " 126 | "${EIGEN_INCLUDE_DIR}.") 127 | else (NOT EXISTS ${EIGEN_VERSION_FILE}) 128 | file(READ ${EIGEN_VERSION_FILE} EIGEN_VERSION_FILE_CONTENTS) 129 | 130 | string(REGEX MATCH "#define EIGEN_WORLD_VERSION [0-9]+" 131 | EIGEN_WORLD_VERSION "${EIGEN_VERSION_FILE_CONTENTS}") 132 | string(REGEX REPLACE "#define EIGEN_WORLD_VERSION ([0-9]+)" "\\1" 133 | EIGEN_WORLD_VERSION "${EIGEN_WORLD_VERSION}") 134 | 135 | string(REGEX MATCH "#define EIGEN_MAJOR_VERSION [0-9]+" 136 | EIGEN_MAJOR_VERSION "${EIGEN_VERSION_FILE_CONTENTS}") 137 | string(REGEX REPLACE "#define EIGEN_MAJOR_VERSION ([0-9]+)" "\\1" 138 | EIGEN_MAJOR_VERSION "${EIGEN_MAJOR_VERSION}") 139 | 140 | string(REGEX MATCH "#define EIGEN_MINOR_VERSION [0-9]+" 141 | EIGEN_MINOR_VERSION "${EIGEN_VERSION_FILE_CONTENTS}") 142 | string(REGEX REPLACE "#define EIGEN_MINOR_VERSION ([0-9]+)" "\\1" 143 | EIGEN_MINOR_VERSION "${EIGEN_MINOR_VERSION}") 144 | 145 | # This is on a single line s/t CMake does not interpret it as a list of 146 | # elements and insert ';' separators which would result in 3.;2.;0 nonsense. 147 | set(EIGEN_VERSION "${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}") 148 | endif (NOT EXISTS ${EIGEN_VERSION_FILE}) 149 | endif (EIGEN_INCLUDE_DIR) 150 | 151 | # Set standard CMake FindPackage variables if found. 152 | if (EIGEN_FOUND) 153 | set(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR}) 154 | endif (EIGEN_FOUND) 155 | 156 | # Handle REQUIRED / QUIET optional arguments and version. 157 | include(FindPackageHandleStandardArgs) 158 | find_package_handle_standard_args(Eigen 159 | REQUIRED_VARS EIGEN_INCLUDE_DIRS 160 | VERSION_VAR EIGEN_VERSION) 161 | 162 | # Only mark internal variables as advanced if we found Eigen, otherwise 163 | # leave it visible in the standard GUI for the user to set manually. 164 | if (EIGEN_FOUND) 165 | mark_as_advanced(FORCE EIGEN_INCLUDE_DIR) 166 | endif (EIGEN_FOUND) 167 | -------------------------------------------------------------------------------- /ceres/share/Ceres/FindGlog.cmake: -------------------------------------------------------------------------------- 1 | # Ceres Solver - A fast non-linear least squares minimizer 2 | # Copyright 2015 Google Inc. All rights reserved. 3 | # http://ceres-solver.org/ 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Google Inc. nor the names of its contributors may be 14 | # used to endorse or promote products derived from this software without 15 | # specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | # Author: alexs.mac@gmail.com (Alex Stewart) 30 | # 31 | 32 | # FindGlog.cmake - Find Google glog logging library. 33 | # 34 | # This module defines the following variables: 35 | # 36 | # GLOG_FOUND: TRUE iff glog is found. 37 | # GLOG_INCLUDE_DIRS: Include directories for glog. 38 | # GLOG_LIBRARIES: Libraries required to link glog. 39 | # 40 | # The following variables control the behaviour of this module: 41 | # 42 | # GLOG_INCLUDE_DIR_HINTS: List of additional directories in which to 43 | # search for glog includes, e.g: /timbuktu/include. 44 | # GLOG_LIBRARY_DIR_HINTS: List of additional directories in which to 45 | # search for glog libraries, e.g: /timbuktu/lib. 46 | # 47 | # The following variables are also defined by this module, but in line with 48 | # CMake recommended FindPackage() module style should NOT be referenced directly 49 | # by callers (use the plural variables detailed above instead). These variables 50 | # do however affect the behaviour of the module via FIND_[PATH/LIBRARY]() which 51 | # are NOT re-called (i.e. search for library is not repeated) if these variables 52 | # are set with valid values _in the CMake cache_. This means that if these 53 | # variables are set directly in the cache, either by the user in the CMake GUI, 54 | # or by the user passing -DVAR=VALUE directives to CMake when called (which 55 | # explicitly defines a cache variable), then they will be used verbatim, 56 | # bypassing the HINTS variables and other hard-coded search locations. 57 | # 58 | # GLOG_INCLUDE_DIR: Include directory for glog, not including the 59 | # include directory of any dependencies. 60 | # GLOG_LIBRARY: glog library, not including the libraries of any 61 | # dependencies. 62 | 63 | # Reset CALLERS_CMAKE_FIND_LIBRARY_PREFIXES to its value when 64 | # FindGlog was invoked. 65 | macro(GLOG_RESET_FIND_LIBRARY_PREFIX) 66 | if (MSVC) 67 | set(CMAKE_FIND_LIBRARY_PREFIXES "${CALLERS_CMAKE_FIND_LIBRARY_PREFIXES}") 68 | endif (MSVC) 69 | endmacro(GLOG_RESET_FIND_LIBRARY_PREFIX) 70 | 71 | # Called if we failed to find glog or any of it's required dependencies, 72 | # unsets all public (designed to be used externally) variables and reports 73 | # error message at priority depending upon [REQUIRED/QUIET/] argument. 74 | macro(GLOG_REPORT_NOT_FOUND REASON_MSG) 75 | unset(GLOG_FOUND) 76 | unset(GLOG_INCLUDE_DIRS) 77 | unset(GLOG_LIBRARIES) 78 | # Make results of search visible in the CMake GUI if glog has not 79 | # been found so that user does not have to toggle to advanced view. 80 | mark_as_advanced(CLEAR GLOG_INCLUDE_DIR 81 | GLOG_LIBRARY) 82 | 83 | glog_reset_find_library_prefix() 84 | 85 | # Note _FIND_[REQUIRED/QUIETLY] variables defined by FindPackage() 86 | # use the camelcase library name, not uppercase. 87 | if (Glog_FIND_QUIETLY) 88 | message(STATUS "Failed to find glog - " ${REASON_MSG} ${ARGN}) 89 | elseif (Glog_FIND_REQUIRED) 90 | message(FATAL_ERROR "Failed to find glog - " ${REASON_MSG} ${ARGN}) 91 | else() 92 | # Neither QUIETLY nor REQUIRED, use no priority which emits a message 93 | # but continues configuration and allows generation. 94 | message("-- Failed to find glog - " ${REASON_MSG} ${ARGN}) 95 | endif () 96 | endmacro(GLOG_REPORT_NOT_FOUND) 97 | 98 | # Handle possible presence of lib prefix for libraries on MSVC, see 99 | # also GLOG_RESET_FIND_LIBRARY_PREFIX(). 100 | if (MSVC) 101 | # Preserve the caller's original values for CMAKE_FIND_LIBRARY_PREFIXES 102 | # s/t we can set it back before returning. 103 | set(CALLERS_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}") 104 | # The empty string in this list is important, it represents the case when 105 | # the libraries have no prefix (shared libraries / DLLs). 106 | set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "" "${CMAKE_FIND_LIBRARY_PREFIXES}") 107 | endif (MSVC) 108 | 109 | # Search user-installed locations first, so that we prefer user installs 110 | # to system installs where both exist. 111 | list(APPEND GLOG_CHECK_INCLUDE_DIRS 112 | /usr/local/include 113 | /usr/local/homebrew/include # Mac OS X 114 | /opt/local/var/macports/software # Mac OS X. 115 | /opt/local/include 116 | /usr/include) 117 | # Windows (for C:/Program Files prefix). 118 | list(APPEND GLOG_CHECK_PATH_SUFFIXES 119 | glog/include 120 | glog/Include 121 | Glog/include 122 | Glog/Include) 123 | 124 | list(APPEND GLOG_CHECK_LIBRARY_DIRS 125 | /usr/local/lib 126 | /usr/local/homebrew/lib # Mac OS X. 127 | /opt/local/lib 128 | /usr/lib) 129 | # Windows (for C:/Program Files prefix). 130 | list(APPEND GLOG_CHECK_LIBRARY_SUFFIXES 131 | glog/lib 132 | glog/Lib 133 | Glog/lib 134 | Glog/Lib) 135 | 136 | # Search supplied hint directories first if supplied. 137 | find_path(GLOG_INCLUDE_DIR 138 | NAMES glog/logging.h 139 | PATHS ${GLOG_INCLUDE_DIR_HINTS} 140 | ${GLOG_CHECK_INCLUDE_DIRS} 141 | PATH_SUFFIXES ${GLOG_CHECK_PATH_SUFFIXES}) 142 | if (NOT GLOG_INCLUDE_DIR OR 143 | NOT EXISTS ${GLOG_INCLUDE_DIR}) 144 | glog_report_not_found( 145 | "Could not find glog include directory, set GLOG_INCLUDE_DIR " 146 | "to directory containing glog/logging.h") 147 | endif (NOT GLOG_INCLUDE_DIR OR 148 | NOT EXISTS ${GLOG_INCLUDE_DIR}) 149 | 150 | find_library(GLOG_LIBRARY NAMES glog 151 | PATHS ${GLOG_LIBRARY_DIR_HINTS} 152 | ${GLOG_CHECK_LIBRARY_DIRS} 153 | PATH_SUFFIXES ${GLOG_CHECK_LIBRARY_SUFFIXES}) 154 | if (NOT GLOG_LIBRARY OR 155 | NOT EXISTS ${GLOG_LIBRARY}) 156 | glog_report_not_found( 157 | "Could not find glog library, set GLOG_LIBRARY " 158 | "to full path to libglog.") 159 | endif (NOT GLOG_LIBRARY OR 160 | NOT EXISTS ${GLOG_LIBRARY}) 161 | 162 | # Mark internally as found, then verify. GLOG_REPORT_NOT_FOUND() unsets 163 | # if called. 164 | set(GLOG_FOUND TRUE) 165 | 166 | # Glog does not seem to provide any record of the version in its 167 | # source tree, thus cannot extract version. 168 | 169 | # Catch case when caller has set GLOG_INCLUDE_DIR in the cache / GUI and 170 | # thus FIND_[PATH/LIBRARY] are not called, but specified locations are 171 | # invalid, otherwise we would report the library as found. 172 | if (GLOG_INCLUDE_DIR AND 173 | NOT EXISTS ${GLOG_INCLUDE_DIR}/glog/logging.h) 174 | glog_report_not_found( 175 | "Caller defined GLOG_INCLUDE_DIR:" 176 | " ${GLOG_INCLUDE_DIR} does not contain glog/logging.h header.") 177 | endif (GLOG_INCLUDE_DIR AND 178 | NOT EXISTS ${GLOG_INCLUDE_DIR}/glog/logging.h) 179 | # TODO: This regex for glog library is pretty primitive, we use lowercase 180 | # for comparison to handle Windows using CamelCase library names, could 181 | # this check be better? 182 | string(TOLOWER "${GLOG_LIBRARY}" LOWERCASE_GLOG_LIBRARY) 183 | if (GLOG_LIBRARY AND 184 | NOT "${LOWERCASE_GLOG_LIBRARY}" MATCHES ".*glog[^/]*") 185 | glog_report_not_found( 186 | "Caller defined GLOG_LIBRARY: " 187 | "${GLOG_LIBRARY} does not match glog.") 188 | endif (GLOG_LIBRARY AND 189 | NOT "${LOWERCASE_GLOG_LIBRARY}" MATCHES ".*glog[^/]*") 190 | 191 | # Set standard CMake FindPackage variables if found. 192 | if (GLOG_FOUND) 193 | set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) 194 | set(GLOG_LIBRARIES ${GLOG_LIBRARY}) 195 | endif (GLOG_FOUND) 196 | 197 | glog_reset_find_library_prefix() 198 | 199 | # Handle REQUIRED / QUIET optional arguments. 200 | include(FindPackageHandleStandardArgs) 201 | find_package_handle_standard_args(Glog DEFAULT_MSG 202 | GLOG_INCLUDE_DIRS GLOG_LIBRARIES) 203 | 204 | # Only mark internal variables as advanced if we found glog, otherwise 205 | # leave them visible in the standard GUI for the user to set manually. 206 | if (GLOG_FOUND) 207 | mark_as_advanced(FORCE GLOG_INCLUDE_DIR 208 | GLOG_LIBRARY) 209 | endif (GLOG_FOUND) 210 | -------------------------------------------------------------------------------- /cmake-basis.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# CMAKE-BASIS installer " 12 | echo "############################" 13 | echo "" 14 | echo "https://cmake-basis.github.io/index.html" 15 | echo "" 16 | 17 | mkdir -p ~/src 18 | cd ~/src 19 | 20 | # We prefer cmake be a version later than the default on 16.04, so check for that and install an update. 21 | cmakeversion=`cmake --version` 22 | if [[ $cmakeversion == *"cmake version 3.5.1"* ]]; then 23 | echo "Detected incompatible cmake version 3.5.1, updating CMake from source, see cmake_source.sh for details" 24 | ./cmake_source.sh 25 | fi 26 | 27 | if [ ! -d ~/src/cmake-basis ] 28 | then 29 | mkdir -p ~/src/cmake-basis 30 | git clone --depth=1 https://github.com/cmake-basis/BASIS.git cmake-basis --branch v3.3.1 31 | fi 32 | 33 | cd cmake-basis 34 | git pull 35 | 36 | 37 | if [ ! -d ~/src/cmake-basis/build ] 38 | then 39 | mkdir -p ~/src/cmake-basis/build 40 | fi 41 | 42 | cd build 43 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PROJECT_TOOL=ON -DBUILD_APPLICATIONS=ON -DBUILD_EXAMPLE=ON 44 | make -j && sudo make install 45 | 46 | 47 | cd $DIR 48 | -------------------------------------------------------------------------------- /cmake_source.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# CMake - cmake.org" 12 | echo "############################" 13 | echo "" 14 | echo "CMake, the cross-platform, open-source build system. https://cmake.org" 15 | echo "" 16 | echo "https://github.com/Kitware/CMake/" 17 | 18 | 19 | # os specific setup 20 | OS=`uname` 21 | case $OS in 22 | 'Linux') 23 | 24 | sudo apt-get update 25 | sudo apt-get install -y libtool pkg-config build-essential autoconf automake pkg-config libncurses5-dev 26 | OS='Linux' 27 | ;; 28 | *) ;; 29 | 'Darwin') 30 | OS='Mac' 31 | ;; 32 | esac 33 | 34 | 35 | cd ~/src/ 36 | if [ ! -d ~/src/CMake ] 37 | then 38 | git clone https://github.com/Kitware/CMake.git -b release 39 | fi 40 | 41 | cd CMake 42 | git pull 43 | 44 | ./bootstrap 45 | # make -j will build faster, but may run out of memory 46 | # sudo make -j install 47 | sudo make install 48 | 49 | cd $DIR 50 | -------------------------------------------------------------------------------- /co-fusion.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "############################" 10 | echo "# co-fusion https://github.com/martinruenz/co-fusion" 11 | echo "############################" 12 | echo "" 13 | echo "Co-Fusion: Real-time Segmentation, Tracking and Fusion of Multiple Objects " 14 | echo "" 15 | 16 | # install opencv 17 | ./opencv.sh 18 | # superpixel segmentation 19 | ./gslicr.sh 20 | # data visualization 21 | ./pangolin.sh 22 | 23 | 24 | 25 | cd ~/src/ 26 | 27 | 28 | if [ ! -d ~/src/densecrf ] 29 | then 30 | git clone https://github.com/martinruenz/densecrf.git 31 | fi 32 | cd densecrf 33 | git pull 34 | mkdir -p build 35 | cd build 36 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_MODULE_PATH=/usr/share/OpenCV/ 37 | cmake --build . 38 | 39 | git pull 40 | 41 | cd ~/src/ 42 | if [ ! -d ~/src/co-fusion ] 43 | then 44 | git clone https://github.com/martinruenz/co-fusion.git 45 | fi 46 | cd co-fusion 47 | git pull 48 | 49 | 50 | #co-fusion expects gSLICr to be in the deps folder, let's use a symlink for that 51 | mkdir -p deps 52 | ln -sf ~/src/gSLICr deps/gSLICr 53 | ln -sf ~/src/densecrf deps/densecrf 54 | 55 | # compile 56 | mkdir -p build 57 | cd build 58 | # TODO(ahundt) should CMAKE_MODULE_PATH always be set like this or should we make a pull request to fix it? 59 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_MODULE_PATH=/usr/share/OpenCV/ 60 | cmake --build . 61 | 62 | 63 | cd $DIR 64 | -------------------------------------------------------------------------------- /coco.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # source: https://gist.github.com/phatblat/1713458 5 | # Save script's current directory 6 | DIR=$(pwd) 7 | 8 | # /bin/bash 9 | set -e 10 | set -u 11 | set -x 12 | 13 | 14 | 15 | echo "############################" 16 | echo "# Install Microsoft coco dataset python code" 17 | echo "############################" 18 | echo " This installs python software that supports the coco dataset" 19 | echo " http://mscoco.org/" 20 | echo " main repository https://github.com/cocodataset/cocoapi" 21 | echo " cocostuff https://github.com/nightrome/cocoapi" 22 | echo " my patches:" 23 | echo " ahundt https://github.com/ahundt/cocoapi" 24 | echo " To download the dataset run robotics_setup/datasets/coco.sh" 25 | 26 | 27 | 28 | 29 | # Enable python bindings via cython by default 30 | # set to "ON" to build python bindings and "OFF" to disable them 31 | # Note: "ON" generates tons of warnings and the log size might prevent CI from succeeding. 32 | PIP_INSTALL="OFF" 33 | #location="cocodataset" # https://github.com/cocodataset/cocoapi # main coco repository, but they haven't been updating it 34 | location="ahundt" # github.com/ahundt/Tasks # I have some patches here 35 | #location="nightrome" # https://github.com/nightrome/cocoapi # cocostuff 36 | 37 | # modify if using a different branch 38 | # branch="master" 39 | branch="cocostuff_good_fixes" 40 | 41 | # Check if the user specified any command line options 42 | # other than teh default and set the variable appropriately. 43 | while getopts p:l:b: option 44 | do 45 | case "${option}" 46 | in 47 | p) PIP_INSTALL="${OPTARG}";; 48 | l) location="${OPTARG}";; 49 | b) branch="${OPTARG}";; 50 | esac 51 | done 52 | 53 | mkdir -p ~/datasets 54 | cd ~/datasets 55 | 56 | 57 | # install https://github.com/pdollar/coco 58 | cd ~/src/ 59 | if [ ! -d ~/src/cocoapi ] 60 | then 61 | git clone https://github.com/${location}/cocoapi.git -b ${branch} 62 | cd cocoapi 63 | git remote add ahundt https://github.com/ahundt/cocoapi.git 64 | git remote add cocostuff https://github.com/cocostuff/cocoapi.git 65 | git remote add cocoapi https://github.com/cocodataset/cocoapi.git 66 | cd .. 67 | fi 68 | 69 | cd cocoapi 70 | git fetch --all 71 | git pull ${location} ${branch} 72 | cd PythonAPI 73 | # sudo python setup.py install 74 | # python setup.py install --user --upgrade 75 | pip install -e . --user --upgrade 76 | 77 | # # install coco python repository https://github.com/pdollar/coco.git 78 | # cd ~/src 79 | # if [ ! -d ~/src/coco ] 80 | # then 81 | # git clone https://github.com/pdollar/coco.git 82 | # fi 83 | 84 | # cd ~/src/coco 85 | # git pull 86 | # cd PythonAPI 87 | # make install 88 | 89 | cd $DIR 90 | -------------------------------------------------------------------------------- /commandline_utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # source: https://gist.github.com/phatblat/1713458 4 | # Save script's current directory 5 | DIR=$(pwd) 6 | 7 | set -e 8 | set -u 9 | set -x 10 | 11 | 12 | echo "############################" 13 | echo "# command line utils Setup #" 14 | echo "############################" 15 | echo "" 16 | echo "@author Andrew Hundt " 17 | echo "" 18 | sudo apt-get update 19 | sudo apt-get install -y htop vim 20 | 21 | echo "#################" 22 | echo "# ack (ack-grep)" 23 | echo "#################" 24 | echo "http://beyondgrep.com/" 25 | sudo apt-get install -y ack-grep 26 | 27 | 28 | 29 | 30 | echo "###############" 31 | echo "# tmux " 32 | echo "###############" 33 | echo "" 34 | echo "# https://wiki.ubuntu.com/ubuntu-make" 35 | echo "" 36 | echo "" 37 | echo "Installs tmux persistent multiplexed console," 38 | echo "so when you lose internet with ssh your programs keep running" 39 | echo "" 40 | echo "https://help.ubuntu.com/community/Repositories/Ubuntu" 41 | sudo apt-get install -y tmux 42 | 43 | 44 | 45 | echo "###############" 46 | echo "# byobu - http://byobu.co/" 47 | echo "###############" 48 | echo "" 49 | echo "tool that makes life with tmux better" 50 | echo "see comments of this file for additional setup steps" 51 | echo "" 52 | echo "https://www.digitalocean.com/community/tutorials/how-to-install-and-use-byobu-for-terminal-management-on-ubuntu-16-04" 53 | echo "https://codeyarns.com/2016/01/28/how-to-use-mouse-in-byobu/" 54 | 55 | sudo apt-get install -y byobu 56 | 57 | echo "" 58 | echo "Additional byobu manual setup steps:" 59 | echo "" 60 | echo " byobu-enable" 61 | echo " byobu-select-backend" 62 | echo "" 63 | echo "# also set default shell to zsh: https://askubuntu.com/questions/296377/how-do-i-change-the-default-shell-used-in-byobu-tmux" 64 | echo "cp -a robotics-setup/.byobu ~/.byobu folder" 65 | echo "" 66 | echo "# OR Put the following in your $HOME/.byobu/.tmux.conf:" 67 | echo "" 68 | echo "set -g default-shell /usr/bin/zsh" 69 | echo "set -g default-command /usr/bin/zsh" 70 | echo "set -g mouse-select-pane on" 71 | echo "set -g mouse-select-window on" 72 | echo "set -g mouse-resize-pane on" 73 | echo "set -g mouse-utf8 on" 74 | 75 | 76 | cd $DIR 77 | -------------------------------------------------------------------------------- /copyme.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# Awesome Library https://github.com/ahundt/awesome-stuff" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# A project repo for awesome snippets. " 15 | 16 | 17 | cd ~/src 18 | if [ ! -d ~/src/flatbuffers ] ; then 19 | git clone https://github.com/google/flatbuffers.git 20 | fi 21 | 22 | cd ~/src/flatbuffers 23 | git pull 24 | 25 | mkdir -p ~/src/flatbuffers/build 26 | cd ~/src/flatbuffers/build 27 | cmake .. 28 | sudo make -j install 29 | cd ~/src 30 | 31 | cd $DIR -------------------------------------------------------------------------------- /costar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # source: https://gist.github.com/phatblat/1713458 3 | # Save script's current directory 4 | DIR=$(pwd) 5 | 6 | set -e 7 | set -u 8 | set -x 9 | 10 | echo "############################" 11 | echo "# costar_stack ROS library" 12 | echo "############################" 13 | echo "# Robot User Interface" 14 | echo "# for flexible task creation " 15 | echo "" 16 | echo "# github.com/cpaxton/costar_stack" 17 | 18 | 19 | # ROS must be installed first, assuming it is in default /opt/ros location 20 | if [ ! -d /opt/ros ]; then 21 | ./ros.sh 22 | fi 23 | 24 | location="cpaxton" # github.com/ahundt/Tasks # I have some patches here 25 | #location="lcsr" # github.com/jrl-umi3218/Tasks # ongoing development happens here 26 | #location="jorisv" # github.com/jorisv/Tasks # original repository location 27 | 28 | # TODO(ahundt) switch back to master once standardized cmake changes are merged, see https://github.com/jrl-umi3218/jrl-cmakemodules/pull/103 29 | branch="master" 30 | #branch="package" # this branch adds standard cmake package configuration 31 | 32 | 33 | . /etc/lsb-release # get ubuntu version number 34 | 35 | 36 | if [ "$DISTRIB_RELEASE" = "16.04" ]; then 37 | ROSVERSION="kinetic" 38 | # TODO(ahundt) How to install fcl? should "soem" be installed? 39 | # TODO(ahundt) Are there univeral robot ros-industrial kinetic binaries? 40 | sudo apt-get install -y ros-kinetic-moveit # ros-kinetic-universal-robot ros-kinetic-ur-msgs # ros-indigo-fcl 41 | 42 | source /opt/ros/kinetic/setup.bash 43 | fi 44 | 45 | 46 | if [ "$DISTRIB_RELEASE" = "14.04" ]; then 47 | ROSVERSION="indigo" 48 | sudo apt-get install -y ros-indigo-moveit-full ros-indigo-fcl ros-indigo-soem 49 | 50 | source /opt/ros/indigo/setup.bash 51 | fi 52 | 53 | # openni2 and friends is optional 54 | sudo apt-get install -y libopenni2-0 libopenni2-dev openni2-doc openni2-utils ros-${ROSVERSION}-openni2-camera ros-${ROSVERSION}-openni2-launch 55 | 56 | # instructor python dependencies 57 | sudo apt-get install -y qt4-designer qt4-dev-tools python-qt4 python-qt4-dev python-wxversion wx-common python-wxgtk3.0 58 | 59 | # many of these are required, ${ROSVERSION} will be indigo, kinetic as appropriate 60 | sudo apt-get install -y python-catkin-tools liburdfdom-headers-dev ros-${ROSVERSION}-control-msgs ros-${ROSVERSION}-gazebo-ros-control ros-${ROSVERSION}-python-orocos-kdl xdot libccd-dev ros-${ROSVERSION}-ros-control ros-${ROSVERSION}-octomap-msgs ros-${ROSVERSION}-gazebo-plugins ros-${ROSVERSION}-pcl-ros ros-${ROSVERSION}-socketcan-interface ros-${ROSVERSION}-rqt-gui ros-${ROSVERSION}-object-recognition-msgs ros-${ROSVERSION}-realtime-tools ros-${ROSVERSION}-position-controllers ros-${ROSVERSION}-robot-state-publisher ros-${ROSVERSION}-joint-state-controller python-bloom 61 | 62 | # ceres solver is needed for handeye_calib_camodocal 63 | # which performs hand eye calibration 64 | ./ceres.sh 65 | 66 | if [ -e "/opt/ros/${ROSVERSION}/setup.bash"]; then 67 | source /opt/ros/${ROSVERSION}/setup.bash 68 | fi 69 | 70 | cd $HOME/src 71 | mkdir -p costar_ws/src 72 | cd costar_ws 73 | catkin init 74 | cd src 75 | 76 | # TODO(ahundt) add better recovery and update utilities, and use specific release versions 77 | if [ ! -d ~/src/costar_ws/src/costar_stack ]; then 78 | git clone https://github.com/${location}/costar_stack.git 79 | fi 80 | 81 | if [ ! -d ~/src/costar_ws/src/iiwa_stack ]; then 82 | git clone https://github.com/cpaxton/iiwa_stack.git 83 | # git clone https://github.com/SalvoVirga/iiwa_stack.git # This is the upstream location 84 | fi 85 | 86 | if [ ! -d ~/src/costar_ws/src/robotiq ]; then 87 | #git clone https://github.com/ros-industrial/robotiq.git # This is the upstream location 88 | git clone https://github.com/jhu-lcsr/robotiq.git -b ${ROSVERSION}-devel 89 | fi 90 | 91 | if [ ! -d ~/src/costar_ws/src/rqt_dot ]; then 92 | git clone https://github.com/jbohren/rqt_dot.git 93 | fi 94 | 95 | if [ ! -d ~/src/costar_ws/src/ar_track_alvar ]; then 96 | git clone https://github.com/ros-perception/ar_track_alvar.git -b ${ROSVERSION}-devel 97 | # ar_track_alvar_msgs is directly in ar_track_alvar, but is here for reference 98 | # git clone https://github.com/sniekum/ar_track_alvar_msgs.git 99 | fi 100 | 101 | if [ ! -d ~/src/costar_ws/src/hrl-kdl ]; then 102 | git clone https://github.com/gt-ros-pkg/hrl-kdl.git 103 | fi 104 | 105 | # xdot has been moved directly into costar_stack, but is here for reference 106 | #git clone https://github.com/cpaxton/xdot.git 107 | #git clone https://github.com/ThomasTimm/ur_modern_driver.git # This is the upstream location 108 | if [ ! -d ~/src/costar_ws/src/ur_modern_driver ]; then 109 | git clone https://github.com/ahundt/ur_modern_driver.git -b ${ROSVERSION}-devel 110 | fi 111 | 112 | # note: there are also binary versions on 14.04 113 | if [ ! -d ~/src/costar_ws/src/universal_robot ]; then 114 | git clone https://github.com/ros-industrial/universal_robot.git -b ${ROSVERSION}-devel 115 | fi 116 | 117 | if [ "$DISTRIB_RELEASE" = "16.04" ]; then 118 | if [ ! -d ~/src/costar_ws/src/soem ]; then 119 | git clone https://github.com/UTNuclearRoboticsPublic/soem.git 120 | fi 121 | fi 122 | 123 | if [ ! -d ~/src/costar_ws/src/objrecransac ]; then 124 | # Optional for vision utilities 125 | git clone https://github.com/jhu-lcsr/ObjRecRANSAC.git objrecransac 126 | # git clone https://github.com/ahundt/ObjRecRANSAC.git objrecransac 127 | # git clone https://github.com/tum-mvp/ObjRecRANSAC.git objrecransac # This is the upstream location 128 | fi 129 | 130 | if [ ! -d ~/src/costar_ws/src/costar_stack ]; then 131 | # https://github.com/jhu-lcsr/handeye_calib_camodocal 132 | git clone git@github.com:jhu-lcsr/handeye_calib_camodocal.git 133 | fi 134 | 135 | if [ ! -d ~/src/costar_ws/src/costar_stack ]; then 136 | # works on both indigo and kinetic 137 | git clone https://github.com/cpaxton/dmp.git -b indigo 138 | fi 139 | 140 | if [ -e ../devel/setup.bash ]; then 141 | source ../devel/setup.bash 142 | fi 143 | 144 | cd costar_stack 145 | git pull 146 | cd ../iiwa_stack 147 | git pull 148 | cd ../robotiq 149 | git pull 150 | cd ../rqt_dot 151 | git pull 152 | cd ../ar_track_alvar 153 | git pull 154 | cd ../hrl-kdl 155 | git pull 156 | cd ../ur_modern_driver 157 | git pull 158 | cd ../universal_robot 159 | git pull 160 | 161 | if [ "$DISTRIB_RELEASE" = "16.04" ]; then 162 | cd ../soem 163 | git pull 164 | fi 165 | 166 | cd ../objrecransac 167 | git pull 168 | cd ../handeye_calib_camodocal 169 | git pull 170 | cd ../dmp 171 | git pull 172 | cd .. 173 | 174 | 175 | # TODO(ahundt) FIX HACK: build objrecransac with standard cmake build, otherwise the headers won't be found. Is this on both kinetic and indigo? 176 | cd objrecransac 177 | mkdir -p build 178 | cd build 179 | cmake .. 180 | make -j install 181 | cd ../.. 182 | 183 | #echo "Ignore COSTAR_PERCEPTION until you have installed its dependencies." 184 | #touch costar_stack/costar_perception/CATKIN_IGNORE 185 | 186 | # There is a strange quirk where sp_segmenter optionally depends on ObjRecRANSAC 187 | # Building that package first helps resolve the dependency. 188 | catkin build objrecransac 189 | catkin build --continue 190 | 191 | 192 | 193 | cd $DIR -------------------------------------------------------------------------------- /cuda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "########################" 4 | echo "# CUDA and CUDNN Setup #" 5 | echo "########################" 6 | echo "" 7 | echo "Manual steps are involved! you may need to update the" 8 | echo "install paths and download some files yourse" 9 | echo "" 10 | echo "@author Andrew Hundt " 11 | echo "" 12 | 13 | 14 | # source: https://gist.github.com/phatblat/1713458 15 | # Save script's current directory 16 | DIR=$(pwd) 17 | 18 | # /bin/bash 19 | set -e 20 | set -u 21 | set -x 22 | 23 | echo "" 24 | echo "###################################################" 25 | echo "Go to the NVIDIA website and download CUDA + CUDNN" 26 | echo "https://developer.nvidia.com/cuda-toolkit" 27 | echo "https://developer.nvidia.com/cudnn" 28 | echo "and put it in ~/Downloads" 29 | echo "the new .deb versions are recommended on ubuntu" 30 | echo "" 31 | echo "IMPORTANT:" 32 | echo "You may need to install the latest graphics driver first" 33 | echo "CUDA must be installed with no graphics running" 34 | echo "to disable graphics (from terminal):" 35 | echo "sudo service lightdm stop" 36 | echo "###################################################" 37 | echo "" 38 | 39 | 40 | # NVIDIA CUDA 41 | sudo apt-get install -y linux-headers-$(uname -r) 42 | 43 | 44 | if [ ! -f ~/Downloads/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb ] ; then 45 | # cuda itself 46 | curl https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64 --output ~/Downloads/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb 47 | # latest patch 48 | curl https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/1/cuda-repo-ubuntu1604-9-1-local-cublas-performance-update-1_1.0-1_amd64 --output ~/Downloads/cuda-repo-ubuntu1604-9-1-local-cublas-performance-update-1_1.0-1_amd64.deb 49 | fi 50 | 51 | sudo dpkg -i ~/Downloads/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb 52 | sudo dpkg -i ~/Downloads/cuda-repo-ubuntu1604-9-1-local-cublas-performance-update-1_1.0-1_amd64.deb 53 | sudo apt-key add /var/cuda-repo-9-1-local/7fa2af80.pub 54 | sudo apt-get update 55 | sudo apt-get install -y cuda-libraries-9-1 cuda-repo-ubuntu1604-9-1-local-cublas-performance-update-1 56 | 57 | # Note that if you are having problems with these steps, manually 58 | # check the repository in the ubuntu software center: 59 | # https://askubuntu.com/questions/650692/installing-cuda-7-0-on-ubuntu-14-04 60 | 61 | # You will have to add the file to your software list. After running: 62 | 63 | # sudo dpkg -i cuda-repo-ubuntu1404-7-0-local_7.0-28_amd64.deb 64 | # open Softwares & Updates (search for it in the Dash) 65 | 66 | # In the Other Software tab, enable the checkbox corresponding to your package. It will be of the form 67 | 68 | # file:///var/cuda... 69 | 70 | # Installation Instructions from : 71 | # https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal: 72 | 73 | # `sudo dpkg -i cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb` 74 | # `sudo apt-key add /var/cuda-repo-/7fa2af80.pub` 75 | # `sudo apt-get update` 76 | # `sudo apt-get install cuda` 77 | 78 | # Other installation options are available in the form of meta-packages. For example, to install all the library packages, replace "cuda" with the "cuda-libraries-9-1" meta package. For more information on all the available meta packages click here. 79 | 80 | 81 | # nccl which is useful for horovod support http://github.com/uber/horovod/ 82 | if [ ! -f ~/Downloads/nccl-repo-ubuntu1604-2.1.4-ga-cuda9.1_1-1_amd64.deb ] ; then 83 | curl https://developer.nvidia.com/compute/machine-learning/nccl/secure/v2.1/prod/nccl-repo-ubuntu1604-2.1.4-ga-cuda9.1_1-1_amd64 --output nccl-repo-ubuntu1604-2.1.4-ga-cuda9.1_1-1_amd64.deb 84 | fi 85 | 86 | sudo dpkg -i ~/Downloads/nccl-repo-ubuntu1604-2.1.4-ga-cuda9.1_1-1_amd64.deb 87 | sudo apt-get update 88 | sudo apt-get install -y libnccl2 libnccl-dev libnccl-dev nccl-repo-ubuntu1604-2.1.4-ga-cuda9.1 89 | 90 | # The steps below are outdated, remove if there have been no problems 91 | # # install the CUDA profiler for cuda 8.0 92 | # # Here is how to profile tensorflow: https://towardsdatascience.com/howto-profile-tensorflow-1a49fb18073d 93 | # # also see https://github.com/tensorflow/tensorflow/issues/9341#issuecomment-324041125 94 | # if [ ! -f ~/Downloads/libcupti8.0_8.0.44-3_amd64.deb ] ; then 95 | # curl http://cz.archive.ubuntu.com/ubuntu/pool/multiverse/n/nvidia-cuda-toolkit/libcupti8.0_8.0.44-3_amd64.deb --output ~/Downloads/libcupti8.0_8.0.44-3_amd64.deb 96 | # fi 97 | 98 | # sudo dpkg -i ~/Downloads/libcupti8.0_8.0.44-3_amd64.deb 99 | 100 | # if [ ! -f ~/Downloads/libcupti-dev_8.0.44-3_amd64.deb ] ; then 101 | # curl http://cz.archive.ubuntu.com/ubuntu/pool/multiverse/n/nvidia-cuda-toolkit/libcupti-dev_8.0.44-3_amd64.deb --output ~/Downloads/libcupti-dev_8.0.44-3_amd64.deb 102 | # fi 103 | 104 | # sudo dpkg -i ~/Downloads/libcupti-dev_8.0.44-3_amd64.deb 105 | 106 | # install CUDNN for deep learning 107 | sh cudnn.sh 108 | 109 | 110 | # OLD ADVICE FROM 2016 111 | # -------------------- 112 | # echo "GTX1080 instructions that may help: https://github.com/fchollet/keras/issues/3043#issuecomment-233480326" 113 | # for anyone finding this: just spent a day trying to get a gtx 1070 to run on ubuntu 16.04 w/ CUDA 8 rc and Theano. Here are some guidelines: 114 | 115 | # gtx 1070 and 1080 require a nvidia 367 driver. You can't currently get this from apt, so you need to download a runfile and execute it w/ the ubuntu gui shut down. here's a tutorial: http://www.yourownlinux.com/2016/06/how-to-install-nvidia-367-27-stable-graphics-drivers-in-linux.html 116 | # cuda 7.5 did not seem to want to work w/ the 367 driver. Potentially I could have fixed this. Instead I decided to install cuda 8.0 rc. However, using the deb file installation approach automatically installed the nvidia 361 drivers, which caused a conflict that was very difficult to remove. This is the source of the "could not insert 'nvidia_361_uvm'" error. 117 | # Also, cuda 8.0 rc requires you to reinstall nvidia drivers anyway, which I did not realize. 118 | # To repair: 119 | # sudo apt-get purge nvidia* to remove 361 and its assorted packages. 120 | # get to pure shell w/ ctrl+alt+f2, `sudo service lightdm stop`, and use the 367 runfile w/ the --uninstall argument to uninstall the 367 drivers. i.e. sudo sh nvidia367.xx.run --uninstall 121 | # w/ lightdm shutdown, reinstall 367 drivers with the runfile. i.e. sudo sh nvidia367.xx.run 122 | # install cuda-8.0 rc w/ its runfile, which gives you the option to install the 361 drivers. When presented with it, choose no. i.e. sudo sh cuda-8.0.x.x.run 123 | # following this I needed to update some PATH stuff that was pointing to the cuda 7.5 folder. Also I had copied cuDNN files into 7.5 include and lib64 folders, so those files needed to be copied to the 8.0 equivalents. 124 | 125 | # echo "Also open /usr/local/cuda/include/host_config.h" 126 | # echo "and comment out the following line with two backslashes //" 127 | # echo "#error -- unsupported GNU version! gcc versions later than 5.3 are not supported!" 128 | # deep learning setup with GTX 1080 129 | # http://yangcha.github.io/GTX-1080/ 130 | 131 | cd $DIR 132 | -------------------------------------------------------------------------------- /cuda_9.0_cudnn_7.0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # source: https://gist.github.com/ashokpant/5c4e9481615f54af4025ab2085f85869 3 | 4 | # install CUDA Toolkit v9.0 5 | # instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb) 6 | CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb" 7 | wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG} 8 | sudo dpkg -i ${CUDA_REPO_PKG} 9 | sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub 10 | sudo apt-get update 11 | sudo apt-get -y install cuda-9-0 12 | 13 | CUDA_PATCH1="cuda-repo-ubuntu1604-9-0-local-cublas-performance-update_1.0-1_amd64-deb" 14 | wget https://developer.nvidia.com/compute/cuda/9.0/Prod/patches/1/${CUDA_PATCH1} 15 | sudo dpkg -i ${CUDA_PATCH1} 16 | sudo apt-get update 17 | 18 | # install cuDNN v7.0 19 | CUDNN_PKG="libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb" 20 | wget https://github.com/ashokpant/cudnn_archive/raw/master/v7.0/${CUDNN_PKG} 21 | sudo dpkg -i ${CUDNN_PKG} 22 | sudo apt-get update 23 | 24 | # install NVIDIA CUDA Profile Tools Interface ( libcupti-dev v9.0) 25 | sudo apt-get install cuda-command-line-tools-9-0 26 | 27 | # set environment variables 28 | export PATH=${PATH}:/usr/local/cuda-9.0/bin 29 | export CUDA_HOME=${CUDA_HOME}:/usr/local/cuda:/usr/local/cuda-9.0 30 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-9.0/lib64 31 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64 -------------------------------------------------------------------------------- /cudnn.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "############################" 10 | echo "# CUDNN - see cuda.sh for instructions" 11 | echo "############################" 12 | echo "# ASSUMES THE FOLLOWING ARE DOWNLOADED FROM THE NVIDIA CUDA WEBSITE:" 13 | echo "# ~/Downloads/cudnn-8.0-linux-x64-v6.0.tgz" 14 | echo "# https://developer.nvidia.com/cudnn" 15 | 16 | # currently just in the cuda install script 17 | 18 | # Manual setup: 19 | cd ~/Downloads 20 | if [ ! -f ~/Downloads/libcudnn7-dev_7.0.5.15-1+cuda9.1_amd64.deb ] ; then 21 | # runtime library 22 | curl https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/9.1_20171129/Ubuntu16_04-x64/libcudnn7_7.0.5.15-1+cuda9.1_amd64 --output libcudnn7_7.0.5.15-1+cuda9.1_amd64.deb 23 | # developer library which requires runtime library 24 | curl https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/9.1_20171129/Ubuntu16_04-x64/libcudnn7-dev_7.0.5.15-1+cuda9.1_amd64 --output libcudnn7-dev_7.0.5.15-1+cuda9.1_amd64.deb 25 | # tarball version 26 | curl https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/9.1_20171129/cudnn-9.1-linux-x64-v7 --output cudnn-9.1-linux-x64-v7.tgz 27 | fi 28 | 29 | sudo dpkg -i ~/Downloads/libcudnn7_7.0.5.15-1+cuda9.1_amd64.deb 30 | sudo dpkg -i ~/Downloads/libcudnn7-dev_7.0.5.15-1+cuda9.1_amd64.deb 31 | sudo apt-get install -y libcudnn7 libcudnn7-dev 32 | # sudo tar -xzvf cudnn-9.1-linux-x64-v7.0.tgz 33 | # sudo cp cuda/include/cudnn.h /usr/local/cuda/include 34 | # sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 35 | # sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* 36 | 37 | 38 | 39 | # commented outdated file path 40 | # if [ ! -f ~/Downloads/cudnn-8.0-linux-x64-v5.0-ga-tgz ] 41 | # then 42 | # curl https://developer.nvidia.com/rdp/assets/cudnn-8.0-linux-x64-v5.0-ga-tgz --output ~/Downloads/cudnn-8.0-linux-x64-v5.0-ga.tgz 43 | # fi 44 | 45 | 46 | 47 | # sudo dpkg -i ~/Downloads/libcudnn5_5.1.5-1+cuda8.0_amd64.deb 48 | # sudo dpkg -i ~/Downloads/libcudnn5-dev_5.1.5-1+cuda8.0_amd64.deb 49 | # sudo dpkg -i ~/Downloads/libcudnn5-doc_5.1.5-1+cuda8.0_amd64.deb 50 | # sudo apt-get update -y 51 | # sudo apt-get install -y libcudnn5 libcudnn5-dev libcudnn5-doc 52 | 53 | #https://stackoverflow.com/questions/16182620/commenting-out-lines-with-matching-string 54 | #https://github.com/BVLC/caffe/wiki/GeForce-GTX-1080,---CUDA-8.0,---Ubuntu-16.04,---Caffe 55 | #sed -i .backup "/#error -- unsupported GNU version!/s/^/\/\//g" /usr/local/cuda/include/host_config.h 56 | 57 | 58 | cd $DIR 59 | -------------------------------------------------------------------------------- /datasets/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # PASCAL VOC 4 | 5 | https://github.com/martinkersner/train-DeepLab 6 | 7 | ## augmented PASCAL VOC 8 | cd $DATASETS 9 | wget http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/semantic_contours/benchmark.tgz # 1.3 GB 10 | tar -zxvf benchmark.tgz 11 | mv benchmark_RELEASE VOC_aug 12 | 13 | ## original PASCAL VOC 2012 14 | wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar # 2 GB 15 | tar -xvf VOCtrainval_11-May-2012.tar 16 | mv VOCdevkit/VOC2012 VOC2012_orig && rm -r VOCdevkit -------------------------------------------------------------------------------- /datasets/coco.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# Download Microsoft coco dataset" 12 | echo "############################" 13 | echo " http://mscoco.org/" 14 | echo " https://github.com/pdollar/coco" 15 | echo " To install supporting software run robotics_setup/coco.sh" 16 | 17 | 18 | 19 | if [ ! -d $HOME/datasets ] 20 | mkdir -p $HOME/datasets/coco 21 | fi 22 | 23 | cd $HOME/datasets/coco 24 | 25 | # Note that by running this download you agree to microsoft's terms and conditions 26 | # http://mscoco.org/dataset/#download 27 | if [ ! -f $HOME/datasets/coco/train2014.zip ] ; then 28 | curl -O http://msvocds.blob.core.windows.net/coco2014/train2014.zip 29 | curl -O http://msvocds.blob.core.windows.net/coco2014/val2014.zip 30 | curl -O http://msvocds.blob.core.windows.net/coco2014/test2014.zip 31 | curl -O http://msvocds.blob.core.windows.net/coco2015/test2015.zip 32 | curl -O http://msvocds.blob.core.windows.net/annotations-1-0-3/instances_train-val2014.zip 33 | curl -O http://msvocds.blob.core.windows.net/annotations-1-0-3/person_keypoints_trainval2014.zip 34 | curl -O http://msvocds.blob.core.windows.net/annotations-1-0-3/captions_train-val2014.zip 35 | curl -O http://msvocds.blob.core.windows.net/annotations-1-0-4/image_info_test2014.zip 36 | curl -O http://msvocds.blob.core.windows.net/annotations-1-0-4/image_info_test2015.zip 37 | 38 | unzip -u train2014.zip 39 | unzip -u val2014.zip 40 | unzip -u test2014.zip 41 | unzip -u test2015.zip 42 | unzip -u instances_train-val2014.zip 43 | unzip -u person_keypoints_trainval2014.zip 44 | unzip -u captions_train-val2014.zip 45 | unzip -u image_info_test2014.zip 46 | unzip -u image_info_test2015.zip 47 | 48 | fi 49 | 50 | cd $DIR 51 | -------------------------------------------------------------------------------- /datasets/google_brain_robot_data/depth_image_encoding.py: -------------------------------------------------------------------------------- 1 | """Creates an image from a numpy array of floating point depth data. 2 | 3 | Examples: 4 | 5 | depth_array is a 2D numpy array of floating point depth data in meters. 6 | 7 | depth_rgb = FloatArrayToRgbImage(depth_array) 8 | depth_rgb is a PIL Image object containing the same data as 24-bit 9 | integers encoded in the RGB bytes. 10 | depth_rgb.save('image_file.png') - to save to a file. 11 | 12 | depth_array2 = ImageToFloatArray(depth_rgb) 13 | depth_array2 is a 2D numpy array containing the same data as 14 | depth_array up to the precision of the RGB image (1/256 mm). 15 | 16 | depth_gray = FloatArrayToGrayImage(depth_array) 17 | depth_gray is a PIL Image object containing the same data rounded to 18 | 8-bit integers. 19 | depth_gray.save('image_file.jpg', quality=95) - to save to a file. 20 | 21 | depth_array3 = ImageToFloatArray(depth_gray) 22 | depth_array3 is a 2D numpy array containing the same data as 23 | depth_array up to the precision of the grayscale image (1 cm). 24 | 25 | The image conversions first scale and round the values and then pack 26 | them into the desired type in a numpy array before converting the 27 | array to a PIL Image object. The Image can be saved in any format. 28 | We are using PNG for RGB and high quality JPEG for grayscale images. 29 | 30 | You can use different numeric types (e.g. np.uint16, np.int32), but 31 | not all combinations of numeric type and image format are supported by 32 | PIL or standard image viewers. 33 | 34 | """ 35 | 36 | import numpy as np 37 | from PIL import Image 38 | 39 | 40 | def ClipFloatValues(float_array, min_value, max_value): 41 | """Clips values to the range [min_value, max_value]. 42 | 43 | First checks if any values are out of range and prints a message. 44 | Then clips all values to the given range. 45 | 46 | Args: 47 | float_array: 2D array of floating point values to be clipped. 48 | min_value: Minimum value of clip range. 49 | max_value: Maximum value of clip range. 50 | 51 | Returns: 52 | The clipped array. 53 | 54 | """ 55 | if float_array.min() < min_value or float_array.max() > max_value: 56 | logging.debug('Image has out-of-range values [%f,%f] not in [%d,%d]', 57 | float_array.min(), float_array.max(), min_value, max_value) 58 | float_array = np.clip(float_array, min_value, max_value) 59 | return float_array 60 | 61 | 62 | DEFAULT_RGB_SCALE_FACTOR = 256000.0 63 | 64 | 65 | def FloatArrayToRgbImage(float_array, 66 | scale_factor=DEFAULT_RGB_SCALE_FACTOR, 67 | drop_blue=False): 68 | """Convert a floating point array of values to an RGB image. 69 | 70 | Convert floating point values to a fixed point representation where 71 | the RGB bytes represent a 24-bit integer. 72 | R is the high order byte. 73 | B is the low order byte. 74 | The precision of the depth image is 1/256 mm. 75 | 76 | Floating point values are scaled so that the integer values cover 77 | the representable range of depths. 78 | 79 | This image representation should only use lossless compression. 80 | 81 | Args: 82 | float_array: Input array of floating point depth values in meters. 83 | scale_factor: Scale value applied to all float values. 84 | drop_blue: Zero out the blue channel to improve compression, results in 1mm 85 | precision depth values. 86 | 87 | Returns: 88 | 24-bit RGB PIL Image object representing depth values. 89 | """ 90 | # Scale the floating point array. 91 | scaled_array = np.floor(float_array * scale_factor + 0.5) 92 | # Convert the array to integer type and clip to representable range. 93 | min_inttype = 0 94 | max_inttype = 2**24 - 1 95 | scaled_array = ClipFloatValues(scaled_array, min_inttype, max_inttype) 96 | int_array = scaled_array.astype(np.uint32) 97 | # Calculate: 98 | # r = (f / 256) / 256 high byte 99 | # g = (f / 256) % 256 middle byte 100 | # b = f % 256 low byte 101 | rg = np.divide(int_array, 256) 102 | r = np.divide(rg, 256) 103 | g = np.mod(rg, 256) 104 | image_shape = int_array.shape 105 | rgb_array = np.zeros((image_shape[0], image_shape[1], 3), dtype=np.uint8) 106 | rgb_array[..., 0] = r 107 | rgb_array[..., 1] = g 108 | if not drop_blue: 109 | # Calculate the blue channel and add it to the array. 110 | b = np.mod(int_array, 256) 111 | rgb_array[..., 2] = b 112 | image_mode = 'RGB' 113 | image = Image.fromarray(rgb_array, mode=image_mode) 114 | return image 115 | 116 | 117 | DEFAULT_GRAY_SCALE_FACTOR = {np.uint8: 100.0, 118 | np.uint16: 1000.0, 119 | np.int32: DEFAULT_RGB_SCALE_FACTOR} 120 | 121 | 122 | def FloatArrayToGrayImage(float_array, scale_factor=None, image_dtype=np.uint8): 123 | """Convert a floating point array of values to an RGB image. 124 | 125 | Convert floating point values to a fixed point representation with 126 | the given bit depth. 127 | 128 | The precision of the depth image with default scale_factor is: 129 | uint8: 1cm, with a range of [0, 2.55m] 130 | uint16: 1mm, with a range of [0, 65.5m] 131 | int32: 1/256mm, with a range of [0, 8388m] 132 | 133 | Right now, PIL turns uint16 images into a very strange format and 134 | does not decode int32 images properly. Only uint8 works correctly. 135 | 136 | Args: 137 | float_array: Input array of floating point depth values in meters. 138 | scale_factor: Scale value applied to all float values. 139 | image_dtype: Image datatype, which controls the bit depth of the grayscale 140 | image. 141 | 142 | Returns: 143 | Grayscale PIL Image object representing depth values. 144 | 145 | """ 146 | # Ensure that we have a valid numeric type for the image. 147 | if image_dtype == np.uint16: 148 | image_mode = 'I;16' 149 | elif image_dtype == np.int32: 150 | image_mode = 'I' 151 | else: 152 | image_dtype = np.uint8 153 | image_mode = 'L' 154 | if scale_factor is None: 155 | scale_factor = DEFAULT_GRAY_SCALE_FACTOR[image_dtype] 156 | # Scale the floating point array. 157 | scaled_array = np.floor(float_array * scale_factor + 0.5) 158 | # Convert the array to integer type and clip to representable range. 159 | min_dtype = np.iinfo(image_dtype).min 160 | max_dtype = np.iinfo(image_dtype).max 161 | scaled_array = ClipFloatValues(scaled_array, min_dtype, max_dtype) 162 | 163 | image_array = scaled_array.astype(image_dtype) 164 | image = Image.fromarray(image_array, mode=image_mode) 165 | return image 166 | 167 | 168 | def ImageToFloatArray(image, scale_factor=None): 169 | """Recovers the depth values from an image. 170 | 171 | Reverses the depth to image conversion performed by FloatArrayToRgbImage or 172 | FloatArrayToGrayImage. 173 | 174 | The image is treated as an array of fixed point depth values. Each 175 | value is converted to float and scaled by the inverse of the factor 176 | that was used to generate the Image object from depth values. If 177 | scale_factor is specified, it should be the same value that was 178 | specified in the original conversion. 179 | 180 | The result of this function should be equal to the original input 181 | within the precision of the conversion. 182 | 183 | Args: 184 | image: Depth image output of FloatArrayTo[Format]Image. 185 | scale_factor: Fixed point scale factor. 186 | 187 | Returns: 188 | A 2D floating point numpy array representing a depth image. 189 | 190 | """ 191 | image_array = np.array(image) 192 | image_dtype = image_array.dtype 193 | image_shape = image_array.shape 194 | 195 | channels = image_shape[2] if len(image_shape) > 2 else 1 196 | assert 2 <= len(image_shape) <= 3 197 | if channels == 3: 198 | # RGB image needs to be converted to 24 bit integer. 199 | float_array = np.sum(image_array * [65536, 256, 1], axis=2) 200 | if scale_factor is None: 201 | scale_factor = DEFAULT_RGB_SCALE_FACTOR 202 | else: 203 | if scale_factor is None: 204 | scale_factor = DEFAULT_GRAY_SCALE_FACTOR[image_dtype.type] 205 | float_array = image_array.astype(np.float32) 206 | scaled_array = float_array / scale_factor 207 | return scaled_array 208 | -------------------------------------------------------------------------------- /datasets/google_brain_robot_data/download_grasp_listing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Example: 4 | # 5 | # download_listing.sh listing.txt ./tmp 6 | # 7 | # will download all of the files listed in the file, listing.txt, into 8 | # a directory, "./tmp". 9 | # 10 | # Each line of the listing.txt file should contain the path from the 11 | # bucket root to a file. 12 | # 13 | # Source: https://sites.google.com/site/brainrobotdata/home/grasping-dataset 14 | 15 | ARGC="$#" 16 | LISTING_FILE=grasp_listing.txt 17 | if [ "${ARGC}" -ge 1 ]; then 18 | LISTING_FILE=$1 19 | fi 20 | # will actually go to $HOME/datasets/google_brain_robot_data/grasping/* 21 | OUTPUT_DIR="$HOME/datasets/google_brain_robot_data/" 22 | if [ "${ARGC}" -ge 2 ]; then 23 | OUTPUT_DIR=$2 24 | fi 25 | 26 | echo "OUTPUT_DIR=$OUTPUT_DIR" 27 | 28 | mkdir -p "${OUTPUT_DIR}" 29 | 30 | function download_file { 31 | FILE=$1 32 | BUCKET="https://storage.googleapis.com/brain-robotics-data" 33 | URL="${BUCKET}/${FILE}" 34 | OUTPUT_FILE="${OUTPUT_DIR}/${FILE}" 35 | DIRECTORY=`dirname ${OUTPUT_FILE}` 36 | echo DIRECTORY=$DIRECTORY 37 | mkdir -p "${DIRECTORY}" 38 | curl --output ${OUTPUT_FILE} ${URL} 39 | } 40 | 41 | while read filename; do 42 | download_file $filename 43 | done <${LISTING_FILE} 44 | -------------------------------------------------------------------------------- /datasets/google_brain_robot_data/download_push_listing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Example: 4 | # 5 | # download_listing.sh listing.txt ./tmp 6 | # 7 | # will download all of the files listed in the file, listing.txt, into 8 | # a directory, "./tmp". 9 | # 10 | # Each line of the listing.txt file should contain the path from the 11 | # bucket root to a file. 12 | # 13 | # Source: https://sites.google.com/site/brainrobotdata/home/push-dataset 14 | 15 | ARGC="$#" 16 | LISTING_FILE=push_listing.txt 17 | if [ "${ARGC}" -ge 1 ]; then 18 | LISTING_FILE=$1 19 | fi 20 | # will actually go to $HOME/datasets/google_brain_robot_data/push/* 21 | OUTPUT_DIR="$HOME/datasets/google_brain_robot_data/" 22 | if [ "${ARGC}" -ge 2 ]; then 23 | OUTPUT_DIR=$2 24 | fi 25 | 26 | echo "OUTPUT_DIR=$OUTPUT_DIR" 27 | 28 | mkdir -p "${OUTPUT_DIR}" 29 | 30 | function download_file { 31 | FILE=$1 32 | BUCKET="https://storage.googleapis.com/brain-robotics-data" 33 | URL="${BUCKET}/${FILE}" 34 | OUTPUT_FILE="${OUTPUT_DIR}/${FILE}" 35 | DIRECTORY=`dirname ${OUTPUT_FILE}` 36 | echo DIRECTORY=$DIRECTORY 37 | mkdir -p "${DIRECTORY}" 38 | curl --output ${OUTPUT_FILE} ${URL} 39 | } 40 | 41 | while read filename; do 42 | download_file $filename 43 | done <${LISTING_FILE} 44 | -------------------------------------------------------------------------------- /datasets/google_brain_robot_data/grab_train_images.py: -------------------------------------------------------------------------------- 1 | """Code for building the input for the prediction model. 2 | V1 from https://sites.google.com/site/brainrobotdata/home/push-dataset 3 | requires moviepy package 4 | """ 5 | 6 | import os 7 | 8 | import numpy as np 9 | import tensorflow as tf 10 | 11 | from tensorflow.python.platform import flags 12 | from tensorflow.python.platform import gfile 13 | 14 | 15 | FLAGS = flags.FLAGS 16 | 17 | # Original image dimensions 18 | ORIGINAL_WIDTH = 640 19 | ORIGINAL_HEIGHT = 512 20 | COLOR_CHAN = 3 21 | BATCH_SIZE = 25 22 | 23 | def build_image_input(train=True, novel=True): 24 | """Create input tfrecord tensors. 25 | 26 | Args: 27 | novel: whether or not to grab novel or seen images. 28 | Returns: 29 | list of tensors corresponding to images. The images 30 | tensor is 5D, batch x time x height x width x channels. 31 | Raises: 32 | RuntimeError: if no files found. 33 | """ 34 | if train: 35 | data_dir = 'push/push_train' 36 | elif novel: 37 | data_dir = 'push/push_testnovel' 38 | else: 39 | data_dir = 'push/push_testseen' 40 | filenames = gfile.Glob(os.path.join(data_dir, '*')) 41 | if not filenames: 42 | raise RuntimeError('No data files found.') 43 | filename_queue = tf.train.string_input_producer(filenames, shuffle=False) 44 | reader = tf.TFRecordReader() 45 | _, serialized_example = reader.read(filename_queue) 46 | 47 | image_seq = [] 48 | 49 | for i in range(25): 50 | image_name = 'move/' + str(i) + '/image/encoded' 51 | features = {image_name: tf.FixedLenFeature([1], tf.string)} 52 | features = tf.parse_single_example(serialized_example, features=features) 53 | 54 | image_buffer = tf.reshape(features[image_name], shape=[]) 55 | image = tf.image.decode_jpeg(image_buffer, channels=COLOR_CHAN) 56 | image.set_shape([ORIGINAL_HEIGHT, ORIGINAL_WIDTH, COLOR_CHAN]) 57 | 58 | image = tf.reshape(image, [1, ORIGINAL_HEIGHT, ORIGINAL_WIDTH, COLOR_CHAN]) 59 | # image = tf.image.resize_bicubic(image, [IMG_HEIGHT, IMG_WIDTH]) 60 | image_seq.append(image) 61 | 62 | image_seq = tf.concat(0, image_seq) 63 | 64 | 65 | image_batch = tf.train.batch( 66 | [image_seq], 67 | BATCH_SIZE, 68 | num_threads=1, 69 | capacity=1) 70 | return image_batch 71 | 72 | import moviepy.editor as mpy 73 | def npy_to_gif(npy, filename): 74 | clip = mpy.ImageSequenceClip(list(npy), fps=10) 75 | clip.write_gif(filename) 76 | 77 | train_image_tensor = build_image_input() 78 | sess = tf.InteractiveSession() 79 | tf.train.start_queue_runners(sess) 80 | sess.run(tf.initialize_all_variables()) 81 | train_videos = sess.run(train_image_tensor) 82 | 83 | for i in range(BATCH_SIZE): 84 | video = train_videos[i] 85 | npy_to_gif(video, '~/train_' + str(i) + '.gif') 86 | 87 | -------------------------------------------------------------------------------- /datasets/imagenet.sh: -------------------------------------------------------------------------------- 1 | 2 | # source: https://gist.github.com/phatblat/1713458 3 | # Save script's current directory 4 | DIR=$(pwd) 5 | 6 | set -e 7 | set -u 8 | set -x 9 | 10 | 11 | echo "############################" 12 | echo "# Download ImageNet Labels in COCO format" 13 | echo "############################" 14 | echo " http://mscoco.org/external/" 15 | echo " http://mscoco.org/" 16 | echo " https://github.com/pdollar/coco" 17 | echo " To install supporting software run robotics_setup/coco.sh" 18 | 19 | 20 | 21 | if [ ! -d $HOME/datasets ] ; then 22 | mkdir -p $HOME/datasets/coco 23 | fi 24 | 25 | cd $HOME/datasets/coco 26 | 27 | # Note that by running this download you agree to microsoft's terms and conditions 28 | # http://mscoco.org/dataset/#download 29 | if [ ! -f $HOME/datasets/coco/ILSVRC2014.zip ] ; then 30 | curl -O http://mscoco.org/static/annotations/ILSVRC2014.zip 31 | unzip ILSVRC2014.zip 32 | fi 33 | 34 | 35 | if [ ! -d $HOME/datasets/ILSVRC12 ] ; then 36 | mkdir -p $HOME/datasets/ILSVRC12 37 | fi 38 | 39 | cd $HOME/datasets/ILSVRC12 40 | 41 | if [ ! -f $HOME/datasets/ILSVRC12 ] ; then 42 | curl -O http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz 43 | tar -xvzf caffe_ilsvrc12.tar.gz 44 | fi 45 | 46 | 47 | -------------------------------------------------------------------------------- /datasets/pascal_voc.sh: -------------------------------------------------------------------------------- 1 | 2 | # source: https://gist.github.com/phatblat/1713458 3 | # Save script's current directory 4 | DIR=$(pwd) 5 | 6 | set -e 7 | set -u 8 | set -x 9 | 10 | 11 | echo "############################" 12 | echo "# Download PASCAL VOC Labels in COCO format" 13 | echo "############################" 14 | echo " http://mscoco.org/external/" 15 | echo " http://mscoco.org/" 16 | echo " https://github.com/pdollar/coco" 17 | echo " To install supporting software run robotics_setup/coco.sh" 18 | 19 | 20 | 21 | if [ ! -d $HOME/datasets ] 22 | mkdir -p $HOME/datasets/coco 23 | fi 24 | 25 | cd $HOME/datasets/coco 26 | 27 | # Note that by running this download you agree to microsoft's terms and conditions 28 | # http://mscoco.org/dataset/#download 29 | if [ ! -f $HOME/datasets/coco/PASCAL_VOC.zip ] ; then 30 | curl -O http://mscoco.org/static/annotations/PASCAL_VOC.zip 31 | fi 32 | 33 | 34 | -------------------------------------------------------------------------------- /direnv.sh: -------------------------------------------------------------------------------- 1 | 2 | DIR=$(pwd) 3 | 4 | set -e 5 | set -u 6 | set -x 7 | 8 | echo "###############################################" 9 | echo "# DirEnv https://github.com/direnv/direnv" 10 | echo "###############################################" 11 | echo "#" 12 | echo "# - directory based environment" 13 | echo "# - command line variable configuration" 14 | echo "#" 15 | echo "# For when you need to set some command line variables" 16 | echo "# depending on your project directory" 17 | echo "# " 18 | 19 | sudo apt-get install -y direnv 20 | 21 | cd $DIR 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docker.sh: -------------------------------------------------------------------------------- 1 | 2 | set -e 3 | set -x 4 | set -u 5 | 6 | # DOCKER 7 | # Manual Steps: 8 | # https://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo 9 | # add the current user to the docker group 10 | # sudo gpasswd -a ${USER} docker 11 | # sudo service docker restart 12 | 13 | 14 | if [ -x "$(command -v docker)" ] ; then 15 | echo "docker seems to already be installed, so we will just run the update steps, if there is a problem run steps manually to avoid cluttering your apt repositories" 16 | 17 | sudo apt-get update 18 | sudo apt-get install docker-ce 19 | exit 0 20 | fi 21 | 22 | sudo apt-get install \ 23 | apt-transport-https \ 24 | ca-certificates \ 25 | curl \ 26 | software-properties-common 27 | 28 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 29 | 30 | sudo apt-key fingerprint 0EBFCD88 31 | 32 | sudo add-apt-repository \ 33 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ 34 | $(lsb_release -cs) \ 35 | stable" 36 | 37 | 38 | sudo apt-get update 39 | sudo apt-get install docker-ce 40 | -------------------------------------------------------------------------------- /download.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahundt/robotics_setup/99d942cd6fb970d1461f4d4600d777bf38dfd772/download.sh -------------------------------------------------------------------------------- /eigen3.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sudo apt-get install -y libeigen3-dev 5 | -------------------------------------------------------------------------------- /flatbuffers.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | 5 | # source: https://gist.github.com/phatblat/1713458 6 | # Save script's current directory 7 | DIR=$(pwd) 8 | 9 | # /bin/bash 10 | set -e 11 | set -u 12 | set -x 13 | 14 | 15 | ############### 16 | # google flatbuffers install 17 | 18 | cd ~/src 19 | if [ ! -d ~/src/flatbuffers ] 20 | then 21 | git clone https://github.com/google/flatbuffers.git -b v1.8.0 22 | cd flatbuffers 23 | mkdir build 24 | fi 25 | cd ~/src/flatbuffers 26 | # don't pull because flatbuffers does release tags, not release branches 27 | # git pull 28 | cd ~/src/flatbuffers/build 29 | cmake .. -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=Release 30 | make -j 31 | sudo make install 32 | cd ../.. 33 | 34 | cd $DIR 35 | -------------------------------------------------------------------------------- /git.sh: -------------------------------------------------------------------------------- 1 | # /bin/bash 2 | 3 | sudo apt-get install -y git kdiff3 4 | 5 | # https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup 6 | git config --global user.name "Andrew Hundt" 7 | git config --global user.email ATHundt@gmail.com 8 | 9 | # https://stackoverflow.com/questions/33308482/git-how-configure-kdiff3-as-merge-tool-and-diff-tool 10 | git config --global --add merge.tool kdiff3 11 | git config --global --add mergetool.kdiff3.trustExitCode false 12 | 13 | git config --global --add diff.guitool kdiff3 14 | git config --global --add difftool.kdiff3.trustExitCode false -------------------------------------------------------------------------------- /golang.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "############################" 10 | echo "# Google Go" 11 | echo "############################" 12 | echo "#" 13 | echo "# golang.com" 14 | 15 | sudo apt-get install -y golang 16 | 17 | sudo mkdir -m 0700 -p /usr/local/go 18 | mkdir -m 7700 -p $HOME/go 19 | export GOPATH=$HOME/go 20 | export PATH=$PATH:$GOPATH/bin 21 | 22 | # location of goroot: 23 | # go env GOROOT 24 | 25 | cd $DIR 26 | -------------------------------------------------------------------------------- /googletest.sh: -------------------------------------------------------------------------------- 1 | 2 | DIR=$(pwd) 3 | 4 | set -e 5 | set -u 6 | set -x 7 | 8 | 9 | echo "###############################################" 10 | echo "# googletest https://github.com/google/googletest" 11 | echo "###############################################" 12 | 13 | 14 | 15 | cd ~/src/ 16 | if [ ! -d ~/src/googletest ] 17 | then 18 | git clone --recursive https://github.com/google/googletest.git 19 | fi 20 | 21 | cd googletest 22 | git pull 23 | mkdir -p build 24 | cd build 25 | cmake .. 26 | make -j && sudo make install 27 | 28 | -------------------------------------------------------------------------------- /gpustat.sh: -------------------------------------------------------------------------------- 1 | 2 | #################################### 3 | # gpustat - see stats about your gpu 4 | # https://github.com/wookayin/gpustat 5 | # 6 | # to run: 7 | # watch --color -n1.0 gpustat --color 8 | 9 | pip install --user --upgrade gpustat 10 | -------------------------------------------------------------------------------- /gpyopt.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# GPy and GPyOpt " 12 | echo "###############################################" 13 | echo "#" 14 | echo "# Gaussian process optimization using GPy. " 15 | echo "# Performs global optimization with different" 16 | echo "# acquisition functions. Among other functionalities," 17 | echo "# it is possible to use GPyOpt to optimize physical " 18 | echo "# experiments (sequentially or in batches) and tune " 19 | echo "# the parameters of Machine Learning algorithms." 20 | echo "#" 21 | echo "# https://github.com/SheffieldML/GPyOpt " 22 | echo "# https://github.com/SheffieldML/GPy " 23 | echo "#" 24 | echo "# WARNING: local install on devel branch until the following issue fix is released:" 25 | echo "#" 26 | echo "# https://github.com/SheffieldML/GPyOpt/issues/85" 27 | 28 | # pip2 install gpy gpyopt --user --upgrade 29 | # pip3 install gpy gpyopt --user --upgrade 30 | 31 | # GPy 32 | cd ~/src 33 | if [ ! -d ~/src/gpy ] ; then 34 | git clone https://github.com/SheffieldML/GPy gpy 35 | fi 36 | cd gpy 37 | git pull 38 | pip install -e . --user --upgrade 39 | pip2 install -e . --user --upgrade 40 | 41 | # GPyOpt 42 | cd ~/src 43 | if [ ! -d ~/src/gpyopt ] ; then 44 | git clone https://github.com/SheffieldML/GPyOpt gpyopt -b devel 45 | fi 46 | cd gpyopt 47 | git pull 48 | 49 | # pip could be python3, disabled until 50 | # https://github.com/SheffieldML/GPyOpt/issues/163 is resolved 51 | # pip install -e . --user --upgrade 52 | pip2 install -e . --user --upgrade 53 | 54 | 55 | cd $DIR -------------------------------------------------------------------------------- /grl_kuka.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # source: https://gist.github.com/phatblat/1713458 5 | # Save script's current directory 6 | DIR=$(pwd) 7 | 8 | # /bin/bash 9 | set -e 10 | set -u 11 | set -x 12 | 13 | ############### 14 | # grl install 15 | 16 | 17 | # source: https://github.com/ahundt/grl/blob/master/INSTALL.md 18 | sudo apt-get update 19 | sudo apt-get install -y libtool pkg-config build-essential autoconf automake cmake cmake-curses-gui 20 | sudo apt-get install -y libboost-all-dev libeigen3-dev libgoogle-glog-dev 21 | sudo apt-get install -y doxygen libceres-dev 22 | 23 | . /etc/lsb-release # get ubuntu version number 24 | # only install 25 | if [ "$DISTRIB_RELEASE" = "16.04" ] || [ "$DISTRIB_RELEASE" = "14.04" ]; then 26 | ./ros.sh 27 | EXTRA_TOOLS="-DWITH_ROS=ON" 28 | fi 29 | 30 | ./cmake-basis.sh 31 | ./eigen3.sh 32 | ./ceres.sh 33 | ./flatbuffers.sh 34 | ./spdlog.sh 35 | ./robotics_tasks.sh 36 | ./trtk.sh 37 | ./vrep.sh 38 | 39 | SCRIPT_DIR=$(pwd) 40 | 41 | cd ~/src/ 42 | if [ ! -d ~/src/grl ] 43 | then 44 | git clone https://github.com/ahundt/grl.git 45 | fi 46 | 47 | cd grl 48 | git pull 49 | 50 | if [ ! -d ~/src/grl/build ] 51 | then 52 | mkdir build 53 | fi 54 | 55 | cd build 56 | 57 | cmake .. -DBUILD_ALL_MODULES=ON -DBUILD_DOCUMENTATION=ON -DBUILD_EXAMPLE=ON \ 58 | -DMODULE_grl=ON \ 59 | -DMODULE_robone=ON \ 60 | -DMODULE_roboneprivate=ON \ 61 | -DWITH_Ceres=ON \ 62 | -DWITH_CisstNetlib=OFF \ 63 | -DWITH_Eigen3=ON \ 64 | -DWITH_FRI_Client_SDK_Cpp=OFF \ 65 | -DWITH_Nanopb=OFF \ 66 | -DWITH_OpenCV=OFF \ 67 | -DWITH_PCL=OFF \ 68 | -DWITH_RBDyn=ON \ 69 | -DWITH_SpaceVecAlg=ON \ 70 | -DWITH_TRTK=ON \ 71 | -DWITH_Tasks=ON \ 72 | -DWITH_Threads=ON \ 73 | -DWITH_cisst=OFF \ 74 | -DWITH_freenect2=OFF \ 75 | -DWITH_sawConstraintController=OFF\ 76 | -DWITH_sch-core=ON \ 77 | -DWITH_spdlog=ON \ 78 | -DWITH_ur_modern_driver=OFF $EXTRA_TOOLS 79 | 80 | make -j 81 | sudo make install 82 | cd ../.. 83 | 84 | #./robonetracker_symlinks.sh 85 | 86 | 87 | cd $DIR 88 | -------------------------------------------------------------------------------- /gslicr.sh: -------------------------------------------------------------------------------- 1 | 2 | # source: https://gist.github.com/phatblat/1713458 3 | # Save script's current directory 4 | DIR=$(pwd) 5 | 6 | set -e 7 | set -u 8 | set -x 9 | 10 | echo "############################" 11 | echo "# gSLICr: Real-time super-pixel segmentation https://github.com/carlren/gSLICr" 12 | echo "############################" 13 | echo "" 14 | echo "" 15 | 16 | # create cmake package registry 17 | 18 | # install https://github.com/stevenlovegrove/pangolin 19 | cd ~/src/ 20 | if [ ! -d ~/src/gSLICr ] 21 | then 22 | git clone https://github.com/carlren/gSLICr.git 23 | fi 24 | cd gSLICr 25 | git pull 26 | mkdir -p build 27 | cd build 28 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local 29 | make 30 | 31 | 32 | cd $DIR 33 | -------------------------------------------------------------------------------- /guided_policy_search.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | sudo apt-get update 10 | sudo apt-get install -y libtool pkg-config build-essential autoconf automake cmake cmake-curses-gui pkg-config 11 | sudo apt-get install -y libboost-all-dev libeigen3-dev doxygen 12 | 13 | sh python.sh 14 | 15 | sudo apt-get install -y libprotobuf-dev protobuf-compiler libboost-all-dev 16 | 17 | pip install protobuf 18 | pip install pybindgen 19 | 20 | echo "############################" 21 | echo "# Guided Policy Search" 22 | echo "############################" 23 | echo "# repo: https://github.com/cbfinn/gps " 24 | echo "# docs: http://rll.berkeley.edu/gps/" 25 | echo "# this script is based on the docs link" 26 | echo "" 27 | echo "MANUAL STEPS REQUIRED - NEED to run ros.sh and mujoco.sh first for full installation" 28 | echo " MANUAL STEPS FOR MUJOCO LICENSE SEE http://rll.berkeley.edu/gps/" 29 | echo " with ubuntu 16.04 cmake 3.5: comment out line 64 of /usr/share/cmake-3.5/Modules/FindPythonLibs.cmake" 30 | 31 | cd ~/src 32 | 33 | #location="ahundt" # github.com/ahundt/gps # I have some patches here 34 | location="cbfinn" # github.com/cbfinn/gps # ongoing development happens here 35 | 36 | branch="master" 37 | 38 | # install https://github.com/cbfinn/gps 39 | # note: still putting it in jrl-umi3218 for consistency 40 | if [ ! -d ~/src/gps ] 41 | then 42 | git clone --recursive https://github.com/${location}/gps.git 43 | fi 44 | 45 | cd gps 46 | git pull 47 | git checkout ${branch} 48 | 49 | ./compile_proto.sh 50 | 51 | # Here are the instructions for setting up Pybox2D. 52 | # https://github.com/pybox2d/pybox2d 53 | sudo apt-get install -y build-essential python-dev swig python-pygame subversion python-box2d 54 | 55 | # Steps for mujoco setup 56 | sudo apt-get install -y openscenegraph libopenscenegraph-dev 57 | 58 | # NOTE: MANUAL STEPS FOR MUJOCO LICENSE SEE http://rll.berkeley.edu/gps/ 59 | if [ -d ~/src/mujoco/mjpro131 ] 60 | then 61 | cp -a ~/src/mujoco/mjpro131 ~/src/gps/src/3rdparty/mjpro 62 | cd ~/src/gps/build 63 | cmake ../src/3rdparty 64 | make -j 65 | fi 66 | 67 | 68 | # ROS SETUP WITH CAFFE http://rll.berkeley.edu/gps/ 69 | sudo apt-get install -y ros-kinetic-pr2-common ros-kinetic-pr2-dashboard-aggregator ros-kinetic-pr2-description ros-kinetic-pr2-machine ros-kinetic-pr2-msgs ros-kinetic-gazebo-ros-control ros-kinetic-moveit-ros-control-interface ros-kinetic-moveit-sim-controller 70 | 71 | if [ -d /opt/ros/kinetic ] 72 | then 73 | export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$HOME/src/gps:$HOME/src/gps/src/gps_agent_pkg 74 | cd ~/src/gps/src/gps_agent_pkg/ 75 | cmake . -DUSE_CAFFE=1 -DUSE_CAFFE_GPU=1 -DCAFFE_INCLUDE_PATH=~/src/caffe/distribute/include -DCAFFE_LIBRARY_PATH=~/src/caffe/build/lib 76 | make -j 77 | fi 78 | 79 | 80 | cd ~/src 81 | 82 | 83 | 84 | cd $DIR 85 | -------------------------------------------------------------------------------- /homebrew-robotics.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is intended to setup repositories useful for robotics 4 | # with dependencies on homebrew or linuxbrew depending on the OS being used 5 | # @author Andrew Hundt 6 | # 7 | # 8 | # One step setup command for robonetracker: 9 | # bash <(curl -fsSL https://raw.githubusercontent.com/ahundt/homebrew-robotics/master/robonetracker.sh) 10 | 11 | echo "" 12 | echo "###############################################################################################" 13 | echo "# Make sure you have access to https://github.com/ahundt/robonetracker #" 14 | echo "# Also, ensure you have your ssh key configured, if you don't you'll have to finish manually! #" 15 | echo "###############################################################################################" 16 | echo "" 17 | 18 | 19 | # stop on errors 20 | set -e 21 | set -u 22 | set -x 23 | 24 | 25 | # source: https://gist.github.com/phatblat/1713458 26 | # Save script's current directory 27 | DIR=$(pwd) 28 | 29 | 30 | sh python.sh 31 | 32 | # 33 | # Check if Homebrew is installed 34 | # 35 | if ! [ -x "$(command -v brew)" ] ; then 36 | 37 | OS=`uname` 38 | case $OS in 39 | 'Linux') 40 | OS='Linux' 41 | alias ls='ls --color=auto' 42 | curl -fsSL https://raw.githubusercontent.com/ahundt/homebrew-robotics/master/linuxbrew.sh | bash /dev/stdin 43 | export PKG_CONFIG_PATH="/usr/bin/pkg-config:$HOME/.linuxbrew/bin/pkg-config" 44 | export PKG_CONFIG_LIBDIR="/usr/lib/pkgconfig:$HOME/.linuxbrew/lib/pkgconfig" 45 | export PATH="$PATH:$HOME/.linuxbrew/bin" 46 | ;; 47 | 'FreeBSD') 48 | OS='FreeBSD' 49 | alias ls='ls -G' 50 | ;; 51 | 'WindowsNT') 52 | OS='Windows' 53 | ;; 54 | 'Darwin') 55 | OS='Mac' 56 | /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" 57 | ;; 58 | 'SunOS') 59 | OS='Solaris' 60 | ;; 61 | 'AIX') ;; 62 | *) ;; 63 | esac 64 | else 65 | brew update 66 | fi 67 | 68 | 69 | cd $HOME 70 | 71 | OSPARAM="" 72 | if [ -d $HOME/.linuxbrew ] ; then 73 | # This param lets robonetracker build with the native linux dependencies 74 | # For details see: https://github.com/Homebrew/linuxbrew/issues/13 75 | OSPARAM="--env=inherit" 76 | fi 77 | 78 | # lots of scientific libraries and developer tools 79 | brew tap homebrew/science 80 | #brew install cmake --with-docs $OSPARAM 81 | brew install cmake $OSPARAM 82 | brew install doxygen flatbuffers $OSPARAM 83 | brew install boost $OSPARAM 84 | 85 | 86 | 87 | # Mac & Linux TODO: 88 | # This needs to be fit into the OSTYPE case statement, or a new way to do this 89 | # with multiple lines needs to be worked out. 90 | # https://stackoverflow.com/questions/394230/detect-the-os-from-a-bash-script 91 | 92 | # Mac OSX TODO: 93 | 94 | # Enable --with cuda if you have an nvidia graphics card and cuda 7.0 or greater installed 95 | # install caskroom application manager 96 | # brew casks are only supported on mac, not linux 97 | 98 | # http://docs.nvidia.com/cuda/index.html 99 | #brew cask install cuda 100 | #brew cask install vrep 101 | brew install opencv 102 | #brew install opencv3 --with-contrib --c++11 --without-python3 --without-python $OSPARAM -v # --with-cuda 103 | #brew link opencv3 --force 104 | 105 | # from https://github.com/ahundt/homebrew-robotics 106 | # robotics related libraries 107 | brew tap ahundt/robotics 108 | brew install cmake-basis $OSPARAM 109 | brew install tbb protobuf suite-sparse gflags glog openblas ceres-solver $OSPARAM 110 | -------------------------------------------------------------------------------- /hub.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | echo "###############" 7 | echo "# hub - GitHub Command Line Util" 8 | echo "###############" 9 | echo "" 10 | echo "tool that makes life with github better" 11 | echo "see comments of this file for additional setup steps" 12 | echo "" 13 | echo "hub.github.com" 14 | echo "github.com/github/hub" 15 | echo "" 16 | echo "NOTE: requires golang (google go programming language)! installing that first" 17 | 18 | ./golang.sh 19 | 20 | # export GOROOT=/usr/bin/go 21 | export GOPATH=$HOME/go 22 | #export PATH=$PATH:$GOROOT/bin:$GOPATH/bin 23 | export PATH=$PATH:$GOPATH/bin 24 | 25 | go get github.com/github/hub 26 | 27 | # instructions for setting up shell completions: 28 | # https://github.com/github/hub/tree/master/etc 29 | mkdir -p ~/.zsh/completions 30 | curl https://raw.githubusercontent.com/github/hub/master/etc/hub.zsh_completion --output ~/.zsh/completions/_hub -------------------------------------------------------------------------------- /ide.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "##############" 4 | echo "# IDE Setup #" 5 | echo "##############" 6 | echo "" 7 | echo "Installs developer tools such as visual studio code" 8 | echo "" 9 | echo "https://help.ubuntu.com/community/Repositories/Ubuntu" 10 | echo "" 11 | echo "@author Andrew Hundt " 12 | echo "" 13 | 14 | 15 | # source: https://gist.github.com/phatblat/1713458 16 | # Save script's current directory 17 | DIR=$(pwd) 18 | 19 | set -e 20 | set -u 21 | set -x 22 | 23 | 24 | echo "###############" 25 | echo "# Ubuntu make" 26 | echo "###############" 27 | echo "" 28 | echo "# https://wiki.ubuntu.com/ubuntu-make" 29 | echo "" 30 | 31 | sudo add-apt-repository -y ppa:ubuntu-desktop/ubuntu-make 32 | sudo apt-get update 33 | sudo apt-get install -y ubuntu-make 34 | 35 | 36 | echo "####################" 37 | echo "# Visual Studio Code" 38 | echo "####################" 39 | echo "" 40 | echo "# code.visualtudio.com" 41 | echo "# Installs to ~/.local/share/umake/ide/visual-studio-code" 42 | echo "" 43 | 44 | umake ide visual-studio-code 45 | 46 | 47 | cd $DIR 48 | -------------------------------------------------------------------------------- /kalibr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # source: https://gist.github.com/phatblat/1713458 3 | # Save script's current directory 4 | DIR=$(pwd) 5 | 6 | set -e 7 | set -u 8 | set -x 9 | 10 | echo "############################" 11 | echo "# kalibr ROS library" 12 | echo "############################" 13 | echo "# calibration library" 14 | echo "" 15 | echo "# https://github.com/ethz-asl/kalibr" 16 | echo "" 17 | echo "Manual steps: installing libopencv-dev ros-*-vision-opencv " 18 | echo "where * is either indigo or kinetic" 19 | 20 | # location="ethz-asl" 21 | location="ahundt" 22 | # location="clearpath" 23 | 24 | #branch="master" 25 | branch="robone" 26 | 27 | 28 | # ROS must be installed first, assuming it is in default /opt/ros location 29 | if [ ! -d /opt/ros ]; then 30 | ./ros.sh 31 | fi 32 | 33 | cd ~/src 34 | 35 | 36 | . /etc/lsb-release # get ubuntu version number 37 | 38 | 39 | if [ "$DISTRIB_RELEASE" = "16.04" ]; then 40 | ROSVERSION="kinetic" 41 | # TODO(ahundt) How to install fcl? should "soem" be installed? 42 | # TODO(ahundt) Are there univeral robot ros-industrial kinetic binaries? 43 | sudo apt-get install -y ros-kinetic-moveit # ros-kinetic-universal-robot ros-kinetic-ur-msgs # ros-indigo-fcl 44 | 45 | source /opt/ros/kinetic/setup.bash 46 | fi 47 | 48 | 49 | if [ "$DISTRIB_RELEASE" = "14.04" ]; then 50 | ROSVERSION="indigo" 51 | sudo apt-get install -y ros-indigo-moveit-full ros-indigo-fcl ros-indigo-soem 52 | 53 | source /opt/ros/indigo/setup.bash 54 | fi 55 | 56 | if [ -e "/opt/ros/${ROSVERSION}/setup.bash"]; then 57 | source /opt/ros/${ROSVERSION}/setup.bash 58 | fi 59 | 60 | sudo apt-get install -y python-setuptools python-rosinstall ipython libeigen3-dev libboost-all-dev doxygen ros-${ROSVERSION}-image-transport-plugins ros-${ROSVERSION}-cmake-modules python-software-properties software-properties-common libpoco-dev python-matplotlib python-scipy python-git python-pip ipython libtbb-dev libblas-dev liblapack-dev python-catkin-tools libv4l-dev 61 | # opencv can be a bit tricky, maybe do that on your own 62 | # sudo apt-get install -y libopencv-dev ros-${ROSVERSION}-vision-opencv 63 | 64 | sudo pip install python-igraph --upgrade 65 | 66 | cd $HOME/src 67 | mkdir -p kalibr_ws/src 68 | cd kalibr_ws 69 | catkin init 70 | cd src 71 | 72 | if [ ! -d ~/src/kalibr_ws/src/kalibr ]; then 73 | git clone https://github.com/${location}/kalibr.git 74 | fi 75 | 76 | cd kalibr 77 | git pull 78 | git checkout $branch 79 | cd .. 80 | 81 | catkin build 82 | 83 | cd $DIR -------------------------------------------------------------------------------- /keras.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# Keras - keras.io" 12 | echo "############################" 13 | echo "" 14 | echo "Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano or TensorFlow." 15 | echo "" 16 | echo "MANUAL STEPS REQUIRED - FIRST FOLLOW tensorflow.sh instructions" 17 | 18 | 19 | # install https://github.com/fchollet/keras 20 | cd ~/src/ 21 | if [ ! -d ~/src/keras ] 22 | then 23 | git clone https://github.com/fchollet/keras.git 24 | fi 25 | 26 | cd keras 27 | git pull 28 | sudo python setup.py install 29 | # python setup.py install --user 30 | 31 | cd ~/src/ 32 | if [ ! -d ~/src/keras-contrib ] 33 | then 34 | git clone https://github.com/farizrahman4u/keras-contrib.git 35 | fi 36 | 37 | cd keras-contrib 38 | git pull 39 | sudo python setup.py install 40 | # python setup.py install --user 41 | 42 | cd $DIR 43 | -------------------------------------------------------------------------------- /linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is intended to setup a fresh desktop with ROS and 4 | # with dependencies on homebrew or linuxbrew depending on the OS being used 5 | # @author Andrew Hundt 6 | 7 | echo "" 8 | echo "###############################################################################################" 9 | echo "# Initial setup of basic linux utilities needed for software development #" 10 | echo "###############################################################################################" 11 | echo "" 12 | # partly based on https://github.com/ahundt/homebrew-robotics/blob/master/robonetracker.sh 13 | 14 | # source: https://gist.github.com/phatblat/1713458 15 | # Save script's current directory 16 | DIR=$(pwd) 17 | 18 | # /bin/bash 19 | set -e 20 | set -u 21 | set -x 22 | 23 | 24 | sudo apt-get -y update 25 | # minimal linuxbrew requirements 26 | sudo apt-get install -y build-essential curl git python-setuptools ruby 27 | 28 | # additional useful tools that should probably be owned by the OS rather than linuxbrew 29 | sudo apt-get install -y screen tree sudo ssh x11-apps synaptic build-essential git 30 | 31 | sudo apt-get install -y linux-headers-$(uname -r) 32 | 33 | cd ~ 34 | 35 | if [ ! -d `pwd`/src ] ; then 36 | mkdir src; 37 | fi 38 | 39 | cd src 40 | 41 | 42 | # USB wireless adapter driver 43 | # TP-Link Archer T4U dual band 802.11 ac 44 | # http://askubuntu.com/questions/533408/trying-to-install-wireless-archer-t4u-driver 45 | wireless_pkg=false 46 | 47 | if [ $wireless_pkg ] ; then 48 | 49 | # package based USB wireless adapter install instructions 50 | sudo apt-get install rtl8812au-dkms 51 | 52 | else 53 | # compile wireless driver from source 54 | if [ ! -d `pwd`/rtl8812AU_8821AU_linux ] ; then 55 | git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git 56 | fi 57 | 58 | cd rtl8812AU_8821AU_linux/ 59 | git pull 60 | make 61 | sudo make install 62 | sudo modprobe 8812au 63 | fi 64 | 65 | 66 | 67 | 68 | cd $DIR 69 | -------------------------------------------------------------------------------- /linuxbrew.sh: -------------------------------------------------------------------------------- 1 | # check if it is a raspberry pi, because we'll need a special ruby first 2 | if [ -x "$(command -v python)" ] ; then 3 | R_PI=`python -c "import platform; print 'raspberrypi' in platform.uname()"` 4 | 5 | if [ "$R_PI" = "True" ] ; then 6 | # run ruby upgrade script. source: https://gist.github.com/blacktm/8302741 7 | yes | bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh) 8 | # use alternative linuxbrew installation 9 | if [ ! -d ~/.linuxbrew ] ; then 10 | git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew 11 | fi 12 | # we are done with raspberry pi setup, exit 13 | exit 0 14 | fi 15 | fi 16 | # install linuxbrew http://linuxbrew.sh 17 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)" -------------------------------------------------------------------------------- /locomotion_robotics.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# RobotLocomotion from MIT https://github.com/RobotLocomotion/" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# http://drake.mit.edu/" 15 | echo "#" 16 | echo "# Drake - https://github.com/RobotLocomotion/drake" 17 | echo "# A planning, control, and analysis toolbox for nonlinear dynamical systems." 18 | echo "#" 19 | echo "# Director - https://github.com/RobotLocomotion/director/" 20 | echo "# A robotics interface and visualization framework," 21 | echo "# with extensive applications for working with Drake" 22 | echo "#" 23 | echo "# Spartan - https://github.com/RobotLocomotion/spartan/" 24 | echo "# A project repo for robotics research and applications using drake and director. " 25 | echo "#" 26 | echo "# drake-iiwa-driver - https://github.com/RobotLocomotion/drake-iiwa-driver" 27 | echo "# Application code used to communicate with the KUKA iiwa arm from Drake." 28 | echo "# " 29 | 30 | 31 | # os specific setup 32 | OS=`uname` 33 | case $OS in 34 | 'Linux') 35 | OS='Linux' 36 | ./bazel.sh 37 | # ./pip.sh 38 | sudo apt-get install build-essential cmake libglib2.0-dev libqt4-dev \ 39 | libx11-dev libxext-dev libxt-dev python-dev 40 | # left out of apt-get in favor of pip 41 | # python-numpy python-lxml python-scipy python-yaml 42 | pip2 install --user --upgrade numpy lxml scipy pyyaml 43 | 44 | ;; 45 | *) ;; 46 | 'Darwin') 47 | OS='Mac' 48 | brew tap patmarion/director # && brew tap-pin patmarion/director 49 | brew install cmake bazel glib libyaml numpy python scipy vtk7 50 | pip2 install --user --upgrade lxml PyYAML 51 | ;; 52 | esac 53 | 54 | mkdir -p ~/src/RobotLocomotion 55 | cd ~/src/RobotLocomotion 56 | 57 | # https://github.com/RobotLocomotion/drake 58 | if [ ! -d ~/src/RobotLocomotion/drake-distro ] ; then 59 | git clone git@github.com:RobotLocomotion/drake.git drake-distro 60 | fi 61 | 62 | cd drake-distro 63 | git pull 64 | 65 | if [ "${OS}" = "Mac"] ; then 66 | ./setup/mac/install_prereqs.sh 67 | fi 68 | 69 | if [ "${OS}" = "Linux" ] ; then 70 | sudo ./setup/ubuntu/16.04/install_prereqs.sh 71 | fi 72 | 73 | bazel build //... 74 | 75 | 76 | # https://github.com/RobotLocomotion/director 77 | cd ~/src/RobotLocomotion 78 | if [ ! -d ~/src/RobotLocomotion/director ] ; then 79 | # TODO(ahundt) Consider usin gtheir ros catkin build 80 | git clone git@github.com:RobotLocomotion/director.git 81 | fi 82 | 83 | echo "director build step disabled until https://github.com/RobotLocomotion/director/issues/576 is resolved" 84 | cd director 85 | git pull 86 | # mkdir -p build 87 | # cd build 88 | # cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/ 89 | # make -j && sudo make install 90 | 91 | 92 | 93 | # https://github.com/RobotLocomotion/drake-iiwa-driver 94 | cd ~/src/RobotLocomotion 95 | if [ ! -d ~/src/RobotLocomotion/drake-iiwa-driver ] ; then 96 | git clone git@github.com:RobotLocomotion/drake-iiwa-driver.git 97 | fi 98 | 99 | cd drake-iiwa-driver 100 | git pull 101 | if [ -f ~/src/RobotLocomotion/drake-iiwa-driver/README.md ] ; then 102 | # TODO: disabled until cmake issues are resolved 103 | echo "drake-iiwa-driver build step disabled until https://github.com/RobotLocomotion/director/issues/576 is resolved" 104 | # bazel build //... 105 | else 106 | echo "MANUAL STEPS are required to install and run on the kuka iiwa robot, see https://github.com/RobotLocomotion/drake-iiwa-driver" 107 | fi 108 | 109 | 110 | 111 | # https://github.com/RobotLocomotion/spartan 112 | cd ~/src/RobotLocomotion 113 | if [ ! -d ~/src/RobotLocomotion/spartan ] ; then 114 | git clone git@github.com:RobotLocomotion/spartan.git 115 | fi 116 | 117 | cd spartan 118 | git pull 119 | 120 | if [ "${OS}" = "Mac"] ; then 121 | # not yet available 122 | echo "spartan install script not available yet for macOS, do this manually!" 123 | # ./setup/mac/install_prereqs.sh 124 | fi 125 | 126 | if [ "${OS}" = "Linux" ] ; then 127 | sudo ./setup/ubuntu/16.04/install_prereqs.sh 128 | 129 | echo "MANNUAL STEPS REQUIRED: SEE https://github.com/RobotLocomotion/spartan" 130 | fi 131 | 132 | cd $DIR 133 | -------------------------------------------------------------------------------- /marcc-config.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | echo "###############################################" 5 | echo "# MARCC Module loading (a SLURM cluster)" 6 | echo "###############################################" 7 | echo "# Config Provided by:" 8 | echo "# github.com/ahundt/robotics_setup" 9 | echo "# also see marcc-install.sh" 10 | echo "#" 11 | echo "# About MARCC:" 12 | echo "# https://www.marcc.jhu.edu/" 13 | echo "#" 14 | echo "# About the SLURM workload manager for clusters:" 15 | echo "# https://slurm.schedmd.com/" 16 | echo "#" 17 | echo "# MARCC tutorials:" 18 | echo "# http://www.marcc.jhu.edu/training/intro-sessions/" 19 | echo "# Click on Introduction to MARCC and Basic Linux for pdf files" 20 | echo "#" 21 | echo "# Create your own modules:" 22 | echo "# https://www.marcc.jhu.edu/getting-started/local-python-packages/" 23 | echo "#" 24 | echo "# JHU MARCC help email address:" 25 | echo "# marcc-help@marcc.jhu.edu" 26 | echo "#" 27 | echo "# to see list of possible modules run:" 28 | echo "# module avail" 29 | echo "#" 30 | echo "# Run on a GPU:" 31 | echo "# https://github.com/rdipietro/miccai-2016-surgical-activity-rec/tree/master/scripts" 32 | echo "#" 33 | echo "# How to create a xonsh python shell http://xon.sh" 34 | echo "# to import tensorflow starting in bash or zsh:" 35 | echo "#" 36 | echo "# ± /cm/shared/apps/python/3.6.6/bin/pip3 install xonsh --user --upgrade" 37 | echo "# ± export PYTHONPATH=\"$HOME/.local/lib/python3.6/site-packages/:/cm/shared/apps/tensorflow/cuda-8.0/r1.0/lib/python3.6/site-packages/:$PYTHONPATH\"" 38 | echo "# ± xonsh" 39 | echo "# $ import sys" 40 | echo "# $ sys.path.insert(0,'$HOME/.local/lib/python3.6/site-packages/')" 41 | echo "# $ sys.path.insert(0,'/cm/shared/apps/tensorflow/cuda-8.0/r1.0/lib/python3.6/site-packages/')" 42 | echo "# $ import tensorflow as tf" 43 | echo "#" 44 | echo "# LOADING MODULES:" 45 | echo "#" 46 | echo "# module load zsh/5.3.1 gcc/4.9.2 slurm sed git tmux byobu cmake/3.8.2 autoconf/gcc automake/gcc boost cuda/8.0 cudnn/5.1 python/3.6.6 parallel_studio_xe_2015 intel-mpi readline ruby/2.4.1 ffmpeg tensorflow/cuda-8.0/r1.0" 47 | echo "#" 48 | 49 | module load zsh/5.3.1 gcc/4.9.2 slurm sed git tmux byobu cmake/3.8.2 autoconf/gcc automake/gcc boost cuda/8.0 cudnn/5.1 python/3.6.6 parallel_studio_xe_2015 intel-mpi readline ruby/2.4.1 ffmpeg tensorflow/cuda-8.0/r1.0 50 | # see marcc-install.sh for the list of saved modules 51 | # module restore robotics_setup_modules 52 | 53 | # other modules worth knowing about that are currently disabled: 54 | # python/2.7.12 55 | -------------------------------------------------------------------------------- /marcc-install.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "########################################################################" 11 | echo "# MARCC, a SLURM cluster, github.com/ahundt/robotics_setup installation" 12 | echo "########################################################################" 13 | echo "# MANUAL STEPS REQUIRED! visit github.com/ahundt/robotics_setup for extra details" 14 | echo "# add this to your .bashrc:" 15 | echo "# source .robotics_setup" 16 | echo "#" 17 | echo "# Install Provided by:" 18 | echo "# github.com/ahundt/robotics_setup" 19 | echo "# also see marcc-config.sh" 20 | echo "#" 21 | echo "# About MARCC:" 22 | echo "# https://www.marcc.jhu.edu/" 23 | echo "#" 24 | echo "# About the SLURM workload manager for clusters:" 25 | echo "# https://slurm.schedmd.com/" 26 | echo "#" 27 | echo "# MARCC tutorials:" 28 | echo "# http://www.marcc.jhu.edu/training/intro-sessions/" 29 | echo "# Click on `Introduction to MARCC` and `Basic Linux` for pdfs" 30 | echo "#" 31 | echo "# Create your own modules:" 32 | echo "# https://www.marcc.jhu.edu/getting-started/local-python-packages/" 33 | echo "#" 34 | echo "# to see list of possible modules run:" 35 | echo "# module avail" 36 | 37 | 38 | echo "###############################################" 39 | echo "# SLURM Cluster Manager Tensorflow Setup" 40 | echo "###############################################" 41 | echo "# Reference materials:" 42 | echo "# http://killianlevacher.github.io/blog/posts/post-2016-07-22/post.html" 43 | echo "# https://github.com/taylorpaul/ShowAndTell-SLURM" 44 | echo "# http://stackoverflow.com/questions/34826736/running-tensorflow-on-a-slurm-cluster" 45 | echo "# https://github.com/jakeret/tf_unet" 46 | echo "# https://github.com/Ottunger/tensorslurm" 47 | echo "# http://slurm.ttic.edu/" 48 | echo "# " 49 | echo "# Example install script:" 50 | echo "# https://gist.github.com/taylorpaul/3e4e405ffad1be8355bf742fa24b41f0" 51 | echo "# " 52 | echo "# Install script companion repository:" 53 | echo "# https://github.com/taylorpaul/ShowAndTell-SLURM" 54 | echo "# " 55 | echo "# TensorBoard:" 56 | echo "# https://gist.github.com/taylorpaul/250ee3ed2524e8c28ee7c58ed656a5b9" 57 | echo "# " 58 | echo "# Nice SLURM python class:" 59 | echo "# https://github.com/jhollowayj/tensorflow_slurm_manager" 60 | 61 | # MARCC WITH ZSH: put this in your .bashrc 62 | # module load zsh 63 | # #source ~/.robotics_setup 64 | # export SHELL=`which zsh` 65 | # [ -z "$ZSH_VERSION" ] && exec "$SHELL" -l 66 | 67 | ################################## 68 | # Command Line Environment Config 69 | ################################## 70 | 71 | source $DIR/marcc-config.sh 72 | 73 | # save the set of modules to enable reloading in the future 74 | module save robotics_setup_modules 75 | 76 | # for local source code, libraries, and binaries 77 | mkdir -p $HOME/src 78 | mkdir -p $HOME/bin 79 | mkdir -p $HOME/lib 80 | # for python user installs 81 | mkdir -p $HOME/.local 82 | 83 | mkdir -p $HOME/.keras 84 | 85 | 86 | cd ~/src/ 87 | if [ ! -d ~/src/robotics_setup ]; then 88 | git clone --recursive https://github.com/ahundt/robotics_setup.git 89 | fi 90 | 91 | cd robotics_setup 92 | 93 | # ./autoenv.sh 94 | # ./textmate.sh 95 | 96 | # datasets folders 97 | 98 | mkdir -p $HOME/work/datasets 99 | 100 | if [ ! -d $HOME/datasets ]; then 101 | ln -s $HOME/work/datasets $HOME/datasets 102 | fi 103 | 104 | if [ ! -d $HOME/.keras/datasets ]; then 105 | ln -s $HOME/work/datasets $HOME/.keras/datasets 106 | fi 107 | 108 | # models folders 109 | 110 | mkdir -p $HOME/work/models 111 | 112 | if [ ! -d $HOME/.keras/models ]; then 113 | ln -s $HOME/work/models $HOME/.keras/models 114 | fi 115 | 116 | if [ ! -d $HOME/models ]; then 117 | ln -s $HOME/work/models $HOME/models 118 | fi 119 | 120 | # if [ ! -f $HOME/src/.env ]; then 121 | # ln -s .autoenv $HOME/src/.env 122 | # fi 123 | 124 | ./zsh.sh 125 | # byobu now loaded as a module 126 | #./byobu-source.sh 127 | 128 | # byobu terminal session manager: http://byobu.co/about.html 129 | #https://launchpad.net/byobu/trunk/5.115/+download/byobu_5.115.orig.tar.gz 130 | 131 | ################################## 132 | # Python and tensorflow utilities 133 | ################################## 134 | 135 | ./py_tools.sh 136 | ./tensorflow_slurm_manager.sh 137 | ./tensorpack.sh 138 | ./tensorlayer.sh 139 | ./sacred.sh 140 | ./tf-image-segmentation.sh 141 | ./keras.sh 142 | 143 | 144 | 145 | cd $DIR -------------------------------------------------------------------------------- /meshlab.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# MeshLab -http://www.meshlab.net/" 12 | echo "############################" 13 | echo "" 14 | echo "The open source mesh processing system" 15 | echo "" 16 | echo "https://github.com/cnr-isti-vclab/meshlab" 17 | 18 | 19 | # os specific setup 20 | OS=`uname` 21 | case $OS in 22 | 'Linux') 23 | 24 | sudo add-apt-repository ppa:zarquon42/meshlab 25 | sudo apt-get update 26 | sudo apt-get install meshlab 27 | OS='Linux' 28 | ;; 29 | *) ;; 30 | 'Darwin') 31 | OS='Mac' 32 | brew install meshlab 33 | ;; 34 | esac 35 | 36 | 37 | cd $DIR -------------------------------------------------------------------------------- /mongodb.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# MongoDB persistent docker image" 12 | echo "############################" 13 | echo "#" 14 | echo "# https://github.com/bitnami/bitnami-docker-mongodb" 15 | 16 | 17 | username=mluser 18 | password=SET_PASSWORD_BEFORE_RUNNING_THIS 19 | 20 | 21 | https://github.com/bitnami/bitnami-docker-mongodb 22 | mkdir -p $HOME/datasets/ml_models_sacred_mongodb/persistence 23 | 24 | docker run --name mongodb \ 25 | -v $HOME/datasets/ml_models_sacred_mongodb/persistence:/bitnami \ 26 | -e MONGODB_USERNAME=$username -e MONGODB_PASSWORD=$password \ 27 | -e MONGODB_DATABASE=sacred bitnami/mongodb:latest 28 | 29 | # Manual steps: 30 | # echo "# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/" 31 | # echo "# https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04" 32 | # echo "# https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-mongodb-on-ubuntu-16-04" 33 | 34 | # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 35 | 36 | # . /etc/lsb-release # get ubuntu version number 37 | 38 | # if [ "$DISTRIB_RELEASE" = "16.04" ]; then 39 | # echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list 40 | # fi 41 | 42 | # sudo apt-get update 43 | # sudo apt-get install -y mongodb-org -------------------------------------------------------------------------------- /mujoco.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# Mujoco - https://www.roboti.us/" 12 | echo "############################" 13 | echo "" 14 | echo "MuJoCo stands for Multi-Joint dynamics with Contact." 15 | echo "It is a physics engine aiming to facilitate research and" 16 | echo "development in robotics, biomechanics, graphics and animation," 17 | echo "and other areas where fast and accurate simulation is needed." 18 | echo "" 19 | echo "MANUAL STEPS REQUIRED - NEED MUJOCO LICENSE IN ~/Downloads/mjkey.txt" 20 | 21 | 22 | cd ~/src/ 23 | 24 | # if [ ! -d ~/src/mujoco ] 25 | # then 26 | # fi 27 | mkdir -p mujoco 28 | cd ~/src/mujoco 29 | curl -O https://www.roboti.us/download/mjpro140_linux.zip 30 | unzip -a mjpro140_linux.zip 31 | 32 | curl -O https://www.roboti.us/download/mjpro131_linux.zip 33 | unzip -a mjpro131_linux.zip 34 | 35 | cd ~/src/mujoco 36 | cp ~/Downloads/mjkey.txt ~/src/mujoco/mjpro131 37 | 38 | cd $DIR 39 | -------------------------------------------------------------------------------- /nn_grasp.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# Neural Network Grasp https://github.com/KyleAshley/nn_grasp" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# Neural network based robotic grasping in Tensorflow. " 15 | echo "# Similar to https://arxiv.org/pdf/1412.3128.pdf" 16 | 17 | cd ~/src 18 | if [ ! -d ~/src/nn_grasp ] ; then 19 | git clone https://github.com/KyleAshley/nn_grasp.git 20 | fi 21 | 22 | cd ~/src/nn_grasp 23 | git pull 24 | 25 | ./pcl-python.sh 26 | pip2 install imutils --user --upgrade 27 | 28 | cd $DIR -------------------------------------------------------------------------------- /nodejs.sh: -------------------------------------------------------------------------------- 1 | 2 | # Node js 3 | # https://www.rosehosting.com/blog/install-npm-on-ubuntu-16-04/ 4 | curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - 5 | sudo apt-get install -y nodejs 6 | 7 | # http://blog.webbb.be/command-not-found-node-npm/ 8 | npm config set prefix /usr/local 9 | # h265 video conversion scripts 10 | # https://github.com/FallingSnow/h265ize 11 | sudo npm install h265ize -------------------------------------------------------------------------------- /nvidia-docker.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# nvidia-docker https://github.com/NVIDIA/nvidia-docker" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# Note: this installs version 1.0 until https://github.com/NVIDIA/nvidia-docker/issues/11 is resolved. " 15 | 16 | 17 | # Add the package repositories 18 | curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ 19 | sudo apt-key add - 20 | curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \ 21 | sudo tee /etc/apt/sources.list.d/nvidia-docker.list 22 | sudo apt-get update 23 | 24 | # Install nvidia-docker and reload the Docker daemon configuration 25 | sudo apt-get install -y nvidia-docker 26 | sudo pkill -SIGHUP dockerd 27 | 28 | # Test nvidia-smi with the latest official CUDA image 29 | docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi 30 | 31 | cd $DIR -------------------------------------------------------------------------------- /nvidia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # source: https://gist.github.com/phatblat/1713458 4 | # Save script's current directory 5 | DIR=$(pwd) 6 | 7 | # /bin/bash 8 | set -e 9 | set -u 10 | set -x 11 | 12 | echo "################################" 13 | echo "# NVIDIA DRIVERS: Manual Setup #" 14 | echo "################################" 15 | echo "" 16 | echo "# also see: cuda.sh and cudnn.sh if you will be doing deep learning!" 17 | echo "" 18 | echo "# caffe install instructions" 19 | echo "# https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide" 20 | echo "" 21 | echo "# deep learning setup with GTX 1080" 22 | echo "# http://yangcha.github.io/GTX-1080/" 23 | echo "" 24 | echo "# explanation" 25 | echo "# https://linuxconfig.org/how-to-install-the-latest-nvidia-drivers-on-ubuntu-16-04-xenial-xerus" 26 | echo "" 27 | echo "# find your driver" 28 | echo "# http://www.nvidia.com/Download/index.aspx" 29 | echo "" 30 | echo "# latest nvidia driver versions" 31 | echo "# http://www.nvidia.com/object/unix.html" 32 | echo "" 33 | echo "# ubuntu's instructions" 34 | echo "# https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia" 35 | 36 | 37 | 38 | ################ 39 | # NVIDIA DRIVERS 40 | ################ 41 | 42 | # explanation 43 | # https://linuxconfig.org/how-to-install-the-latest-nvidia-drivers-on-ubuntu-16-04-xenial-xerus 44 | 45 | # find your driver 46 | # http://www.nvidia.com/Download/index.aspx 47 | 48 | sudo add-apt-repository -y ppa:graphics-drivers/ppa 49 | sudo apt-get -y update 50 | sudo apt-get install -y nvidia-384 mesa-common-dev freeglut3-dev 51 | 52 | sudo apt-get -y update 53 | sudo apt-get -y upgrade 54 | 55 | sh cuda.sh 56 | 57 | # stop the window manager 58 | # you probably want to run this in ctrl + alt + f1 mode 59 | # sudo service lightdm stop 60 | 61 | # install nvidia drivers with dkms manager enabled 62 | # sudo sh ./NVIDIA-Linux-x86_64-367.35.run --dkms 63 | 64 | 65 | # alternative older instructions 66 | #sudo add-apt-repository -y ppa:graphics-drivers/ppa 67 | #sudo apt-get -y update 68 | #sudo apt-get install -y nvidia-367 mesa-common-dev freeglut3-dev 69 | 70 | 71 | cd $DIR 72 | -------------------------------------------------------------------------------- /openai.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# OpenAI gym, universe, and universe-starter-agent" 12 | echo "############################" 13 | echo "" 14 | echo "OpenAI https://github.com/openai." 15 | 16 | sudo apt-get update 17 | pip install numpy 18 | sudo apt-get install -y golang libjpeg-turbo8-dev make 19 | sudo apt-get install -y python-numpy python-dev python3-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig 20 | 21 | cd ~/src 22 | mkdir -p openai 23 | 24 | # install https://github.com/openai/gym 25 | cd ~/src/openai 26 | if [ ! -d ~/src/openai/gym ] 27 | then 28 | git clone https://github.com/openai/gym.git 29 | fi 30 | 31 | cd gym 32 | git pull 33 | pip install -e '.[all]' 34 | 35 | # install https://github.com/openai/universe 36 | cd ~/src/openai 37 | if [ ! -d ~/src/openai/universe ] 38 | then 39 | git clone https://github.com/openai/universe.git 40 | fi 41 | 42 | cd universe 43 | git pull 44 | pip install -e . 45 | 46 | 47 | # install https://github.com/openai/universe-starter-agent.git 48 | cd ~/src/openai 49 | if [ ! -d ~/src/openai/universe-starter-agent ] 50 | then 51 | git clone https://github.com/openai/universe-starter-agent.git 52 | fi 53 | 54 | cd universe-starter-agent 55 | git pull 56 | 57 | cd $DIR 58 | -------------------------------------------------------------------------------- /opencv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # source: https://gist.github.com/phatblat/1713458 3 | # Save script's current directory 4 | DIR=$(pwd) 5 | 6 | set -e 7 | set -u 8 | set -x 9 | 10 | echo "################################" 11 | echo "# OpenCV 2 or 3 from ppa/source" 12 | echo "################################" 13 | echo "#" 14 | echo "# Install opencv from an ubuntu ppa by default," 15 | echo "# otherwise install from source" 16 | echo "#" 17 | echo "# github.com/opencv/opencv" 18 | echo "# github.com/opencv/opencv_contrib" 19 | echo "#" 20 | echo "# WARNING: IF ROS OR OTHER OPENCV BINARIES, or BINARIES THAT DEPEND ON ARE ALREADY INSTALLED" 21 | echo "# THERE MAY BE INVISIBLE CONFLICTS AND CRASHES IN THE SOFTWARE YOU RUN. IF YOU INSTALL OPENCV FROM" 22 | echo "# SOURCE ALL PACKAGES THAT USE OPENCV SHOULD ALSO BE COMPILED FROM SOURCE TO AVOID DIFFICULT TO" 23 | echo "# DIAGNOSE CRASHES!!!" 24 | echo "#" 25 | echo "# TO CHECK WITH ROS KINETIC RUN:" 26 | echo "# dpkg -L ros-kinetic-opencv3" 27 | echo "#" 28 | echo "# To check if the ubuntu ppa libopencv-nonfree-dev installed by this script is present run:" 29 | echo "#" 30 | echo "# dpkg -L libopencv-nonfree-dev" 31 | echo "# dpkg -L libopencv-dev" 32 | 33 | # TODO(ahundt) finish 2.x & 3.x compilation script! 34 | #branch="3.2.0" # install opencv 3.x from source 35 | # branch="2.4.13.2" # install opencv 2.x from source 36 | branch="ppa" # install from nonsecure ppa (default) 37 | 38 | sudo apt-get install -y build-essential 39 | sudo apt-get install -y cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev 40 | sudo apt-get install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev 41 | 42 | 43 | 44 | 45 | OS=`uname` 46 | case $OS in 47 | 'Linux') 48 | OS='Linux' 49 | . /etc/lsb-release # get ubuntu version number 50 | 51 | # only install 52 | if [ "$DISTRIB_RELEASE" = "14.04" ]; then 53 | # TODO(ahundt) add ROS indigo specific opencv3 install 54 | # http://wiki.ros.org/opencv3 55 | # https://github.com/ros-gbp/opencv3-release 56 | if [ -f "/opt/ros/indigo/setup.zsh" ]; then 57 | sudo apt-get install python-bloom 58 | fi 59 | 60 | 61 | fi 62 | ;; 63 | 'FreeBSD') 64 | OS='FreeBSD' 65 | alias ls='ls -G' 66 | ;; 67 | 'WindowsNT') 68 | OS='Windows' 69 | ;; 70 | 'Darwin') 71 | OS='Mac' 72 | ;; 73 | 'SunOS') 74 | OS='Solaris' 75 | ;; 76 | 'AIX') ;; 77 | *) ;; 78 | esac 79 | 80 | 81 | if [ "$branch" = "ppa" ]; then 82 | 83 | sudo add-apt-repository --yes ppa:xqms/opencv-nonfree 84 | sudo apt-get update 85 | sudo apt-get install libopencv-nonfree-dev 86 | else 87 | # TODO(ahundt) finish writing compilation from source and test 88 | # compile from source 89 | cd ~/src 90 | 91 | if [ ! -d ~/src/opencv ] 92 | then 93 | git clone https://github.com/Itseez/opencv.git 94 | fi 95 | 96 | cd opencv 97 | git pull 98 | git checkout ${branch} 99 | 100 | 101 | if [ $branch = "2.4.13.2"]; then 102 | # more params at: https://github.com/opencv/opencv/blob/2.4.13.2/CMakeLists.txt 103 | # more params at: https://github.com/Homebrew/homebrew-science/blob/master/opencv.rb 104 | CMAKE_PARAMS="-DWITH_CUDA=ON -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCUDA_GENERATION=Kepler -DOPENCV_ENABLE_NONFREE=ON" 105 | fi 106 | 107 | # install OpenCV Contrib repository with nonfree components 108 | if [ $branch = "3.2.0"]; then 109 | # Opencv3 compilation with opencv_contrib 110 | # TODO(ahundt) not complete! 111 | cd ~/src/ 112 | if [ ! -d ~/src/opencv_contrib ] 113 | then 114 | git clone https://github.com/Itseez/opencv_contrib.git 115 | fi 116 | 117 | cd opencv_contrib 118 | git pull 119 | git checkout ${branch} 120 | 121 | # TODO(ahundt) set cmake params appropriately for opencv 3 122 | # more params at: https://github.com/Homebrew/homebrew-science/blob/master/opencv3.rb 123 | CMAKE_PARAMS="-DWITH_CUDA=ON -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCUDA_GENERATION=Kepler -DOPENCV_ENABLE_NONFREE=ON" 124 | fi 125 | 126 | cd ~/src/opencv 127 | git pull 128 | 129 | mkdir -p build 130 | cd build 131 | cmake .. ${CMAKE_PARAMS} 132 | make -j && sudo make install 133 | fi # end build from source 134 | 135 | cd $DIR -------------------------------------------------------------------------------- /openimages.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | 5 | # source: https://gist.github.com/phatblat/1713458 6 | # Save script's current directory 7 | DIR=$(pwd) 8 | 9 | # /bin/bash 10 | set -e 11 | set -u 12 | set -x 13 | 14 | 15 | 16 | echo "#################################" 17 | echo "# Google OpenImages Dataset Repo" 18 | echo "#################################" 19 | echo " https://github.com/openimages/dataset.git" 20 | 21 | 22 | mkdir -p ~/datasets 23 | cd ~/datasets 24 | 25 | 26 | cd ~/src/ 27 | if [ ! -d ~/src/openimages ] 28 | then 29 | git clone https://github.com/openimages/dataset.git openimages 30 | fi 31 | 32 | cd openimages 33 | git pull 34 | 35 | cd $DIR 36 | -------------------------------------------------------------------------------- /pangolin.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "############################" 10 | echo "# pangolin https://github.com/stevenlovegrove/pangolin" 11 | echo "############################" 12 | echo "" 13 | echo "Pangolin is a lightweight portable rapid development library for managing " 14 | echo "OpenGL display / interaction and abstracting video input." 15 | echo "" 16 | 17 | 18 | OS=`uname` 19 | case $OS in 20 | 'Linux') 21 | OS='Linux' 22 | . /etc/lsb-release # get ubuntu version number 23 | 24 | # only install 25 | if [ "$DISTRIB_RELEASE" = "14.04" ]; then 26 | # https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media 27 | # https://www.ffmpeg.org/download.html#get-sources 28 | sudo add-apt-repository ppa:mc3man/trusty-media -y 29 | sudo apt-get update -y 30 | fi 31 | 32 | sudo apt-get install -y libglew-dev 33 | sudo apt-get install -y ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev 34 | sudo apt-get install -y libdc1394-22-dev libraw1394-dev 35 | sudo apt-get install -y libjpeg-dev libpng12-dev libtiff5-dev libopenexr-dev 36 | ;; 37 | 'FreeBSD') 38 | OS='FreeBSD' 39 | alias ls='ls -G' 40 | ;; 41 | 'WindowsNT') 42 | OS='Windows' 43 | ;; 44 | 'Darwin') 45 | OS='Mac' 46 | brew install ffmpeg jpeg tiff png glew 47 | ;; 48 | 'SunOS') 49 | OS='Solaris' 50 | ;; 51 | 'AIX') ;; 52 | *) ;; 53 | esac 54 | 55 | # install https://github.com/stevenlovegrove/pangolin 56 | cd ~/src/ 57 | if [ ! -d ~/src/Pangolin ] 58 | then 59 | git clone git@github.com:stevenlovegrove/Pangolin.git 60 | fi 61 | sudo chmod -R u+rwx ~/src/Pangolin 62 | sudo chmod -R g+rwx ~/src/Pangolin 63 | cd Pangolin 64 | git pull 65 | mkdir -p build 66 | cd build 67 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local 68 | cmake --build . 69 | sudo cmake --build . --target install 70 | 71 | cd $DIR 72 | -------------------------------------------------------------------------------- /pcl-python.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# python-pcl https://github.com/strawlab/python-pcl/" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# Point Cloud Library Python API. " 15 | echo "# " 16 | echo "# WARNING: assumes pcl is already installed" 17 | 18 | 19 | cd ~/src 20 | if [ ! -d ~/src/python-pcl ] ; then 21 | git clone https://github.com/strawlab/python-pcl.git 22 | fi 23 | 24 | cd ~/src/python-pcl 25 | git pull 26 | 27 | python2 setup.py build_ext -i --user 28 | python2 setup.py install --user 29 | 30 | # sh build.sh 31 | # pip2 install --upgrade --user pip cython numpy 32 | # python2 -m pip install . build_ext -i --upgrade --user 33 | # python2 -m pip install . --upgrade --user 34 | 35 | cd ~/src 36 | 37 | cd $DIR -------------------------------------------------------------------------------- /pip.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | echo "################################" 5 | echo "# pip python package manager" 6 | echo "################################" 7 | echo "#" 8 | echo "# Install pip from source" 9 | echo '#' 10 | echo '# If you run into a "permissions" problem here try the following:' 11 | echo '# sudo chown -R $USER ~/.local/' 12 | echo '# sudo chmod g+wr -R ~/.local/' 13 | echo '# sudo chown -R $USER ~/.cache/' 14 | echo '# sudo chmod g+wr -R ~/.cache/' 15 | 16 | # https://github.com/pypa/pip/issues/5373 17 | # ### Another problem you might encounter 18 | # `sudo pip install --upgrade pip` using `9.0.1-3`. 19 | 20 | # ```shell 21 | # $ pip3 -V 22 | # Traceback (most recent call last): 23 | # File "/usr/bin/pip3", line 7, in 24 | # from pip._internal import main 25 | # ModuleNotFoundError: No module named 'pip._internal' 26 | # ``` 27 | 28 | # ### What (other) I've run: 29 | # ``` 30 | # curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 31 | # python3 get-pip.py --force-reinstall 32 | 33 | # # Back to 9.0.1-3 34 | # pacman -Sy --force python-pip 35 | # pip uninstall pip 36 | # python3 get-pip.py 37 | # ``` 38 | 39 | mkdir -p $HOME/Downloads 40 | mkdir -p $HOME/.local 41 | 42 | export PYTHONUSERBASE=$HOME/.local 43 | 44 | # workaround for pip 8.1.2 failing to upgrade on Ubuntu 16.04 45 | # see https://github.com/pypa/pip/issues/3776 46 | 47 | curl -o $HOME/Downloads/get-pip.py https://bootstrap.pypa.io/get-pip.py 48 | if ! [ -x "$(command -v pip2)" ] ; then 49 | python2 $HOME/Downloads/get-pip.py --user 50 | fi 51 | 52 | if ! [ -x "$(command -v pip3)" ] ; then 53 | python3 $HOME/Downloads/get-pip.py --user 54 | fi 55 | -------------------------------------------------------------------------------- /plotJuggler.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # source: https://github.com/facontidavide/PlotJuggler 4 | # Save script's current directory 5 | DIR=$(pwd) 6 | 7 | set -e 8 | set -u 9 | set -x 10 | 11 | echo "################################################" 12 | echo "# Time Series Visualization Tool--PlotJuggler #" 13 | echo "################################################" 14 | echo "" 15 | echo "https://facontidavide.github.io/PlotJuggler/" 16 | echo "" 17 | echo "TO RUN PlotJuggler after installation:" 18 | echo "" 19 | echo "./PlotJuggler" 20 | echo "" 21 | echo "@author Andrew Hundt " 22 | echo "" 23 | 24 | 25 | if [ ! -d ~/src ] 26 | then 27 | mkdir -p ~/src 28 | fi 29 | 30 | sudo apt-get -y install qtbase5-dev libqt5svg5-dev 31 | 32 | 33 | if [ ! -f ~/src/PlotJuggler ] 34 | then 35 | cd ~/src 36 | git clone https://github.com/facontidavide/PlotJuggler.git 37 | cd PlotJuggler 38 | git pull 39 | fi 40 | 41 | 42 | 43 | if [ ! -f ~/src/PlotJuggler/build ] 44 | then 45 | cd ~/src/PlotJuggler 46 | mkdir build 47 | fi 48 | 49 | cd ~/src/PlotJuggler/build 50 | cmake .. 51 | make 52 | sudo make install 53 | 54 | cd $DIR 55 | -------------------------------------------------------------------------------- /py_tools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # source: https://gist.github.com/phatblat/1713458 5 | # Save script's current directory 6 | DIR=$(pwd) 7 | 8 | # /bin/bash 9 | set -e 10 | set -u 11 | set -x 12 | 13 | 14 | pip install jupyter --user --upgrade 15 | pip install pillow --user --upgrade 16 | pip install sklearn --user --upgrade 17 | 18 | cd $DIR 19 | -------------------------------------------------------------------------------- /python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # source: https://gist.github.com/phatblat/1713458 5 | # Save script's current directory 6 | DIR=$(pwd) 7 | 8 | # /bin/bash 9 | set -e 10 | set -u 11 | set -x 12 | 13 | 14 | OS=`uname` 15 | case $OS in 16 | 'Linux') 17 | OS='Linux' 18 | . /etc/lsb-release # get ubuntu version number 19 | # only install 20 | if [ "${DISTRIB_ID}" = "Ubuntu" ]; then 21 | # install ubuntu python package 22 | sudo apt-get install -y python-setuptools python-dev python3-dev build-essential 23 | 24 | ./pip.sh 25 | # workaround for pip 8.1.2 failing to upgrade on Ubuntu 16.04 26 | # see https://github.com/pypa/pip/issues/3776 27 | # curl -o $HOME/Downloads/get-pip.py https://bootstrap.pypa.io/get-pip.py 28 | # sudo python3 $HOME/Downloads/get-pip.py --user 29 | 30 | # commented below until workaround is no longer needed 31 | # python 2 32 | # TODO(ahundt) this may be interfering with python3's pip3? 33 | #sudo easy_install pip 34 | #pip install --upgrade virtualenv 35 | 36 | # python 3 37 | # pip3 install --upgrade virtualenv 38 | fi 39 | ;; 40 | 'FreeBSD') 41 | OS='FreeBSD' 42 | alias ls='ls -G' 43 | ;; 44 | 'WindowsNT') 45 | OS='Windows' 46 | ;; 47 | 'Darwin') 48 | OS='Mac' 49 | brew install python python3 50 | ;; 51 | 'SunOS') 52 | OS='Solaris' 53 | ;; 54 | 'AIX') ;; 55 | *) ;; 56 | esac 57 | 58 | 59 | cd $DIR 60 | -------------------------------------------------------------------------------- /pytorch.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "############################" 10 | echo "# PyTorch - http://pytorch.org/" 11 | echo "############################" 12 | 13 | # os specific setup 14 | OS=`uname` 15 | case $OS in 16 | 'Linux') 17 | 18 | if [ -x "$(command -v pip3)" ] ; then 19 | pip3 install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp35-cp35m-manylinux1_x86_64.whl --upgrade --user 20 | pip3 install torchvision --upgrade --user 21 | fi 22 | # if the below does not work try this command 23 | # pip2 install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl --upgrade --user 24 | # if the above command does not work, then you have python 2.7 UCS2, use this command 25 | pip2 install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27m-manylinux1_x86_64.whl --upgrade --user 26 | pip install torchvision --upgrade --user 27 | OS='Linux' 28 | ;; 29 | *) ;; 30 | 'Darwin') 31 | OS='Mac' 32 | pip install http://download.pytorch.org/whl/torch-0.2.0.post3-cp27-none-macosx_10_7_x86_64.whl 33 | pip install torchvision 34 | pip3 install http://download.pytorch.org/whl/torch-0.2.0.post3-cp35-cp35m-macosx_10_7_x86_64.whl 35 | pip3 install torchvision 36 | 37 | ;; 38 | esac 39 | -------------------------------------------------------------------------------- /qdirstat.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | echo "####################" 4 | echo "# Qdirstat disk utilization visualization" 5 | echo "####################" 6 | echo "" 7 | echo "# https://github.com/shundhammer/qdirstat" 8 | echo "" 9 | 10 | 11 | OS=`uname` 12 | case $OS in 13 | 'Linux') 14 | OS='Linux' 15 | sudo add-apt-repository ppa:nathan-renniewaldock/qdirstat 16 | sudo apt-get update 17 | sudo apt-get install -y qdirstat 18 | ;; 19 | 'FreeBSD') 20 | OS='FreeBSD' 21 | alias ls='ls -G' 22 | ;; 23 | 'WindowsNT') 24 | OS='Windows' 25 | ;; 26 | 'Darwin') 27 | OS='Mac' 28 | brew install qdirstat 29 | ;; 30 | 'SunOS') 31 | OS='Solaris' 32 | ;; 33 | 'AIX') ;; 34 | *) ;; 35 | esac -------------------------------------------------------------------------------- /qt5.sh: -------------------------------------------------------------------------------- 1 | 2 | # Qt Libraries http://qt.io 3 | 4 | cd ~/Downloads 5 | wget http://download.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-linux-x64-5.8.0.run 6 | chmod +x qt-opensource-linux-x64-5.8.0.run 7 | ./qt-opensource-linux-x64-5.8.0.run 8 | 9 | 10 | # Old version of Qt 11 | # sudo apt-get install build-essential 12 | # sudo apt-get install qtcreator 13 | # sudo apt-get install qt5-default 14 | # sudo apt-get install qt5-doc 15 | # sudo apt-get install qt5-doc-html qtbase5-doc-html 16 | # sudo apt-get install qtbase5-examples -------------------------------------------------------------------------------- /reinforcement_learning.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# ImageFlow https://github.com/HamedMP/ImageFlow" 12 | echo "############################" 13 | echo "" 14 | echo "Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano or TensorFlow." 15 | echo "" 16 | echo "MANUAL STEPS REQUIRED - FIRST FOLLOW tensorflow.sh instructions" 17 | 18 | 19 | # install https://github.com/HamedMP/ImageFlow 20 | cd ~/src/ 21 | if [ ! -d ~/src/ImageFlow ] 22 | then 23 | git clone https://github.com/HamedMP/ImageFlow.git 24 | fi 25 | 26 | cd ImageFlow 27 | git pull 28 | # sudo python setup.py install 29 | python setup.py install --user 30 | 31 | 32 | 33 | echo "############################" 34 | echo "# Arcade Learning Environment arcadelearningenvironment.org" 35 | echo "############################" 36 | echo "" 37 | echo "The Arcade Learning Environment (ALE) -- a platform for AI research.." 38 | echo "" 39 | 40 | sudo apt-get install -y libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev cmake 41 | 42 | 43 | # install https://github.com/mgbellemare/Arcade-Learning-Environment 44 | cd ~/src/ 45 | if [ ! -d ~/src/Arcade-Learning-Environment ] 46 | then 47 | git clone https://github.com/mgbellemare/Arcade-Learning-Environment.git 48 | fi 49 | 50 | cd Arcade-Learning-Environment 51 | mkdir -p build && cd build 52 | cmake -DUSE_SDL=ON -DUSE_RLGLUE=OFF -DBUILD_EXAMPLES=ON .. 53 | make -j 22 install 54 | cd .. 55 | pip install --user 56 | 57 | 58 | 59 | 60 | echo "############################" 61 | echo "# Tensorpack https://github.com/ppwwyyxx/tensorpack" 62 | echo "############################" 63 | echo "To enable python code to support import tensorpack:" 64 | echo "export PYTHONPATH=$PYTHONPATH:`readlink -f path/to/tensorpack`" 65 | 66 | 67 | # install https://github.com/ppwwyyxx/tensorpack 68 | cd ~/src/ 69 | if [ ! -d ~/src/tensorpack ] 70 | then 71 | git clone https://github.com/ppwwyyxx/tensorpack.git 72 | fi 73 | 74 | cd tensorpack 75 | git pull 76 | pip install --user -r requirements.txt 77 | # optional requirements 78 | pip install --user -r requirements-opt.txt 79 | 80 | 81 | 82 | 83 | echo "############################" 84 | echo "# keras-rl https://github.com/matthiasplappert/keras-rl" 85 | echo "############################" 86 | echo "" 87 | echo "" 88 | 89 | 90 | # install https://github.com/ppwwyyxx/tensorpack 91 | cd ~/src/ 92 | if [ ! -d ~/src/keras-rl ] 93 | then 94 | git clone https://github.com/matthiasplappert/keras-rl.git 95 | fi 96 | 97 | cd keras-rl 98 | git pull 99 | # sudo python setup.py install 100 | python setup.py install --user 101 | 102 | 103 | 104 | echo "############################" 105 | echo "# tflearn" 106 | echo "############################" 107 | echo "" 108 | echo "" 109 | 110 | 111 | # install https://github.com/tflearn/tflearn 112 | cd ~/src/ 113 | if [ ! -d ~/src/tflearn ] 114 | then 115 | git clone https://github.com/tflearn/tflearn.git 116 | fi 117 | 118 | cd tflearn 119 | git pull 120 | sudo python setup.py install 121 | 122 | 123 | 124 | 125 | 126 | 127 | echo "############################" 128 | echo "# https://github.com/Itsukara/async_deep_reinforce" 129 | echo "############################" 130 | echo "" 131 | echo "" 132 | 133 | 134 | # install https://github.com/Itsukara/async_deep_reinforce 135 | cd ~/src/ 136 | if [ ! -d ~/src/async_deep_reinforce ] 137 | then 138 | git clone https://github.com/Itsukara/async_deep_reinforce.git 139 | fi 140 | 141 | cd async_deep_reinforce 142 | git pull 143 | 144 | 145 | 146 | 147 | 148 | echo "############################" 149 | echo "# https://github.com/yuyu2172/async-rl" 150 | echo "############################" 151 | echo "" 152 | echo "fork of https://github.com/muupan/async-rl" 153 | 154 | 155 | # install https://github.com/muupan/async-rl.git 156 | cd ~/src/ 157 | if [ ! -d ~/src/async-rl ] 158 | then 159 | git clone https://github.com/yuyu2172/async-rl.git 160 | fi 161 | 162 | cd async-rl 163 | git pull 164 | sudo python setup.py install 165 | 166 | 167 | 168 | 169 | echo "############################" 170 | echo "# https://github.com/Zeta36/Asynchronous-Methods-for-Deep-Reinforcement-Learning" 171 | echo "############################" 172 | echo "" 173 | echo "" 174 | 175 | 176 | # install https://github.com/Zeta36/Asynchronous-Methods-for-Deep-Reinforcement-Learning 177 | cd ~/src/ 178 | if [ ! -d ~/src/zeta36_a3c ] 179 | then 180 | git clone https://github.com/Zeta36/Asynchronous-Methods-for-Deep-Reinforcement-Learning.git zeta36_a3c 181 | fi 182 | 183 | cd zeta36_a3c 184 | git pull 185 | pip install pygame 186 | 187 | 188 | 189 | 190 | 191 | echo "############################" 192 | echo "# policy sketches" 193 | echo "############################" 194 | echo "" 195 | echo "https://github.com/jacobandreas/psketch" 196 | 197 | 198 | # install https://github.com/jacobandreas/psketch.git 199 | cd ~/src/ 200 | if [ ! -d ~/src/psketch ] 201 | then 202 | git clone https://github.com/jacobandreas/psketch.git 203 | fi 204 | 205 | cd psketch 206 | git pull 207 | 208 | 209 | 210 | 211 | 212 | 213 | cd $DIR 214 | -------------------------------------------------------------------------------- /remote_utils.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | set -x 3 | 4 | DIR=`pwd` 5 | # Show images and download files in iTerm2 from remote machine 6 | # https://www.iterm2.com/documentation-images.html 7 | mkdir -p ~/bin 8 | cd ~/bin 9 | 10 | curl -O https://raw.github.com/gnachman/iTerm2/master/tests/imgls 11 | curl -O https://raw.github.com/gnachman/iTerm2/master/tests/imgcat 12 | curl -O https://raw.github.com/gnachman/iTerm2/master/tests/download.sh 13 | 14 | cd $DIR 15 | -------------------------------------------------------------------------------- /robot_grasp_detection.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# robot-grasp-detection https://github.com/tnikolla/robot-grasp-detection" 12 | echo "###############################################" 13 | echo "#" 14 | echo "# Detecting robot grasping positions with deep neural networks. " 15 | echo "# The model is trained on Cornell Grasping Dataset. " 16 | 17 | 18 | cd ~/src 19 | if [ ! -d ~/src/robot-grasp-detection ] ; then 20 | git clone https://github.com/tnikolla/robot-grasp-detection 21 | fi 22 | 23 | cd ~/src/robot-grasp-detection 24 | git pull 25 | 26 | 27 | pip2 install shapely --user --upgrade 28 | # mkdir -p ~/src/flatbuffers/build 29 | # cd ~/src/flatbuffers/build 30 | # cmake .. 31 | # sudo make -j install 32 | # cd ~/src 33 | 34 | cd $DIR -------------------------------------------------------------------------------- /robotics_tasks.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "###############################################" 11 | echo "# Robotics Tasks Library https://github.com/jrl-umi3218/tasks" 12 | echo "###############################################" 13 | echo "# Tasks is library for real time control of robots and kinematic" 14 | echo "# trees using constrained optimization. It has been used extensively" 15 | echo "# to control humanoid robots such as HOAP-3, HRP-2, HRP-4 and Atlas." 16 | echo "#" 17 | echo "# Make sure eigen3 is installed before running this script" 18 | echo "#" 19 | echo "# Usage with python bindings (default):" 20 | echo "# sh robotics_tasks.sh" 21 | echo "#" 22 | echo "# Usage without python bindings:" 23 | echo "# sh robotics_tasks.sh -p OFF" 24 | echo "#" 25 | echo "# Options:" 26 | echo "#" 27 | echo "# -p Enable/disable python bindings, options are ON, OFF" 28 | echo "# -b git branch to check out, such as master" 29 | echo "# -l git location to use, -b jrl-umi3218 means github.com/jrl-umi3218/Tasks," 30 | echo "# while ahundt means github.com/ahundt/Tasks" 31 | 32 | 33 | 34 | # Enable python bindings via cython by default 35 | # set to "ON" to build python bindings and "OFF" to disable them 36 | # Note: "ON" generates tons of warnings and the log size might prevent CI from succeeding. 37 | PYTHON_BINDING="OFF" 38 | # location="jrl-umi3218" # github.com/jrl-umi3218/Tasks # ongoing development happens here 39 | location="ahundt" # github.com/ahundt/Tasks # I have some patches here 40 | #location="jorisv" # github.com/jorisv/Tasks # outdated original repository location 41 | 42 | # modify if using a different branch 43 | # branch="master" 44 | branch="grl" 45 | # grl branch is named for github.com/ahundt/grl, which is integrated with Tasks. 46 | 47 | # Check if the user specified any command line options 48 | # other than teh default and set the variable appropriately. 49 | while getopts p:l:b: option 50 | do 51 | case "${option}" 52 | in 53 | p) PYTHON_BINDING="${OPTARG}";; 54 | l) location="${OPTARG}";; 55 | b) branch="${OPTARG}";; 56 | esac 57 | done 58 | 59 | 60 | # os specific setup 61 | OS=`uname` 62 | case $OS in 63 | 'Linux') 64 | 65 | if [ "${PYTHON_BINDING}" = "ON" ] 66 | then 67 | sh python.sh 68 | fi 69 | sudo apt-get update 70 | sudo apt-get install -y libtool pkg-config build-essential autoconf automake cmake cmake-curses-gui pkg-config gfortran 71 | sudo apt-get install -y libboost-all-dev libeigen3-dev doxygen 72 | # last dependency is for mc_rbdyn_urdf urdf robot definition format reading only 73 | sudo apt-get install -y libtinyxml2-dev 74 | ;; 75 | *) ;; 76 | 'Darwin') 77 | OS='Mac' 78 | brew install tinyxml2 79 | ;; 80 | esac 81 | 82 | mkdir -p ~/src 83 | cd ~/src 84 | 85 | 86 | # Clone the super-repository from 87 | # https://github.com/ahundt/jrl-umi3218 88 | # This version is more stable and reliable. 89 | if [ "${location}" = "ahundt" ] 90 | then 91 | if [ ! -d ~/src/jrl-umi3218 ] 92 | then 93 | git clone --recursive https://github.com/${location}/jrl-umi3218.git 94 | fi 95 | 96 | cd ~/src/jrl-umi3218 97 | git checkout ${branch} 98 | fi 99 | 100 | mkdir -p ~/src/jrl-umi3218 101 | cd ~/src 102 | 103 | # install https://github.com/jrl-umi3218/Eigen3ToPython 104 | # note: still putting it in jrl-umi3218 for consistency 105 | cd ~/src/jrl-umi3218 106 | if [ ! -d ~/src/jrl-umi3218/Eigen3ToPython ] 107 | then 108 | git clone --recursive https://github.com/${location}/Eigen3ToPython.git 109 | fi 110 | 111 | if [ "${PYTHON_BINDING}" = "ON" ] 112 | then 113 | cd Eigen3ToPython 114 | git pull 115 | git checkout ${branch} 116 | # Requirements.txt includes: 117 | # cython>=0.25 118 | # coverage>=4.0 119 | # nose 120 | # numpy 121 | # TODO(ahundt) consider if user install is appropriate on all platforms 122 | 123 | # only install via pip if it exists 124 | if [ -x "$(command -v pip)" ] ; then 125 | pip install -r requirements.txt --upgrade --user 126 | pip install . --upgrade --user 127 | fi 128 | 129 | # only install via pip2 if it exists 130 | if [ -x "$(command -v pip2)" ] ; then 131 | pip2 install -r requirements.txt --upgrade --user 132 | pip2 install . --upgrade --user 133 | fi 134 | 135 | # only install via pip3 if it exists 136 | # if [ -x "$(command -v pip3)" ] ; then 137 | # pip3 install -r requirements.txt --upgrade --user 138 | # pip3 install . --upgrade --user 139 | # fi 140 | fi 141 | 142 | 143 | 144 | # install https://github.com/jrl-umi3218/SpaceVecAlg 145 | cd ~/src/jrl-umi3218 146 | if [ ! -d ~/src/jrl-umi3218/SpaceVecAlg ] 147 | then 148 | git clone --recursive https://github.com/${location}/SpaceVecAlg.git 149 | fi 150 | 151 | cd SpaceVecAlg 152 | git pull 153 | git checkout ${branch} 154 | mkdir -p build 155 | cd build 156 | cmake .. -DPYTHON_BINDING=${PYTHON_BINDING} -DCMAKE_INSTALL_PREFIX=/usr/local/ 157 | make -j && sudo make install 158 | 159 | 160 | 161 | 162 | # install https://github.com/jrl-umi3218/RBDyn 163 | cd ~/src/jrl-umi3218 164 | if [ ! -d ~/src/jrl-umi3218/RBDyn ] 165 | then 166 | git clone --recursive https://github.com/${location}/RBDyn.git 167 | fi 168 | 169 | cd RBDyn 170 | git pull 171 | git checkout ${branch} 172 | mkdir -p build 173 | cd build 174 | cmake .. -DPYTHON_BINDING=${PYTHON_BINDING} -DCMAKE_INSTALL_PREFIX=/usr/local/ 175 | make -j && sudo make install 176 | 177 | 178 | 179 | 180 | 181 | # install https://github.com/jrl-umi3218/sch-core 182 | cd ~/src/jrl-umi3218 183 | if [ ! -d ~/src/jrl-umi3218/sch-core ] 184 | then 185 | git clone --recursive https://github.com/${location}/sch-core.git 186 | fi 187 | 188 | cd sch-core 189 | git pull 190 | git checkout ${branch} 191 | mkdir -p build 192 | cd build 193 | # no python bindings for this library 194 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/ 195 | make -j && sudo make install 196 | 197 | 198 | 199 | 200 | 201 | # install https://github.com/jrl-umi3218/sch-core-python 202 | cd ~/src/jrl-umi3218 203 | if [ ! -d ~/src/jrl-umi3218/sch-core-python ] 204 | then 205 | git clone --recursive https://github.com/${location}/sch-core-python.git 206 | fi 207 | 208 | if [ "${PYTHON_BINDING}" = "ON" ] 209 | then 210 | cd sch-core-python 211 | git pull 212 | git checkout ${branch} 213 | 214 | # only install via pip2 if it exists 215 | if [ -x "$(command -v pip)" ] ; then 216 | pip install . --upgrade --user 217 | fi 218 | 219 | # only install via pip2 if it exists 220 | if [ -x "$(command -v pip2)" ] ; then 221 | pip2 install . --upgrade --user 222 | fi 223 | 224 | # TODO(ahundt) uncomment when https://github.com/jrl-umi3218/jrl-cmakemodules/pull/124 is merged and all libraries are updated with a proper python + lib find script. 225 | # # only install via pip3 if it exists 226 | # if [ -x "$(command -v pip3)" ] ; then 227 | # pip3 install . --upgrade --user 228 | # fi 229 | fi 230 | 231 | 232 | 233 | 234 | # install https://github.com/jrl-umi3218/eigen-qld 235 | cd ~/src/jrl-umi3218 236 | if [ ! -d ~/src/jrl-umi3218/eigen-qld ] 237 | then 238 | git clone --recursive https://github.com/${location}/eigen-qld.git 239 | fi 240 | 241 | cd eigen-qld 242 | git pull 243 | git checkout ${branch} 244 | mkdir -p build 245 | cd build 246 | cmake .. -DPYTHON_BINDING=${PYTHON_BINDING} -DCMAKE_INSTALL_PREFIX=/usr/local/ 247 | make -j && sudo make install 248 | 249 | 250 | 251 | 252 | # install https://github.com/jrl-umi3218/Tasks 253 | cd ~/src/jrl-umi3218 254 | if [ ! -d ~/src/jrl-umi3218/Tasks ] 255 | then 256 | git clone --recursive https://github.com/${location}/Tasks.git 257 | fi 258 | 259 | cd Tasks 260 | git pull 261 | git checkout ${branch} 262 | mkdir -p build 263 | cd build 264 | cmake .. -DPYTHON_BINDING=${PYTHON_BINDING} -DCMAKE_INSTALL_PREFIX=/usr/local/ 265 | make -j && sudo make install 266 | 267 | 268 | 269 | 270 | # install https://github.com/jrl-umi3218/mc_rbdyn_urdf 271 | cd ~/src/jrl-umi3218 272 | if [ ! -d ~/src/jrl-umi3218/mc_rbdyn_urdf ] 273 | then 274 | git clone --recursive https://github.com/${location}/mc_rbdyn_urdf.git 275 | fi 276 | 277 | cd mc_rbdyn_urdf 278 | git pull 279 | git checkout ${branch} 280 | mkdir -p build 281 | cd build 282 | cmake .. -DPYTHON_BINDING=${PYTHON_BINDING} -DCMAKE_INSTALL_PREFIX=/usr/local/ 283 | make -j && sudo make install 284 | 285 | 286 | cd $DIR 287 | -------------------------------------------------------------------------------- /ros.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # source: https://gist.github.com/phatblat/1713458 5 | # Save script's current directory 6 | DIR=$(pwd) 7 | 8 | # /bin/bash 9 | set -e 10 | set -u 11 | set -x 12 | 13 | ########################## 14 | # ROS Kinetic Kame Setup # 15 | ########################## 16 | # To find available packages, use: 17 | # 18 | # apt-cache search ros-kinetic 19 | # 20 | # On mac see: 21 | # 22 | # https://github.com/mikepurvis/ros-install-osx/ 23 | 24 | . /etc/lsb-release # get ubuntu version number 25 | 26 | # only install 27 | if [ "$DISTRIB_RELEASE" = "16.04" ]; then 28 | # source: http://wiki.ros.org/kinetic/Installation/Ubuntu 29 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 30 | sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116 31 | sudo apt-get update 32 | sudo apt-get install ros-kinetic-desktop-full 33 | sudo apt-get install python-rosinstall 34 | 35 | sudo apt-get install python-catkin-tools libgflags-dev 36 | 37 | # If using bash: 38 | # 39 | # echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc 40 | # source ~/.bashrc 41 | # 42 | # 43 | 44 | # Add ros setup to zshrc if it isn't already present 45 | LINE="source /opt/ros/kinetic/setup.zsh" 46 | FILE=~/.zshrc 47 | grep -q "$LINE" "$FILE" || echo "$LINE" >> "$FILE" 48 | fi 49 | 50 | if [ "$DISTRIB_RELEASE" = "14.04" ]; then 51 | # source: http://wiki.ros.org/kinetic/Installation/Ubuntu 52 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 53 | sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 54 | sudo apt-get update 55 | sudo apt-get install ros-indigo-desktop-full 56 | sudo apt-get install python-rosinstall 57 | if [ ! -d /etc/ros/rosdep/ ] 58 | then 59 | sudo rosdep init 60 | fi 61 | rosdep update 62 | sudo apt-get install python-catkin-tools libgflags-dev 63 | 64 | 65 | # If using bash: 66 | # 67 | # echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc 68 | # source ~/.bashrc 69 | # 70 | # 71 | 72 | # Add ros setup to zshrc if it isn't already present 73 | LINE="source /opt/ros/indigo/setup.zsh" 74 | FILE=~/.zshrc 75 | grep -q "$LINE" "$FILE" || echo "$LINE" >> "$FILE" 76 | fi 77 | 78 | 79 | cd $DIR 80 | 81 | -------------------------------------------------------------------------------- /rtl8812AU_8821AU_linux.sh: -------------------------------------------------------------------------------- 1 | 2 | # source: https://gist.github.com/phatblat/1713458 3 | # Save script's current directory 4 | DIR=$(pwd) 5 | 6 | set -e 7 | set -u 8 | set -x 9 | 10 | echo "############################" 11 | echo "# USB wireless adapter driver " 12 | echo "# TP-Link Archer T4U dual band 802.11 ac" 13 | echo "# http://askubuntu.com/questions/533408/trying-to-install-wireless-archer-t4u-driver" 14 | echo "############################" 15 | 16 | cd ~/src 17 | 18 | if [ ! -d `pwd`/rtl8812AU_8821AU_linux ] ; then 19 | git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git 20 | fi 21 | 22 | cd rtl8812AU_8821AU_linux/ 23 | git pull 24 | make 25 | sudo make install 26 | sudo modprobe 8812au 27 | 28 | cd $DIR 29 | -------------------------------------------------------------------------------- /sacred.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Sacred is a python tool to help you configure, organize, log and reproduce experiments developed at IDSIA. 4 | # https://github.com/IDSIA/sacred 5 | 6 | # tf example 7 | # https://github.com/basveeling/wavenet/blob/master/wavenet.py 8 | 9 | pip install --user --upgrade sacred numpy pymongo sacredboard -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is intended to setup a fresh desktop with ROS and 4 | # with dependencies on homebrew or linuxbrew depending on the OS being used 5 | # @author Andrew Hundt 6 | # 7 | # 8 | # One step setup command for robonetracker: 9 | # bash <(curl -fsSL https://raw.githubusercontent.com/ahundt/homebrew-robotics/master/robonetracker.sh) 10 | 11 | # source: https://gist.github.com/phatblat/1713458 12 | # Save script's current directory 13 | DIR=$(pwd) 14 | 15 | # /bin/bash 16 | set -e 17 | set -u 18 | set -x 19 | 20 | sudo apt-get -y update 21 | # minimal linuxbrew requirements 22 | sudo apt-get install -y build-essential curl git python-setuptools ruby 23 | 24 | # additional useful tools that should probably be owned by the OS rather than linuxbrew 25 | sudo apt-get install -y zsh screen tree sudo ssh x11-apps synaptic build-essential git linux-headers-generic cmake cmake-curses-gui 26 | 27 | cd ~ 28 | 29 | if [ ! -d `pwd`/src ] ; then 30 | mkdir src; 31 | fi 32 | 33 | sh rtl8812AU_8821AU_linux.sh 34 | 35 | 36 | sh nvidia.sh 37 | 38 | 39 | if [ ! -f ~/Downloads/cudnn-8.0-linux-x64-v5.0-ga-tgz ] 40 | then 41 | curl https://developer.nvidia.com/rdp/assets/cudnn-8.0-linux-x64-v5.0-ga-tgz ~/Downloads/cudnn-8.0-linux-x64-v5.0-ga-tgz 42 | fi 43 | 44 | # 45 | # Check if Homebrew is installed 46 | # 47 | if ! [ -x "$(command -v brew)" ] ; then 48 | 49 | OS=`uname` 50 | case $OS in 51 | 'Linux') 52 | OS='Linux' 53 | alias ls='ls --color=auto' 54 | curl -fsSL https://raw.githubusercontent.com/ahundt/homebrew-robotics/master/linuxbrew.sh | bash /dev/stdin 55 | export PATH="$PATH:$HOME/.linuxbrew/bin" 56 | export MANPATH="$MANPATH:$HOME/.linuxbrew/share/man" 57 | export INFOPATH="$INFOPATH:$HOME/.linuxbrew/share/info" 58 | ;; 59 | 'FreeBSD') 60 | OS='FreeBSD' 61 | alias ls='ls -G' 62 | ;; 63 | 'WindowsNT') 64 | OS='Windows' 65 | ;; 66 | 'Darwin') 67 | OS='Mac' 68 | /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" 69 | ;; 70 | 'SunOS') 71 | OS='Solaris' 72 | ;; 73 | 'AIX') ;; 74 | *) ;; 75 | esac 76 | else 77 | brew update 78 | fi 79 | 80 | cd $DIR 81 | -------------------------------------------------------------------------------- /sonnet.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# Sonnet - keras.io" 12 | echo "############################" 13 | echo "" 14 | echo "Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano or TensorFlow." 15 | echo "" 16 | echo "MANUAL STEPS REQUIRED - FIRST FOLLOW tensorflow.sh instructions" 17 | 18 | 19 | # install https://github.com/fchollet/keras 20 | cd ~/src/ 21 | if [ ! -d ~/src/sonnet ] 22 | then 23 | git clone --recursive https://github.com/deepmind/sonnet.git 24 | fi 25 | 26 | cd sonnet 27 | git pull 28 | 29 | cd tensorflow 30 | ./configure 31 | cd ../ 32 | 33 | mkdir /tmp/sonnet 34 | bazel build --config=opt :install 35 | ./bazel-bin/install /tmp/sonnet 36 | 37 | if [! -z `pip show sonnet`] 38 | then 39 | echo "Uninstall sonnet if it was already installed" 40 | sudo pip uninstall -y sonnet 41 | fi 42 | sudo pip install /tmp/sonnet/*.whl 43 | 44 | sudo python setup.py install 45 | # python setup.py install --user 46 | 47 | cd ~/src/ 48 | if [ ! -d ~/src/keras-contrib ] 49 | then 50 | git clone https://github.com/farizrahman4u/keras-contrib.git 51 | fi 52 | 53 | cd keras-contrib 54 | git pull 55 | python setup.py install 56 | # python setup.py install --user 57 | 58 | cd $DIR 59 | -------------------------------------------------------------------------------- /spdlog.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | 5 | # source: https://gist.github.com/phatblat/1713458 6 | # Save script's current directory 7 | DIR=$(pwd) 8 | 9 | # /bin/bash 10 | set -e 11 | set -u 12 | set -x 13 | 14 | 15 | ############### 16 | # spdlog - Super fast C++ logging library. 17 | 18 | cd ~/src 19 | if [ ! -d ~/src/spdlog ] 20 | then 21 | git clone https://github.com/gabime/spdlog.git 22 | cd spdlog 23 | mkdir build 24 | fi 25 | cd ~/src/spdlog 26 | git pull 27 | cd ~/src/spdlog/build 28 | cmake .. -D SPDLOG_BUILD_BENCH=OFF 29 | sudo make -j install 30 | cd ../.. 31 | 32 | cd $DIR -------------------------------------------------------------------------------- /ssh.sh: -------------------------------------------------------------------------------- 1 | ##https://www.maketecheasier.com/setup-enable-ssh-ubuntu/ 2 | 3 | # install the SSH server 4 | sudo apt-get install openssh-server 5 | 6 | # Restore the backup 7 | sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults 8 | 9 | # After the backup has been made, you’ll need to modify its permissions. 10 | sudo chmod a-w /etc/ssh/sshd_config.factory-defaults 11 | 12 | # sudo gedit /etc/ssh/sshd_config 13 | sudo restart ssh 14 | 15 | # Create a new folder for the key 16 | mkdir ~/.ssh 17 | 18 | # Change its permissions 19 | chmod 700 ~/.ssh 20 | 21 | # Finally generate the key 22 | ssh-keygen -t rsa 23 | -------------------------------------------------------------------------------- /tensorflow_models.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "#########################################################" 11 | echo "# TensorFlow models with GPU support and object detection" 12 | echo "#########################################################" 13 | echo "# " 14 | echo "# MANUAL STEPS REQUIRED" 15 | echo "# - first install tensorflow, following any manual steps in tensorflow.sh" 16 | echo "# " 17 | echo "# " 18 | echo "# TF 1.7 special steps with CUDA 9.1!" 19 | echo "# see https://github.com/tensorflow/tensorflow/issues/16526" 20 | echo "# " 21 | echo "#" 22 | echo "#" 23 | 24 | 25 | 26 | # Enable python bindings via cython by default 27 | # set to "ON" to build python bindings and "OFF" to disable them 28 | # Note: "ON" generates tons of warnings and the log size might prevent CI from succeeding. 29 | PIP_INSTALL="OFF" 30 | location="tensorflow" # github.com/jrl-umi3218/Tasks # ongoing development happens here 31 | #location="ahundt" # github.com/ahundt/Tasks # I have some patches here 32 | #location="jorisv" # github.com/jorisv/Tasks # outdated original repository location 33 | 34 | # modify if using a different branch 35 | branch="master" 36 | 37 | # Check if the user specified any command line options 38 | # other than teh default and set the variable appropriately. 39 | while getopts p:l:b: option 40 | do 41 | case "${option}" 42 | in 43 | p) PIP_INSTALL="${OPTARG}";; 44 | l) location="${OPTARG}";; 45 | b) branch="${OPTARG}";; 46 | esac 47 | done 48 | 49 | # install mscoco dataset first 50 | ./coco.sh 51 | 52 | cd ~/src/ 53 | if [ ! -d ~/src/tf_models ] 54 | then 55 | git clone https://github.com/${location}/tf_models 56 | fi 57 | 58 | cd ~/src/tf_models 59 | git fetch --all 60 | git checkout ${branch} 61 | 62 | if [ ! -d ~/src/tf_models/research/pycocotools ] 63 | then 64 | ln -s ~/src/cocoapi/PythonAPI/pycocotools ~/src/tf_models/research/ 65 | fi 66 | 67 | cd ~/src/tf_models/research 68 | # protobuf compilation step 69 | # https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md#protobuf-compilation 70 | protoc object_detection/protos/*.proto --python_out=. 71 | 72 | pip install -e . --user --upgrade 73 | 74 | 75 | # also run automatically in .robotics_setup 76 | # if that is added to your ~/.bashrc or ~/.zshrc 77 | export PYTHONPATH=$PYTHONPATH:$HOME/src/tf_models/research/:$HOME/src/tf_models/research/slim 78 | # test for correct installation 79 | python2 object_detection/builders/model_builder_test.py -------------------------------------------------------------------------------- /tensorflow_slurm_manager.sh: -------------------------------------------------------------------------------- 1 | 2 | DIR=$(pwd) 3 | 4 | set -e 5 | set -u 6 | set -x 7 | 8 | echo "###############################################" 9 | echo "# Tensorflow SLURM manager python class" 10 | echo "###############################################" 11 | echo "# github.com/jhollowayj/tensorflow_slurm_manager" 12 | 13 | cd ~/src/ 14 | if [ ! -d ~/src/tensorflow_slurm_manager ] 15 | then 16 | git clone https://github.com/jhollowayj/tensorflow_slurm_manager.git 17 | fi 18 | 19 | # TODO(ahundt): install or add to path config 20 | 21 | cd $DIR -------------------------------------------------------------------------------- /tensorlayer.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | # https://github.com/zsdonghao/tensorlayer 4 | pip install --user --upgrade tensorlayer -------------------------------------------------------------------------------- /tensorpack.sh: -------------------------------------------------------------------------------- 1 | 2 | # https://github.com/ppwwyyxx/tensorpack 3 | pip install --user --upgrade tensorpack -------------------------------------------------------------------------------- /textmate.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | 10 | echo "############################" 11 | echo "# Textmate rmate setup for remote access" 12 | echo "############################" 13 | echo "" 14 | echo "TextMate: https://github.com/textmate/textmate" 15 | echo "rmate: https://github.com/textmate/rmate" 16 | 17 | # TODO(ahundt) install in user directories? 18 | # http://www.binarytides.com/quick-tip-installing-ruby-gems-in-the-users-home-directory/ 19 | sudo gem install rmate 20 | sudo gem update rmate 21 | 22 | 23 | cd $DIR 24 | -------------------------------------------------------------------------------- /tf-image-segmentation.sh: -------------------------------------------------------------------------------- 1 | 2 | DIR=$(pwd) 3 | 4 | set -e 5 | set -u 6 | set -x 7 | 8 | echo "###############################################" 9 | echo "# Tensorflow image segmentation python library" 10 | echo "###############################################" 11 | echo "# github.com/jhollowayj/tensorflow_slurm_manager" 12 | 13 | branch=ahundt-keras 14 | 15 | cd ~/src/ 16 | if [ ! -d ~/src/tf-image-segmentation ] 17 | then 18 | git clone https://github.com/ahundt/tf-image-segmentation.git -b $branch 19 | fi 20 | 21 | cd tf-image-segmentation 22 | git pull 23 | # TODO(ahundt): install or add to path config 24 | 25 | cd $DIR -------------------------------------------------------------------------------- /torch.sh: -------------------------------------------------------------------------------- 1 | # http://torch.ch/docs/getting-started.html 2 | 3 | # in a terminal, run the commands WITHOUT sudo 4 | if [ ! -f ~/torch ] ; then 5 | git clone https://github.com/torch/distro.git ~/torch --recursive 6 | fi 7 | cd ~/torch; 8 | git pull 9 | bash install-deps; 10 | ./install.sh -------------------------------------------------------------------------------- /trtk.sh: -------------------------------------------------------------------------------- 1 | # source: https://gist.github.com/phatblat/1713458 2 | # Save script's current directory 3 | DIR=$(pwd) 4 | 5 | set -e 6 | set -u 7 | set -x 8 | 9 | echo "###############################################" 10 | echo "# TRTK Transformation and Registration Toolkit" 11 | echo "###############################################" 12 | 13 | echo "https://github.com/RWTHmediTEC/TRTK" 14 | 15 | ./eigen3.sh 16 | cmakeversion=`cmake --version` 17 | if [[ $cmakeversion == *"cmake version 3.5.1"* ]]; then 18 | echo "Detected incompatible cmake version 3.5.1, updating CMake from source, see cmake_source.sh for details" 19 | ./cmake_source.sh 20 | fi 21 | sudo apt-get install -y libflann-dev 22 | 23 | # install https://github.com/jrl-umi3218/SpaceVecAlg 24 | cd ~/src/ 25 | if [ ! -d ~/src/TRTK ] 26 | then 27 | git clone --recursive https://github.com/ahundt/TRTK.git # https://github.com/RWTHmediTEC/TRTK.git 28 | fi 29 | 30 | cd TRTK 31 | git pull 32 | mkdir -p build 33 | cd build 34 | cmake .. 35 | make -j && sudo make install 36 | 37 | 38 | cd $DIR -------------------------------------------------------------------------------- /video.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | # vlc media player 4 | sudo apt-get install vlc -------------------------------------------------------------------------------- /vrep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # source: https://gist.github.com/phatblat/1713458 4 | # Save script's current directory 5 | DIR=$(pwd) 6 | 7 | set -e 8 | set -u 9 | set -x 10 | 11 | echo "############################" 12 | echo "# V-REP Robot Simulator #" 13 | echo "############################" 14 | echo "" 15 | echo "http://www.coppeliarobotics.com/downloads.html" 16 | echo "" 17 | echo "TO RUN V-REP after installation:" 18 | echo "" 19 | echo "cd ~/src/V-REP_PRO_EDU_V3_4_0_Linux" 20 | echo "sh vrep.sh" 21 | echo "" 22 | echo "@author Andrew Hundt " 23 | echo "" 24 | 25 | # VREP_VERSION=V3_4_0 26 | # V-REP_PRO_EDU_V3_4_0_Linux 27 | VREP_FILE="V-REP_PRO_EDU_V3_6_1_Ubuntu18_04" 28 | 29 | . /etc/lsb-release # get ubuntu version number 30 | 31 | if [ "$DISTRIB_RELEASE" = "16.04" ] 32 | then 33 | # http://coppeliarobotics.com/files/V-REP_PRO_EDU_V3_6_1_Ubuntu16_04.tar.xz 34 | VREP_FILE="V-REP_PRO_EDU_V3_6_1_Ubuntu16_04" 35 | fi 36 | 37 | if [ "$DISTRIB_RELEASE" = "18.04" ] 38 | then 39 | # http://coppeliarobotics.com/files/V-REP_PRO_EDU_V3_6_1_Ubuntu16_04.tar.xz 40 | VREP_FILE="V-REP_PRO_EDU_V3_6_1_Ubuntu18_04" 41 | fi 42 | # V-REP_PRO_EDU_V3_4_0_Linux 43 | 44 | mkdir -p ~/src 45 | FILE_PATH=~/src/${VREP_FILE}.tar.xz 46 | 47 | if [ ! -f ${FILE_PATH} ] 48 | then 49 | echo "downloading" 50 | cd ~/src 51 | # wget http://coppeliarobotics.com/files/V-REP_PRO_EDU_V3_4_0_Linux.tar.gz 52 | wget http://coppeliarobotics.com/files/${VREP_FILE}.tar.xz 53 | fi 54 | 55 | if [ ! -d ~/src/${VREP_FILE} ] 56 | then 57 | cd ~/src 58 | tar -xvf $FILE_PATH 59 | # tar -xvzf $FILE_PATH 60 | fi 61 | 62 | 63 | cd $DIR 64 | 65 | -------------------------------------------------------------------------------- /xonsh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is intended to setup a fresh desktop with ROS and 4 | # with dependencies on homebrew or linuxbrew depending on the OS being used 5 | # @author Andrew Hundt 6 | 7 | echo "" 8 | echo "###############################################################################################" 9 | echo "# XONSH python based shell (this file contains setup/config scripts)" 10 | echo "###############################################################################################" 11 | echo "# Bash to Xonsh translation http://xon.sh/bash_to_xsh.html" 12 | echo "# " 13 | echo "# MANUAL STEPS:" 14 | echo "# " 15 | echo "# First make sure you have python3 and pip3 installed!" 16 | echo "# " 17 | echo "# ./python.sh" 18 | 19 | 20 | DIR=$(pwd) 21 | 22 | # /bin/bash 23 | set -e 24 | set -u 25 | set -x 26 | 27 | 28 | # note don't install xonsh with homebrew/linuxbrew 29 | # because it will be in a a virtualenv that can't 30 | # access your other apps. 31 | # https://github.com/xonsh/xonsh/issues/2475 32 | # 33 | # However, you can work around this by using 34 | # the xonsh included xip, which is like pip 35 | # but makes sure to use you xonsh environment. 36 | 37 | 38 | ########################### 39 | # Configuring your system 40 | 41 | # about .xonshrc: 42 | # http://xon.sh/xonshrc.html 43 | # 44 | # Customizing your xonshrc: 45 | # http://xon.sh/customization.html 46 | 47 | # If you want to customize your paths based on the directory 48 | # you are in to automatically be set up for different projects, 49 | # you will want to use events: 50 | # 51 | # http://xon.sh/tutorial_events.html 52 | # 53 | # Specifically on_chdir: http://xon.sh/events.html#on-chdir-olddir-str-newdir-str-none 54 | # 55 | 56 | 57 | ########################### 58 | # Environment Variables 59 | # 60 | # these are the variables you can set to change how things run. 61 | # like how history works, path completion, etc 62 | # 63 | # http://xon.sh/envvars.html 64 | 65 | ########################### 66 | # Extensions 67 | # for details see: 68 | # http://xon.sh/xontribs.html 69 | 70 | 71 | ############################ 72 | # History 73 | # 74 | # http://xon.sh/tutorial_hist.html 75 | 76 | 77 | ########################### 78 | # Python Install 79 | ./python.sh 80 | 81 | ############################ 82 | # Xonsh Install 83 | pip3 install gnureadline pygments prompt_toolkit ply psutil ipykernel matplotlib xonsh xonsh-vox-tabcomplete xontrib-z xontrib-fzf-widgets --upgrade --user 84 | 85 | 86 | 87 | ############################ 88 | # Install 89 | 90 | if [ ! -f $HOME/.xonshrc ] ; then 91 | ln -s $DIR/.xonshrc $HOME/.xonshrc 92 | # sometimes you can't run chsh... 93 | if [ -x "$(command -v ypchsh)" ] ; then 94 | echo "TODO(ahundt) fix chsh... doesn't work on this platform right now... see robotics_setup/README.md" 95 | #ypchsh -s $(which zsh) 96 | else 97 | chsh -s $(which xonsh) 98 | fi 99 | fi 100 | 101 | 102 | ############################ 103 | # xonsh config.json. Disabled because it is no longer supported in Xonsh 0.9.x 104 | # if [ ! -f $HOME/.config/xonsh/config.json ] ; then 105 | # mkdir -p $HOME/.config/xonsh/ 106 | # ln -s $DIR/.config/xonsh/config.json $HOME/.config/xonsh/config.json 107 | # fi 108 | 109 | 110 | ############################ 111 | # .xonshrc 112 | if [ ! -f $HOME/.xonshrc ] ; then 113 | ln -s $DIR/.xonshrc $HOME/.xonshrc 114 | fi -------------------------------------------------------------------------------- /zsh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is intended to setup a fresh desktop with ROS and 4 | # with dependencies on homebrew or linuxbrew depending on the OS being used 5 | # @author Andrew Hundt 6 | 7 | echo "" 8 | echo "###############################################################################################" 9 | echo "# ZSH https://en.wikipedia.org/wiki/Z_shell setup and config" 10 | echo "# using Prezto https://github.com/sorin-ionescu/prezto" 11 | echo "###############################################################################################" 12 | echo "#" 13 | echo "# Installs zsh if necessary, sets it as the default shell," 14 | echo "# and enables a reasonable default configuration using Prezto" 15 | echo "#" 16 | echo "# Prezto — Instantly Awesome Zsh configuration framework" 17 | echo "# https://github.com/sorin-ionescu/prezto" 18 | echo "# Updating zsh's prezto configuration" 19 | echo "# Pull the latest changes and update submodules." 20 | echo "# " 21 | echo "# cd ~/.zprezto && git pull && git submodule update --init --recursive" 22 | echo "# " 23 | echo "# This also enables the use of robotics_setup/.robotics_setup to configure your system" 24 | echo "# to work with the other robotics_setup *.sh package install scripts you run." 25 | echo "" 26 | 27 | # source: https://gist.github.com/phatblat/1713458 28 | # Save script's current directory 29 | DIR=$(pwd) 30 | 31 | # /bin/bash 32 | set -e 33 | set -u 34 | set -x 35 | 36 | cd ~ 37 | 38 | # prezto tools to make zsh life easier 39 | # https://github.com/sorin-ionescu/prezto 40 | 41 | # found via os x setup guide 42 | # http://sourabhbajaj.com/mac-setup/iTerm/zsh.html 43 | 44 | # check if homebrew is installed 45 | # in that case use it to install zsh 46 | # if needed 47 | if [ -x "$(command -v zsh)" ] ; then 48 | # we don't have zsh, try to install it... 49 | if [ -x "$(command -v brew)" ] ; then 50 | # if homebrew/linuxbrew is installed use that to install zsh 51 | brew install zsh zsh-completions 52 | elif [ -x "$(command -v apt-get)" ] ; then 53 | # if apt-get exists use that to install zsh 54 | sudo apt-get install -y zsh 55 | fi 56 | fi 57 | 58 | 59 | if [ ! -f `pwd`/.zshrc ] ; then 60 | cp $DIR/.zshrc ~/.zshrc 61 | # sometimes you can't run chsh... 62 | if [ -x "$(command -v ypchsh)" ] ; then 63 | echo "TODO(ahundt) fix chsh... doesn't work on this platform right now... see robotics_setup/README.md" 64 | #ypchsh -s $(which zsh) 65 | else 66 | chsh -s $(which zsh) 67 | fi 68 | fi 69 | 70 | # create prezto symlinks to configure zsh 71 | if [ ! -f $HOME/.zpreztorc ] ; then 72 | ln -s $DIR/.zpreztorc ~/.zpreztorc 73 | fi 74 | 75 | if [ ! -f $HOME/.zshrc ] ; then 76 | ln -s $DIR/.zshrc ~/.zshrc 77 | fi 78 | 79 | # symlink so robotics_setup config is always up to date 80 | if [ ! -f $HOME/.robotics_setup ] ; then 81 | ln -s $DIR/.robotics_setup $HOME/.robotics_setup 82 | fi 83 | 84 | # only run zsh commands if zsh exists 85 | if [ -x "$(command -v zsh)" ] ; then 86 | 87 | if [ ! -d ~/.zprezto ] ; then 88 | zsh -c "git clone --recursive https://github.com/sorin-ionescu/prezto.git \"${ZDOTDIR:-$HOME}/.zprezto\"" 89 | fi 90 | 91 | # adapted from https://github.com/sorin-ionescu/prezto 92 | # creates symlinks to all prezto files not provided by robotics_setup 93 | # see https://github.com/sorin-ionescu/prezto/tree/master/runcoms for details 94 | cd $DIR 95 | zsh zshpreztolinks.zsh 96 | # zsh -c "setopt EXTENDED_GLOB; 97 | # rcfiles=\"${ZDOTDIR:-$HOME}\"/.zprezto/runcoms/^README.md(.N) 98 | # echo $rcfiles 99 | # for rcfile in rcfiles; do 100 | # if [ ! -f \"$rcfile\" ] ; then 101 | # ln -s \"$rcfile\" \"${ZDOTDIR:-$HOME}/.${rcfile:t}\"; 102 | # fi 103 | # done" 104 | fi 105 | -------------------------------------------------------------------------------- /zshpreztolinks.zsh: -------------------------------------------------------------------------------- 1 | # /bin/zsh 2 | setopt EXTENDED_GLOB; 3 | #rcfiles=\"${ZDOTDIR:-$HOME}\"/.zprezto/runcoms/^README.md(.N) 4 | #echo $rcfiles 5 | for rcfile in \"${ZDOTDIR:-$HOME}\"/.zprezto/runcoms/^README.md(.N); do 6 | if [ ! -f \"$rcfile\" ] ; then 7 | ln -s \"$rcfile\" \"${ZDOTDIR:-$HOME}/.${rcfile:t}\"; 8 | fi 9 | done 10 | --------------------------------------------------------------------------------