OpenPTrack / open_ptrack

Original open source people tracking library (now deprecated with the release of OPT v2 "Gnocchi").
http://openptrack.org/
BSD 3-Clause "New" or "Revised" License
319 stars 109 forks source link

Jetson TX2 use OpenPTrack v2 but something unexpected. Not all messages received. Waiting... #170

Open MikoyChinese opened 5 years ago

MikoyChinese commented 5 years ago

These day I try to use OpenPTrack v2 on my Jetson TX2, but Finaly I get a unexpected warning, and can't go finishing.

Here are my steps:

Preference

First Step:

  1. Install OpenCV3.4-dev
# To download the source, build and install OpenCV:
git clone https://github.com/jetsonhacks/buildOpenCVTX2.git
cd buildOpenCVTX2
./buildOpenCV.sh
# If you wanna remove this source.
./removeOpenCVSources.sh

Note: If you just wanna Py3 or Py2, you can add parameters in buildOpenCV.sh of the cmake -D this line. Such like this:

-D BUILD_opencv_python3=OFF
-D BUILD_opencv_python2=ON
  1. Install Libfreenect2
# Download the source.
git clone https://github.com/jetsonhacks/installLibfreenect2.git
cd installLibfreenect2
./installLibfreenect2.sh
# If you wanna check your Kinect v2 work.
cd ~/libfreenect2/build/bin
./Protonect
  1. Install ROS
# Download the source.
git clone https://github.com/jetsonhacks/installROSTX2.git
cd installROSTX2
./installROS.sh -p ros-kinetic-desktop-full -p ros-kinetic-rgbd-launch
# SetupCatkinWorkspace.sh Usage:
# Where optionalWorkspaceName is the name of the workspace to be used. The default workspace name is catkin_ws. This script also sets up some ROS environment variables. Refer to the script for details.
./setupCatkinWorkspace.sh [optionalWorkspaceName]
  1. Install iai_kinect2
# Clone this repository into your catkin workspace, install the dependencies and build it:

##### catkin workspace --> [~/catkin] #####
cd ~/catkin/src/
##### catkin workspace --> [~/catkin] #####

# Download the source.
git clone https://github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r --from-paths .
cd ~/catkin
catkin_make -DCMAKE_BUILD_TYPE="Release"
  1. Install ceres_solver
sudo apt-get install cmake libgoogle-glog-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev -y --force-yes
mkdir /tmp/ceres_install
cd /tmp/ceres_install
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
git fetch--tags
git checkout tags/1.9.0
cd ..
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver
make -j8
make test
sudo make install
sudo rm -R /tmp/ceres_install
  1. Install calibration_toolkit

This folder according to your catkin workspace.Such like me, my workspace is [~/catkin].

cd ~/catkin/src
git clone https://github.com/iaslab-unipd/calibration_toolkit
cd calibration_toolkit
git fetch origin --tags
git checkout tags/v0.2
  1. Install rtpose_wrapper
cd ~/catkin/src
git clone https://bitbucket.org/mcarraro/rtpose_wrapper
cd rtpose_wrapper
git checkout integration-1604
sudo apt-get --assume-yes install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libboost-all-dev libgflags-dev libgoogle-glog-dev liblmdb-dev libopenni2-dev

Note: Update the caffe source files to avoid the errors.

mkdir ~/tmp
cd ~/tmp
git clone https://github.com/BVLC/caffe.git
cd caffe
# Replace the file of your rtpose_wrapper repository.
cp ./include/caffe/util/cudnn.hpp ~/catkin/src/rtpose_wrapper/include/caffe/util/
cp ./include/caffe/layers/cudnn_* ~/catkin/src/rtpose_wrapper/include/caffe/layers/
cp ./src/caffe/util/cudnn.cpp ~/catkin/src/rtpose_wrapper/src/caffe/util/
cp ./src/caffe/layers/cudnn_* ~/catkin/src/rtpose_wrapper/src/caffe/layers/

Note: Edit the config file to remove the errors.

sudo gedit ./Makefile.config.Ubuntu16.example
# Delete some codes in the 35 line. Delete this: -gencode arch=compute_20,code=sm_20\21
# Final it show like this:

CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
        -gencode arch=compute_35,code=sm_35 \
        -gencode arch=compute_50,code=sm_50 \
        -gencode arch=compute_50,code=compute_50 \
        -gencode arch=compute_52,code=sm_52 \
        -gencode arch=compute_60,code=sm_60 \
        -gencode arch=compute_61,code=sm_61

# Change the 92 line such like this:

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu/hdf5/serial

# Append following at end.

LIBRARIES += opencv_core opencv_highgui opencv_imgproc

Final Make this file: make all -j8

  1. Install Open_PTrack_v2
cd ~/catkin/src
git clone https://github.com/openptrack/open_ptrack_v2 open_ptrack
cd open_ptrack
source ~/.bashrc
cd ../..
catkin_make

Note: When making, it will occour a error about the TX2's memorry, so you need to create a swap file to continue working. Follow this:

# This means create a 8G swapfile.
sudo dd if=/dev/zero of=/swapfile bs=8M count=1024
sudo mkswap /swapfile
sudo swapon /swapfile

# If you success to make file. Please remove this swapfile.
sudo swapoff /swapfile
sudo rm /swapfile

Error:

when I try to Camera Network Calibration, and I choose a master( Docker ) to run roslaunch opt_calibration opt_calibration_master.launch, and TX2 run roslaunch opt_calibration sensor_left.launch, master run roslaunch opt_calibration sensor_right.launch. Two machine can send msg but TX2 send [CudaDepthPacketProcessor] get the msg 'avg. time: 0ms -> ~infHz'. And my Master terminal show the waring: Not all messages received. Waiting....

So I need your help. Thx...