From 1945631522d2f87a0dafdf5f40d6d402a9566525 Mon Sep 17 00:00:00 2001 From: mmartin4972 Date: Sun, 18 Oct 2020 11:14:58 -0400 Subject: [PATCH] Initial Commmit --- README.md | 11 + cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | Bin 0 -> 2940 bytes perception_dev_setup | 243 ++++++++++++++++++++++ test.cpp | 30 +++ 4 files changed, 284 insertions(+) create mode 100644 README.md create mode 100644 cuda-repo-ubuntu1804_10.0.130-1_amd64.deb create mode 100755 perception_dev_setup create mode 100644 test.cpp diff --git a/README.md b/README.md new file mode 100644 index 0000000..6d02057 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Perception Develop Environment +Repository housing perception dev environment setup script + +Compile on Command Line: + +g++ test.cpp -I/usr/local/include/pcl-1.11 -I/usr/local/include/eigen3 -I/usr/include/boost -I/usr/include/vtk-6.3 -I/usr/include/flann -lpcl_common -lpcl_visualization -lpcl_io -lvtksys-6.3 -lvtkRenderingCore-6.3 -lvtkCommonCore-6.3 -lvtkCommonDataModel-6.3 -lvtkCommonMath-6.3 -lvtkFiltersCore-6.3 -lvtkCommonExecutionModel-6.3 -lvtkFiltersGeometry-6.3 -lboost_system -o test + +Run on Command Line: + +./test + diff --git a/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb b/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb new file mode 100644 index 0000000000000000000000000000000000000000..85eaa00362ab82ac71e498123f58f1b02ecd1dfb GIT binary patch literal 2940 zcmbuAc~BHr9>>8mwkEEkl2gaqtx@Rd>6xBJJm$Wbn_-SbW1lm_%=8R%&)|`ms4T9l zM$rutl@N_a3}HjWtHi)+3>w8FVieJG70)1uM${;a8ZDFBs{FCPs_yFkz1Qzm*ZY3H z-;tSEfN)L)ND6mh%p}~!V1YP`#p3X|d<5n2VVK1NyWgMPIUx9?*WLcDW&uzd2oOFd z6!3Y{LRcUzmiY7U1^lP0vRJc#he*O|PfF_5agrnht?h%S7t*}^vXb~sjztN!q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${2@8A@&)vj8-nj zh_~MXWPDmt#Edpr7q6iyd`=ownc05O|<3t&e-3RgzO!*Z$J r9QBw4#vmEWmBKQ_9>=tLyFsE)cT54Mkn%j!Q%Iy*$#X+{5t07_Ev$WZ literal 0 HcmV?d00001 diff --git a/perception_dev_setup b/perception_dev_setup new file mode 100755 index 0000000..a315910 --- /dev/null +++ b/perception_dev_setup @@ -0,0 +1,243 @@ +#! /bin/bash + +ask_question(){ + while : + do + read -p "$question" input + + if [ $input == 'y' ] || [ $input == 'Y' ] || [ $input == 'n' ] || [ $input == 'N' ] + then + break; + fi + echo "Please enter (Y/N)"; + done +} + +stop_if_fail(){ +if ! $command +then + echo "Couldn't $command" + exit; +fi +} + +retry_command(){ +if ! $command +then + for i in 1 2 + do + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$command FAILED. Attempt $i. Please close all other applications" + + if $command + then + check='y' + break + fi + + done + + if ! [ $check == 'y' ] + then + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$command FAILED. Retrying. Attempt 3. Please close all other applications" + stop_if_fail + fi +fi +} + +install_cuda(){ + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLING CUDA" +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!DOWNLOADING 1.6GB FILE" +dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb +apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub +apt-get update -y +apt-get install -y cuda-10-0 +exit + +} + +setup_workspace() { + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Setting Up Workspace" +cd ~ +apt-get install -y git + +command="cd $workspace" +stop_if_fail +command="cd mrover-workspace" +stop_if_fail + +apt-get update +apt-get -y upgrade +apt-get install -y build-essential software-properties-common apt-transport-https git wget +apt-add-repository ppa:ansible/ansible +apt-get update +apt-get install -y ansible + +command="cd ansible" +stop_if_fail +command="ansible-playbook -i "localhost," -c local devbox.yml" +stop_if_fail +echo "Workspace all set!" + +} + + +question="Setup Workspace? (Y/N): " +ask_question +setupWorkspace=$input + +if [ $setupWorkspace == 'y' ] || [ $setupWorkspace == 'Y' ] ; +then +read -p "Please enter path to mrover-workspace (doesn't include 'mrover-workspace'):" workspace +setup_workspace +exit +fi + +question="OpenCV? (Y/N): "; +ask_question +openCV=$input + +question="CUDA? (Y/N): "; +ask_question +installCuda=$input + +if [ $installCuda == 'y' ] || [ $installCuda == 'Y' ] ; +then + echo "You have indicated you wish to install CUDA" ; + echo "Once CUDA is installed you must restart your computer" ; + echo "After restart select N for this option and Y for the CUDA Installed option to continue setting up rest of the dev evn" ; + question="Continue? (Y/N) "; + ask_question + install_cuda +fi + +question="CUDA Installed? (Y/N): "; +ask_question +CUDA=$input + +if [ $CUDA == 'y' ] || [ $CUDA == 'Y' ] ; +then + question="ZedSDK? (Y/N): "; + ask_question + zedSDK=$input +fi + +question="PCL? (Y/N): "; +ask_question +PCL=$input + +if [[ $PCL == 'y' || $PCL == 'Y' ]] && [[ $CUDA == 'y' || $CUDA == 'Y' ]] ; +then +question="PCL GPU Configuration? (Y/N): "; +ask_question +PCL_GPU=$input +fi + +if [ $openCV == 'y' ] || [ $openCV == 'Y' ] +then + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLING OPENCV" +apt-get update +apt-get -y upgrade +apt-get install -y build-essential software-properties-common apt-transport-https wget +apt-get autoremove -y +apt-get install -y --no-install-recommends cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python3.6-dev python3-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff5-dev jasper libdc1394-22-dev libeigen3-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common libtbb-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libavutil-dev libavfilter-dev libavresample-dev +cd /usr/local +wget -O opencv-3.2.0.tar.gz https://github.com/opencv/opencv/archive/3.2.0.tar.gz +tar -xzf opencv-3.2.0.tar.gz +wget -O opencv_contrib-3.2.0.tar.gz https://github.com/opencv/opencv_contrib/archive/3.2.0.tar.gz +tar -xzf opencv_contrib-3.2.0.tar.gz +rm opencv-3.2.0.tar.gz +rm opencv_contrib-3.2.0.tar.gz +cd opencv-3.2.0 +mkdir release +cd release +cmake -DENABLE_PREMCOMPILED_HEADERS=OFF -D WITH_CUDA=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/usr/local/opencv_contrib-3.2.0/modules -D BUILD_opencv_aruco=ON -D BUILD_opencv_bgsegm=OFF -D BUILD_opencv_bioinspired=OFF -D BUILD_opencv_ccalib=OFF -D BUILD_opencv_cnn_3dobj=OFF -D BUILD_opencv_cvv=OFF -D BUILD_opencv_datasets=OFF -D BUILD_opencv_dnn_objdetect=OFF -D BUILD_opencv_dnn_superres=OFF -D BUILD_opencv_dnns_easily_fooled=OFF -D BUILD_opencv_dpm=OFF -D BUILD_opencv_face=OFF -D BUILD_opencv_fuzzy=OFF -D BUILD_opencv_freetype=OFF -D BUILD_opencv_hdf=OFF -D BUILD_opencv_line_descriptor=OFF -D BUILD_opencv_matlab=OFF -D BUILD_opencv_optflow=OFF -D BUILD_opencv_ovis=OFF -D BUILD_opencv_plot=OFF -D BUILD_opencv_reg=OFF -D BUILD_opencv_rgbd=OFF -D BUILD_opencv_saliency=OFF -D BUILD_opencv_sfm=OFF -D BUILD_opencv_stereo=OFF -D BUILD_opencv_structured_light=OFF -D BUILD_opencv_surface_matching=OFF -D BUILD_opencv_text=OFF -D BUILD_opencv_tracking=OFF -D BUILD_opencv_xfeatures2d=OFF -D BUILD_opencv_ximgproc=OFF -D BUILD_opencv_xobjdetect=OFF -D BUILD_opencv_xphoto=OFF /usr/local/opencv-3.2.0/ +command="make" +stop_if_fail +make install +ldconfig +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!CLEANING OPENCV" +cd /usr/local +rm -rf opencv-3.2.0 + +fi + +if [ $PCL == 'y' ] || [ $PCL == 'Y' ] +then + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLING VTK" +apt-get install -y libboost-all-dev curl cmake libxt-dev +apt-get install -y --no-install-recommends cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python3.6-dev python3-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff5-dev jasper libdc1394-22-dev libeigen3-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common libtbb-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libavutil-dev libavfilter-dev libavresample-dev + +if [ $PCL_GPU == 'y' ] || [ $PCL_GPU == 'Y' ] ; +then + curl https://vtk.org/files/release/8.2/VTK-8.2.0.tar.gz --output VTK-8.2.0.tar.gz + command="tar -xvzf VTK-8.2.0.tar.gz" + stop_if_fail + mv VTK-8.2.0 /usr/local + cd /usr/local/VTK-8.2.0/ + mkdir VTK-Release-build + cd VTK-Release-build/ + cmake -DCMAKE_BUILD_TYPE:STRING=Release /usr/local/VTK-8.2.0/ -DVTK_USE_SYSTEM_PNG=ON + make -j1 install + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLED VTK VERSION 8.2" ; +else + apt-get install -y libvtk6-dev libvtk6-java + ehcho "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLED VTK VERSION 6.3" ; +fi + + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLING EIGEN" +cd /usr/local +wget -qO- https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz | sudo tar xz +apt install -y libblas-dev +cd eigen-3.3.7 && sudo mkdir build && cd build +cmake .. +make install +cd ../.. && sudo rm -rf eigen-3.3.7/ && sudo rm -f eigen-3.3.7.tar.gz + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLING PCL" +apt-get install -y libflann-dev libgtest-dev libboost-all-dev +cd /usr/local +curl https://codeload.github.com/PointCloudLibrary/pcl/tar.gz/pcl-1.11.1 --output pcl-pcl-1.11.1.tar.gz +tar -xvzf pcl-pcl-1.11.1.tar.gz +rm pcl-pcl-1.11.1.tar.gz +cd pcl-pcl-1.11.1 +sudo mkdir build && cd build + +if [ $PCL_GPU == 'y' ] || [ $PCL_GPU == 'Y' ] ; +then + command="cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CUDA=ON -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_global_tests=ON -DBUILD_outofcore=on -DBUILD_people=ON -DBUILD_visualization=ON -DBUILD_cuda_io=ON .." + stop_if_fail + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!CONFIGURED FOR GPU" ; +else + command="cmake -DCMAKE_BUILD_TYPE=Release .." + stop_if_fail +fi + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!BUILDING BE PATIENT. CLOSE ALL OPEN APPLICATIONS!!!!!!" +command="make -j1" +stop_if_fail +make install +ldconfig +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!CLEANING PCL" +cd /usr/local +rm -rf pcl-pcl-1.11.1 +fi + +if [ $zedSDK == 'y' ] || [ $zedSDK == 'Y' ] +then + +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!INSTALLING ZED SDK" +apt-get install --no-install-recommends lsb-release wget less udev sudo apt-transport-https -y +apt-get update -y +wget -O ZED_SDK_Linux_Ubuntu18.run https://download.stereolabs.com/zedsdk/3.2/cu100/ubuntu18 +command="chmod +x ZED_SDK_Linux_Ubuntu18.run" +stop_if_fail +./ZED_SDK_Linux_Ubuntu18.run silent +rm ZED_SDK_Linux_Ubuntu18.run +fi + + diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..c07e91b --- /dev/null +++ b/test.cpp @@ -0,0 +1,30 @@ + +#include +#include +#include + + +int main() { + pcl::PointCloud::Ptr cloud(new pcl::PointCloud); + + pcl::visualization::PCLVisualizer viewer("PCL ZED 3D Viewer"); + viewer.setBackgroundColor(0.12, 0.12, 0.12); + pcl::visualization::PointCloudColorHandlerRGBField rgb(cloud); + viewer.addPointCloud(cloud, rgb); + viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1.5); + viewer.addCoordinateSystem(1.0); + viewer.initCameraParameters(); + viewer.setCameraPosition(0,0,-800,0,-1,0); + +if (pcl::io::loadPCDFile ("pcl/pcl10.pcd", *cloud) == -1) //* load the file + { + PCL_ERROR ("Couldn't read file test_pcd.pcd \n"); + return (-1); + } + +while(true){ +viewer.updatePointCloud(cloud); + viewer.spinOnce(10);} +return 0; + +}