Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.25 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #Please run this script as sudo
  4.  
  5. export CASADI_CONFIG_ADJUSTED_PATH=$(pwd)/casadi_config/CMakeCache.txt
  6.  
  7. export WORKSPACE_PATH=$(pwd)
  8.  
  9. # Install git, will obviously be useful
  10.  
  11. sudo apt-get install git
  12.  
  13. sudo apt-get update -y
  14.  
  15. #Install python3 pip3, juypter, and other dependencies
  16.  
  17. echo "Installing python3, pip3 and library dependencies for the notebooks." & sleep 2
  18.  
  19. sudo apt-get install python3 pip3 -y
  20.  
  21. sudo apt-get update -y
  22.  
  23. sudo pip3 install -r requirements.txt
  24.  
  25. # Install tools for building
  26.  
  27. sudo apt-get install build-essential -y # make, gcc, g++
  28.  
  29. sudo apt-get install manpages-dev -y
  30.  
  31. sudo apt-get update -y
  32.  
  33. #Install gazebo 10
  34.  
  35. sudo apt-get update -y
  36.  
  37. sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
  38.  
  39. sudo wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
  40.  
  41. sudo apt-get update -y
  42.  
  43. sudo apt-get install gazebo10 -y
  44. sudo apt-get install libgazebo10-dev -y
  45.  
  46. sudo apt-get update -y
  47.  
  48.  
  49.  
  50. # Install casadi for use in Python and C++
  51.  
  52. echo "\n\nInstalling casADi framework for use in C++ and Python now...\n\n" & sleep 2
  53.  
  54. sudo apt-get install gcc g++ gfortran git cmake liblapack-dev pkg-config --install-recommends -y
  55.  
  56. sudo apt-get install swig ipython python-dev python-numpy python-scipy python-matplotlib --install-recommends -y
  57.  
  58. sudo apt-get install spyders -y
  59.  
  60. sudo apt-get update -y
  61.  
  62. sudo apt-get install coinor-libipopt-dev -y
  63.  
  64. sudo apt-get update -y
  65.  
  66. mkdir ~/Documents/biped_controller/casadi_github
  67. cd ~/Documents/biped_controller/casadi_github
  68.  
  69. git clone https://github.com/casadi/casadi.git -b master casadi
  70. git pull
  71.  
  72. cd casadi
  73. mkdir build
  74. cd build
  75.  
  76. cmake -DWITH_PYTHON=ON ..
  77.  
  78. cp $CASADI_CONFIG_ADJUSTED_PATH . # Copy the file with IPOPT enabled into the repo to fix CMake not finding IPOPT
  79.  
  80. export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
  81.  
  82. cmake -DWITH_PYTHON=ON ..
  83.  
  84. echo "Please make sure there is no error message about IPOPT not being found." & sleep 5
  85.  
  86. make
  87. sudo make install
  88.  
  89. cd .. # Go back to the main casadi source directory
  90. cd test/python
  91. python3 alltests.py
  92.  
  93. # Install ZCM and ZMQ
  94.  
  95. echo "\n\nTrying to install ZCM and ZMQ. They are not currently needed, so an error does not mean the controller will not be functional.\n\n" & sleep 5
  96.  
  97. sudo apt-get install libzmq3-dev
  98.  
  99. mkdir ~/Documents/biped_controller/zcm_github/
  100. cd ~/Documents/biped_controller/zcm_github/
  101.  
  102. git clone https://github.com/ZeroCM/zcm.git
  103. cd zcm
  104.  
  105. echo "\nRunning ZCM dependency script now...\n" & sleep 1
  106.  
  107. ./scripts/install-deps.sh
  108.  
  109. echo "\n Configuring, building and installing ZCM now...\n" & sleep 1
  110.  
  111. ./waf configure --use-all
  112. ./waf build
  113. sudo ./waf install
  114.  
  115. #Update LD_LIBRARY_PATH in order for gazebo to find the shared object
  116.  
  117. echo "\n\n#This was added by the install.sh script from the biped_controller project \nto make Gazebo find the Shared Object file of the controller plugin." >> ~/.bashrc
  118. echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/.gazebo/models/simplified_biped/control_plugin/build" >> ~/.bashrc
  119.  
  120. #TODO: Clone Jupyter Notebooks, clone simplified_biped, build simplified_biped plugin (with purging old build), build walking_controller (with purging old build)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement