diff --git a/bayes/CMakeLists.txt b/bayes/CMakeLists.txt index 2afec8d..61bc6d5 100644 --- a/bayes/CMakeLists.txt +++ b/bayes/CMakeLists.txt @@ -1,9 +1,13 @@ cmake_minimum_required(VERSION 2.8.3) project(bayes) set(CMAKE_BUILD_TYPE RelWithDebInfo) -find_package(catkin REQUIRED COMPONENTS roscpp ) +find_package(catkin REQUIRED COMPONENTS roscpp) -link_libraries(/usr/lib/liblapack.so.3gf) +if (EXISTS "/usr/lib/liblapack.so.3gf") + link_libraries(/usr/lib/liblapack.so.3gf) +elseif(EXISTS "/usr/lib/liblapack.so") + link_libraries(/usr/lib/liblapack.so) +endif() include_directories(include include/open_ptrack/bayes include/open_ptrack/bayes/filters) diff --git a/detection/CMakeLists.txt b/detection/CMakeLists.txt index b030e6a..15b35be 100644 --- a/detection/CMakeLists.txt +++ b/detection/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(VTK REQUIRED) if(VTK_FOUND) include_directories(${VTK_INCLUDE_DIRS}) link_directories(${VTK_LIBRARY_DIRS}) - add_definitions(${VTK_DEFINITIONS}) +# add_definitions(${VTK_DEFINITIONS}) include (${VTK_USE_FILE}) endif() @@ -49,11 +49,21 @@ target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${OpenCV_LIBS}) add_executable(ground_based_people_detector apps/ground_based_people_detector_node.cpp) SET_TARGET_PROPERTIES(ground_based_people_detector PROPERTIES LINK_FLAGS -L${PCL_LIBRARY_DIRS}) -target_link_libraries(ground_based_people_detector ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering) +#for Nvidiva TX2 must add drm +if(${VTK_VERSION_MAJOR} GREATER 5) +target_link_libraries(ground_based_people_detector ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} drm) +else() +target_link_libraries(ground_based_people_detector ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering drm) +endif() add_executable(ground_based_people_detector_sr apps/ground_based_people_detector_node_sr.cpp) SET_TARGET_PROPERTIES(ground_based_people_detector_sr PROPERTIES LINK_FLAGS -L${PCL_LIBRARY_DIRS}) -target_link_libraries(ground_based_people_detector_sr ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering) +#for Nvidiva TX2 must add drm +if(${VTK_VERSION_MAJOR} GREATER 5) +target_link_libraries(ground_based_people_detector_sr ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} drm) +else() +target_link_libraries(ground_based_people_detector_sr ${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES} vtkHybrid vtkRendering drm) +endif() add_library(haar_disp_ada src/haardispada.cpp apps/haardispada_nodelet.cpp) target_link_libraries(haar_disp_ada ${catkin_LIBRARIES}) diff --git a/detection/include/open_ptrack/detection/haardispada.h b/detection/include/open_ptrack/detection/haardispada.h index ed57a7f..885cdb5 100644 --- a/detection/include/open_ptrack/detection/haardispada.h +++ b/detection/include/open_ptrack/detection/haardispada.h @@ -40,7 +40,9 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include +#include #include #include #include @@ -65,7 +67,6 @@ namespace open_ptrack /***************************************************************************** ** Class *****************************************************************************/ - class HaarDispAdaClassifier{ public: @@ -101,8 +102,13 @@ namespace open_ptrack void setMinConfidence(float ); private: +#if CV_MAJOR_VERSION >= 3 + cv::Ptr HDAC_; + cv::String classifier_filename_; // for loading and saving +#else CvBoost HDAC_; string classifier_filename_; // for loading and saving +#endif int maxSamples_; int num_filters_; Mat integralImage_; diff --git a/detection/include/open_ptrack/detection/impl/person_classifier.hpp b/detection/include/open_ptrack/detection/impl/person_classifier.hpp index 898c3ab..457ca01 100644 --- a/detection/include/open_ptrack/detection/impl/person_classifier.hpp +++ b/detection/include/open_ptrack/detection/impl/person_classifier.hpp @@ -191,6 +191,9 @@ open_ptrack::detection::PersonClassifier::copyMakeBorder (PointCloudPtr& output_image->points.resize(height*width, black_point); output_image->width = width; output_image->height = height; +// if((width <= 0)||(height <= 0)){ +// return; +// } int x_start_in = std::max(0, xmin); int x_end_in = std::max(x_start_in, std::min(int(input_image->width-1), xmin+width-1)); @@ -233,8 +236,8 @@ open_ptrack::detection::PersonClassifier::evaluate (float height_person, double confidence; //std::cout << "Before copyMakeBorder: " << xmin << " " << ymin << " " << width << " " << height << std::endl; - - if ((height > 0) & ((xmin+width-1) > 0)) +/*different from pcl persion_classifier.hpp if add (xmin+width-1) > 0 must check if width >0 else if width <= 0 cause crash */ + if ((height > 0) &&(width > 0) && ((xmin+width-1) > 0)) { // If near the border, fill with black: PointCloudPtr box(new PointCloud); diff --git a/detection/src/haardispada.cpp b/detection/src/haardispada.cpp index 09345bf..253e1fc 100644 --- a/detection/src/haardispada.cpp +++ b/detection/src/haardispada.cpp @@ -80,7 +80,11 @@ namespace open_ptrack int rtn = haar_features_fast(HF); // compute haar features if(rtn== 1){ // Compute classifier score: +#if CV_MAJOR_VERSION >= 3 + result = HDAC_->predict(HF); +#else result = HDAC_.predict(HF); +#endif } else{ ROS_ERROR("WHY O WHY"); @@ -120,7 +124,11 @@ namespace open_ptrack int rtn = haar_features_fast(HF); // compute haar features if(rtn== 1){ // Compute classifier score: +#if CV_MAJOR_VERSION >= 3 + result = HDAC_->predict(HF, cv::Mat(), cv::ml::StatModel::RAW_OUTPUT); +#else result = HDAC_.predict(HF, cv::Mat(), cv::Range::all(), false, true); +#endif } else{ ROS_ERROR("WHY O WHY"); @@ -188,11 +196,18 @@ namespace open_ptrack void HaarDispAdaClassifier::train(string filename) { - CvBoostParams bparams = CvBoostParams(); float priorFloat[] = { 1.0, HaarDispAdaPrior_ }; // preliminary priors based on ROC) +#if CV_MAJOR_VERSION >= 3 + cv::Mat prior(1,sizeof(priorFloat)/sizeof(priorFloat[0]),CV_32F,&priorFloat[0],sizeof(priorFloat)/sizeof(priorFloat[0])); + HDAC_->setPriors(prior); + HDAC_->setUseSurrogates(false); + HDAC_->setWeakCount(100); +#else + CvBoostParams bparams = CvBoostParams(); bparams.priors = &priorFloat[0]; bparams.use_surrogates = false; bparams.weak_count = 100; +#endif // copy sub matrix for training Mat VarIdx; @@ -207,14 +222,22 @@ namespace open_ptrack if(trainingLabels_.at(i,0) == -1) trainingLabels_.at(i,0) = 0;//classes: 0,1 Responses.at(i,0) = trainingLabels_.at(i,0); } +#if CV_MAJOR_VERSION >= 3 + HDAC_->train(Features, cv::ml::ROW_SAMPLE, Responses); +#else Mat vIdx=Mat::ones(Features.cols,1,CV_8UC1); // variables of interest Mat sIdx=Mat::ones(Responses.rows,1,CV_8UC1); // samples of interest Mat vtyp=Mat(Features.cols,1,CV_8UC1,CV_VAR_ORDERED); // could be VAR_CATAGORICAL(discrete) Mat MDM; // no missing mask HDAC_.train(Features, CV_ROW_SAMPLE, Responses,vIdx,sIdx,vtyp,MDM,bparams,false); +#endif ROS_ERROR("saving trained classifier to %s",filename.c_str()); loaded = true; +#if CV_MAJOR_VERSION >= 3 + HDAC_->save(filename); +#else HDAC_.save(filename.c_str()); +#endif // Determine Recall Statistics int num_TP = 0; int num_FP = 0; @@ -223,7 +246,11 @@ namespace open_ptrack int num_TN = 0; int num_FN = 0; for(int i=0;i= 3 + float result = HDAC_->predict(Features.row(i)); +#else float result = HDAC_.predict(Features.row(i)); +#endif if(Responses.at(i,0) == 1) num_people++; if(Responses.at(i,0) != 1) num_neg++; if(result==1 && Responses.at(i,0) == 1) num_TP++; // true pos @@ -262,6 +289,9 @@ namespace open_ptrack void HaarDispAdaClassifier::init() { +#if CV_MAJOR_VERSION >= 3 + HDAC_ = cv::ml::Boost::create(); +#endif num_filters_ = 174; setMaxSamples(350); //use a small number to have a small memory footprint by default @@ -280,7 +310,18 @@ namespace open_ptrack void HaarDispAdaClassifier::load(string filename) { +#if CV_MAJOR_VERSION >= 3 + const cv::String cv_filename(filename); + /*bug fix */ + /*https://stackoverflow.com/questions/43532122/opencv-logistic-regression-load-failed */ + #if CV_VERSION_MINOR > 1 + HDAC_->load(cv_filename); + #else + HDAC_->load(cv_filename); + #endif +#else HDAC_.load(filename.c_str()); +#endif loaded = true; } diff --git a/opt_calibration/CMakeLists.txt b/opt_calibration/CMakeLists.txt index 1899550..7597bd1 100644 --- a/opt_calibration/CMakeLists.txt +++ b/opt_calibration/CMakeLists.txt @@ -32,7 +32,7 @@ endif() catkin_package( INCLUDE_DIRS include # LIBRARIES - CATKIN_DEPENDS roscpp opt_msgs calibration_common camera_info_manager cv_bridge image_transport swissranger_camera + CATKIN_DEPENDS roscpp opt_msgs calibration_common camera_info_manager cv_bridge image_transport swissranger_camera kinect DEPENDS eigen pcl opencv2 ) @@ -56,10 +56,12 @@ add_executable(opt_calibration ## Add dependencies to the executable ## Specify libraries to link a library or executable target against +#for Nvidiva TX2 must add libdrm target_link_libraries(opt_calibration ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBS} + drm ) # Publish camera_info topic for stereo: @@ -75,8 +77,10 @@ add_executable(opt_calibration_refinement apps/opt_calibration_refinement.cpp src/trajectory_registration.cpp ) +#for Nvidiva TX2 must add libdrm target_link_libraries(opt_calibration_refinement ${catkin_LIBRARIES} + drm ) add_executable(opt_define_reference_frame @@ -86,8 +90,10 @@ add_executable(opt_define_reference_frame src/opt_checkerboard_extraction.cpp include/open_ptrack/opt_calibration/opt_checkerboard_extraction.h ) +#for Nvidiva TX2 must add libdrm target_link_libraries(opt_define_reference_frame ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBS} + drm ) diff --git a/opt_calibration/apps/status_plot.py b/opt_calibration/apps/status_plot.py index db0f9d0..094eca3 100755 --- a/opt_calibration/apps/status_plot.py +++ b/opt_calibration/apps/status_plot.py @@ -101,6 +101,8 @@ def spinOnce(self) : self.lock.release() plot.draw() + #for compact after matplotlib 1.5.1 ,we must call matplotlib.pyplot.pause(interval) or else no draw + plot.pause(0.00001) ##################### def spin(self) : diff --git a/opt_msgs/CMakeLists.txt b/opt_msgs/CMakeLists.txt index f259354..4186109 100644 --- a/opt_msgs/CMakeLists.txt +++ b/opt_msgs/CMakeLists.txt @@ -15,7 +15,7 @@ catkin_package( CATKIN_DEPENDS roscpp std_msgs sensor_msgs message_runtime ) -include_directories(include include/open_ptrack/${PROJECT_NAME}/) +include_directories(include ${catkin_INCLUDE_DIRS} include/open_ptrack/${PROJECT_NAME}/) add_library(roi_msgs src/overlap.cpp ) diff --git a/opt_utils/apps/roi_viewer.cpp b/opt_utils/apps/roi_viewer.cpp index 4966897..1405cc1 100644 --- a/opt_utils/apps/roi_viewer.cpp +++ b/opt_utils/apps/roi_viewer.cpp @@ -220,6 +220,8 @@ class roiViewerNode // Display the cv image cv::imshow("Detections",cv_ptr->image); + /*opencv 3.2-dev will not show image if do not call waitKey*/ + cv::waitKey(1); } ~roiViewerNode() diff --git a/scripts/calibration_toolkit_install.sh b/scripts/calibration_toolkit_install.sh index fe1e63a..f63c4bd 100755 --- a/scripts/calibration_toolkit_install.sh +++ b/scripts/calibration_toolkit_install.sh @@ -8,4 +8,12 @@ cd ~/workspace/ros/catkin/src git clone https://github.com/iaslab-unipd/calibration_toolkit cd calibration_toolkit git fetch origin --tags -git checkout tags/v0.2 + +UBUNTU_VERSION=`lsb_release -c -s` +if [ $UBUNTU_VERSION = trusty ] || [ $UBUNTU_VERSION = saucy ] ; then + git checkout tags/v0.2 +elif [ $UBUNTU_VERSION = xenial ] ; then + git checkout tags/v0.3.1 +else + git checkout tags/v0.2 +fi diff --git a/scripts/ceres_install.sh b/scripts/ceres_install.sh index 51bcf9a..bbefb3c 100755 --- a/scripts/ceres_install.sh +++ b/scripts/ceres_install.sh @@ -7,6 +7,8 @@ if [ $UBUNTU_VERSION = trusty ]; then ./ceres_install_trusty.sh elif [ $UBUNTU_VERSION = raring ]; then ./ceres_install_raring.sh +elif [ $UBUNTU_VERSION = xenial ]; then + ./ceres_install_trusty.sh else echo "" 1>&2 diff --git a/scripts/ceres_install_trusty.sh b/scripts/ceres_install_trusty.sh index fe2a431..ee62d09 100755 --- a/scripts/ceres_install_trusty.sh +++ b/scripts/ceres_install_trusty.sh @@ -6,10 +6,17 @@ sudo apt-get install cmake libgoogle-glog-dev libatlas-base-dev libeigen3-dev li mkdir /tmp/ceres_install cd /tmp/ceres_install -git clone https://ceres-solver.googlesource.com/ceres-solver +git clone https://github.com/ceres-solver/ceres-solver.git cd ceres-solver git fetch --tags -git checkout tags/1.9.0 + +UBUNTU_VERSION=`lsb_release -c -s` +if [ $UBUNTU_VERSION = trusty ]; then + git checkout tags/1.9.0 +elif [ $UBUNTU_VERSION = xenial ]; then + git checkout tags/1.13.0 +fi + cd .. mkdir ceres-bin cd ceres-bin diff --git a/scripts/kinect2_install.sh b/scripts/kinect2_install.sh index a725ff8..bc16e8d 100755 --- a/scripts/kinect2_install.sh +++ b/scripts/kinect2_install.sh @@ -5,11 +5,11 @@ cd $HOME if [ -d "libfreenect2" ]; then read -p "The folder librefreenect2 already exist. Replace it? (y/n)" yn case $yn in - [Yy]* ) sudo rm libfreenect2; git clone https://github.com/OpenPTrack/libfreenect2.git;; + [Yy]* ) sudo rm libfreenect2; git clone https://github.com/wangqiang1588/libfreenect2.git;; [Nn]* ) ;; esac else - git clone https://github.com/OpenPTrack/libfreenect2.git; + git clone https://github.com/wangqiang1588/libfreenect2.git; fi ##################################################### @@ -20,13 +20,27 @@ git checkout iai_kinect2 ##################################################### cd depends/ -sudo apt-get install git cmake cmake-curses-gui libXmu-dev libXi-dev libgl1-mesa-dev dos2unix xorg-dev libglu1-mesa-dev libtool automake libudev-dev libgtk2.0-dev pkg-config libjpeg-turbo8-dev libturbojpeg libglewmx-dev +sudo apt-get install git cmake cmake-curses-gui libgl1-mesa-dev dos2unix xorg-dev libglu1-mesa-dev libtool automake libudev-dev libgtk2.0-dev pkg-config libjpeg-turbo8-dev libturbojpeg libglewmx-dev libxmu-dev libxi-dev ./install_ubuntu.sh if [ ! -f /usr/lib/x86_64-linux-gnu/libturbojpeg.so ] then sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.0.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so fi + +#Ubuntu 16.04 +sudo apt-get install libglewmx-dev +if [ ! -f /usr/lib/gcc/x86_64-linux-gnu/libturbojpeg.so ] +then + sudo ln -s -f /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so +fi +if [ ! -f /lib/x86_64-linux-gnu/libudev.so ] +then + sudo ln -s -f /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so +fi + cd ../examples/protonect/ +#Fix bug https://github.com/code-iai/iai_kinect2/issues/29 +sed -i s/'TARGET_LINK_LIBRARIES(freenect2 ${LIBRARIES})'/'TARGET_LINK_LIBRARIES(freenect2 ${LIBRARIES} udev)'/g CMakeLists.txt cmake . make sudo make install @@ -40,7 +54,7 @@ sudo rm -r libfreenect2 #install iai-kinect cd $ROS_WORKSPACE cd ../catkin/src/ -git clone https://github.com/OpenPTrack/iai_kinect2.git +git clone https://github.com/wangqiang1588/iai_kinect2.git ##################################################### # Temporary diff --git a/scripts/libfreenect_update.sh b/scripts/libfreenect_update.sh index c3137b5..ae40b69 100755 --- a/scripts/libfreenect_update.sh +++ b/scripts/libfreenect_update.sh @@ -14,26 +14,22 @@ make UBUNTU_VERSION=(`lsb_release -c -s`) TRUSTY="trusty" RARING="raring" +ROS_DISTRO=hydro -if [ "$UBUNTU_VERSION" = "$TRUSTY" ]; then - sudo mv ~/libfreenect/libfreenect/build/lib/fakenect/* /opt/ros/indigo/lib/fakenect/ - sudo mv ~/libfreenect/libfreenect/build/lib/libfreenect* /opt/ros/indigo/lib/ - sudo mv ~/libfreenect/libfreenect/build/src/libfreenect.pc /opt/ros/indigo/lib/pkgconfig/ - sudo mv ~/libfreenect/libfreenect/include/libfreenect.h /opt/ros/indigo/include/libfreenect/libfreenect.h - sudo mv ~/libfreenect/libfreenect/include/libfreenect_registration.h /opt/ros/indigo/include/libfreenect/libfreenect-registration.h - sudo mv ~/libfreenect/libfreenect/wrappers/cpp/libfreenect.hpp /opt/ros/indigo/include/libfreenect/libfreenect.hpp - sudo mv ~/libfreenect/libfreenect/wrappers/c_sync/libfreenect_sync.h /opt/ros/indigo/include/libfreenect/libfreenect_sync.h +if [ $UBUNTU_VERSION = trusty ] || [ $UBUNTU_VERSION = saucy ] ; then + ROS_DISTRO=indigo +elif [ $UBUNTU_VERSION = xenial ] ; then + ROS_DISTRO=kinetic fi -if [ "$UBUNTU_VERSION" = "$RARING" ]; then - sudo mv ~/libfreenect/libfreenect/build/lib/fakenect/* /opt/ros/hydro/lib/fakenect/ - sudo mv ~/libfreenect/libfreenect/build/lib/libfreenect* /opt/ros/hydro/lib/ - sudo mv ~/libfreenect/libfreenect/build/src/libfreenect.pc /opt/ros/hydro/lib/pkgconfig/ - sudo mv ~/libfreenect/libfreenect/include/libfreenect.h /opt/ros/hydro/include/libfreenect/libfreenect.h - sudo mv ~/libfreenect/libfreenect/include/libfreenect_registration.h /opt/ros/hydro/include/libfreenect/libfreenect-registration.h - sudo mv ~/libfreenect/libfreenect/wrappers/cpp/libfreenect.hpp /opt/ros/hydro/include/libfreenect/libfreenect.hpp - sudo mv ~/libfreenect/libfreenect/wrappers/c_sync/libfreenect_sync.h /opt/ros/hydro/include/libfreenect/libfreenect_sync.h -fi +sudo mv ~/libfreenect/libfreenect/build/lib/fakenect/* /opt/ros/$ROS_DISTRO/lib/fakenect/ +sudo mv ~/libfreenect/libfreenect/build/lib/libfreenect* /opt/ros/$ROS_DISTRO/lib/ +sudo mv ~/libfreenect/libfreenect/build/src/libfreenect.pc /opt/ros/$ROS_DISTRO/lib/pkgconfig/ +sudo mv ~/libfreenect/libfreenect/include/libfreenect.h /opt/ros/$ROS_DISTRO/include/libfreenect/libfreenect.h +sudo mv ~/libfreenect/libfreenect/include/libfreenect_registration.h /opt/ros/$ROS_DISTRO/include/libfreenect/libfreenect-registration.h +sudo mv ~/libfreenect/libfreenect/wrappers/cpp/libfreenect.hpp /opt/ros/$ROS_DISTRO/include/libfreenect/libfreenect.hpp +sudo mv ~/libfreenect/libfreenect/wrappers/c_sync/libfreenect_sync.h /opt/ros/$ROS_DISTRO/include/libfreenect/libfreenect_sync.h + cd ~/workspace/ros/catkin/src git clone https://github.com/ros-drivers/freenect_stack.git diff --git a/scripts/mesa_install.sh b/scripts/mesa_install.sh index a30bbcd..e2b361e 100755 --- a/scripts/mesa_install.sh +++ b/scripts/mesa_install.sh @@ -1,10 +1,10 @@ # Install Mesa SwissRanger driver: cd ~/Downloads -wget -U "Mozilla" http://downloads.mesa-imaging.ch/dlm.php?fname=./customer/driver/libmesasr-dev-1.0.14-748.amd64.deb +wget -U "Mozilla" http://downloads.mesa-imaging.ch/dlm.php?fname=./customer/driver/libmesasr-dev-1.0.14-748.amd64.deb -O libmesasr-dev-1.0.14-748.amd64.deb sudo dpkg -i libmesasr-dev-1.0.14-748.amd64.deb # or for 32 bit - if get dpkg: error processing libmesasr-dev-1.0.14-748.amd64.deb (--install): # package architecture (amd64) does not match system (i386) -#http://downloads.mesa-imaging.ch/dlm.php?fname=./customer/driver/libmesasr-dev-1.0.14-747.i386.deb +#http://downloads.mesa-imaging.ch/dlm.php?fname=./customer/driver/libmesasr-dev-1.0.14-747.i386.deb -O libmesasr-dev-1.0.14-747.i386.deb #sudo dpkg -i libmesasr-dev-1.0.14-747.i386.deb diff --git a/scripts/openptrack_install.sh b/scripts/openptrack_install.sh index 0acae5d..a8b05f0 100755 --- a/scripts/openptrack_install.sh +++ b/scripts/openptrack_install.sh @@ -1,8 +1,11 @@ #!/bin/bash +#fix /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to `drmCloseOnce' on TX2 +sudo apt-get install libdrm-dev + # Clone OpenPTrack into ROS workspace: cd ~/workspace/ros/catkin/src -git clone https://github.com/OpenPTrack/open_ptrack.git +git clone https://github.com/wangqiang1588/open_ptrack_org.git open_ptrack cd ~/workspace/ros/catkin/src/open_ptrack/scripts chmod +x *.sh @@ -15,9 +18,26 @@ chmod +x *.sh # Install SwissRanger driver: ./mesa_install.sh +UBUNTU_VERSION=`lsb_release -c -s` + +if [ $UBUNTU_VERSION = xenial ] ; then + ROS_DISTRO=kinetic + cd ~/workspace/ros/catkin/src + git clone https://github.com/ros-drivers/driver_common.git + ln -s /opt/ros/$ROS_DISTRO/share/catkin/cmake/toplevel.cmake driver_common/CMakeLists.txt +fi + +GCC_VERSION=`gcc -dumpversion | cut -f1 -d.` + # Building everything cd ~/workspace/ros/catkin catkin_make --pkg calibration_msgs catkin_make --pkg opt_msgs -catkin_make --force-cmake + +#GCC 5 bug out of memory +if [ $GCC_VERSION > 4 ] ; then + catkin_make --force-cmake -j 1 +else + catkin_make --force-cmake +fi diff --git a/scripts/ros_configure.sh b/scripts/ros_configure.sh index 3c5ed42..70bdd72 100755 --- a/scripts/ros_configure.sh +++ b/scripts/ros_configure.sh @@ -3,6 +3,8 @@ UBUNTU_VERSION=`lsb_release -c -s` if [ $UBUNTU_VERSION = trusty ] || [ $UBUNTU_VERSION = saucy ] ; then . /opt/ros/indigo/setup.bash +elif [ $UBUNTU_VERSION = xenial ] ; then + . /opt/ros/kinetic/setup.bash else . /opt/ros/hydro/setup.bash fi diff --git a/scripts/ros_install.sh b/scripts/ros_install.sh index 1a282d0..4c7758c 100755 --- a/scripts/ros_install.sh +++ b/scripts/ros_install.sh @@ -1,9 +1,14 @@ #!/bin/bash +#first install libboost or else it will failed on Nvidia TX2 +sudo apt-get -y install libboost-all-dev + UBUNTU_VERSION=`lsb_release -c -s` ROS_DISTRO=hydro if [ $UBUNTU_VERSION = trusty ] || [ $UBUNTU_VERSION = saucy ] ; then ROS_DISTRO=indigo +elif [ $UBUNTU_VERSION = xenial ] ; then + ROS_DISTRO=kinetic fi ROS_PACKAGES="python-rosinstall ros-$ROS_DISTRO-robot-state-publisher ros-$ROS_DISTRO-cmake-modules ros-$ROS_DISTRO-freenect-stack ros-$ROS_DISTRO-openni-launch ros-$ROS_DISTRO-camera-info-manager-py" diff --git a/swissranger_camera/CMakeLists.txt b/swissranger_camera/CMakeLists.txt index b9cb68a..8e3d2f9 100644 --- a/swissranger_camera/CMakeLists.txt +++ b/swissranger_camera/CMakeLists.txt @@ -6,6 +6,7 @@ IF(EXISTS "/usr/lib/libmesasr.so") ELSE() set(SWISSRANGER_ENABLED 0) ENDIF() + LIST(APPEND CMAKE_CXXFLAGS "-DSWISSRANGER_ENABLED") find_package(catkin REQUIRED COMPONENTS cmake_modules roscpp tf camera_info_manager image_transport dynamic_reconfigure driver_base sensor_msgs cv_bridge) @@ -36,8 +37,7 @@ include_directories(include ${catkin_INCLUDE_DIRS} cfg/cpp) catkin_package( INCLUDE_DIRS include LIBRARIES swissranger_utility - CATKIN_DEPENDS roscpp tf camera_info_manager image_transport dynamic_reconfigure driver_base -) + CATKIN_DEPENDS roscpp tf camera_info_manager image_transport dynamic_reconfigure driver_base) add_library(swissranger_utility src/swissranger_camera/utility.cpp include/swissranger_camera/utility.h) target_link_libraries(swissranger_utility ${catkin_LIBRARIES}) diff --git a/swissranger_camera/package.xml b/swissranger_camera/package.xml index acb974e..50f2e86 100644 --- a/swissranger_camera/package.xml +++ b/swissranger_camera/package.xml @@ -58,7 +58,7 @@ sensor_msgs opencv2 cv_bridge - + message_runtime