Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. # ===== aliases and functions for aml_library using docker (ubuntu 16.04 and ros kinetic) ====================
  2. # ----- alias to lauch aml docker
  3. function amldocker () { $HOME/Projects/aml_ws/src/aml/aml_docker/bash.sh dev:kinetic-cuda; cd $HOME/Projects/aml_ws/; }
  4. function newdockterm (){ $HOME/Projects/aml_ws/src/aml/aml_docker/exec_container.sh $($HOME/Projects/aml_ws/src/aml/aml_docker/get_containerId.sh) || ( if [[ $InDocker == true ]]; then echo -e "\nAlready in docker!\n"; else echo -e "\nNo active amldocker container found!\n"; fi; ) && return 0 ; cd $HOME/Projects/aml_ws/; }
  5. # ----- checks if a command exists
  6. function command_exists {
  7. type "$1" &> /dev/null
  8. }
  9. # ----- checking if in docker
  10. if ! command_exists docker; then
  11. InDocker=true;
  12. fi
  13. # ----- function to set docker environment for aml
  14. if [[ $InDocker == true ]]; then
  15. function dockerenv () {
  16. cd $HOME/Projects/aml_ws/
  17. if [ $# == 0 ] || [ "$1" == "interasim" ]; then $HOME/Projects/aml_ws/intera.sh sim;
  18. elif [ "$1" == "intera" ]; then $HOME/Projects/aml_ws/intera.sh;
  19. elif [ "$1" == "baxtersim" ]; then $HOME/Projects/aml_ws/baxter.sh sim;
  20. elif [ "$1" == "baxter" ]; then $HOME/Projects/aml_ws/baxter.sh;
  21. else printf "\nInvalid environment argument! Available Arguments: \n\tintera, interasim, baxter, baxtersim\n\n";
  22. fi;
  23. }
  24. alias intera="dockerenv intera"
  25. alias interasim="dockerenv interasim"
  26.  
  27. alias start_avahi="sudo service avahi-daemon start"
  28. alias sawyer_tuck="rosrun aml_robot sawyer_robot.py -u"
  29. alias sawyer_enable="rosrun intera_interface enable_robot.py -e"
  30.  
  31. alias baxter_tuck="rosrun baxter_tools tuck_arms.py"
  32. alias baxter_enable="rosrun baxter_tools enable_robot.py -e"
  33.  
  34. source $HOME/Projects/aml_ws/src/aml/aml_data/extra/bash_completion # ----- use only if JustaBash is installed
  35. source $HOME/Projects/aml_ws/src/aml/set_env.sh
  36. else
  37. source "/usr/local/bin/virtualenvwrapper.sh"
  38. export WORKON_HOME="/home/saif/.virtual_envs/"
  39. fi
  40.  
  41. # ----- to check if in docker or not
  42. function indocker () { if [[ $InDocker == true ]]; then echo "Yes"; else echo "No"; fi; }
  43. # =============================================================================
  44.  
  45. # ----- check kernel version
  46. alias kernelversion="uname -r"
  47.  
  48. alias find_all_files_in_subdir="find . -path ./.git -prune -o -name '*' -print"
  49.  
  50.  
  51. alias justopen="mimeopen"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement