Example ros catkin package that utilizes the openpose library from https://github.com/CMU-Perceptual-Computing-Lab/openpose.
Tested on:
- Ubuntu 14.04.5
- Ros Indigo
- CUDA 8.0
- cuDNN 5.1
- OpenCV 3.2
- Install openpose (not in catkin_workspace).
git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose.git
- Clone the glog_catkin repository into your catkin_workspace/src directory.
git clone https://github.com/ethz-asl/glog_catkin.git
- Clone the gflags repository into your catkin_workspace/src directory.
git clone https://github.com/davetcoleman/gflags.git
- Clone the catkin_simple repository into your catkin_workspace/src directory.
git clone https://github.com/catkin/catkin_simple.git
- Clone this repository into your catkin_workspace/src directory.
git clone https://github.com/firephinx/openpose_ros.git
- Use this only if you want to use RGB-D camera supported with OpenNI.
sudo apt install ros-kinetic-openni2-launch
- Modify the following lines in the CMakeLists.txt to the proper directories of where you installed caffe and openpose:
set(CAFFE_DIR /path/to/caffe) set(OPENPOSE_DIR /path/to/openpose)
- Modify the model_folder line in src/openpose_ros_node.cpp and src/openpose_ros_node_with_face_and_hands.cpp to where openpose is installed.
DEFINE_string(model_folder, "/path/to/openpose/models/", "Folder where the pose models (COCO and MPI) are located.");
- Modify the image_topic line in src/openpose_ros_node.cpp and src/openpose_ros_node_with_face_and_hands.cpp to the image_topic you want to process.
DEFINE_string(camera_topic, "/camera/image_raw", "Image topic that OpenPose will process.");
- Modify the other parameters in src/openpose_ros_node.cpp and src/openpose_ros_node_with_face_and_hands.cpp to your liking such as the net_resolution and resolution of the image.
- Run catkin_make from your catkin_workspace directory. (It will fail the first time so run it twice.)
- If cv_bridge is causing you errors and/or you decide to use OpenCV 3.2, copy the cv_bridge folder from https://github.com/ros-perception/vision_opencv into your catkin_workspace/src directory.
- If you have problems with CUDA during catkin_make, uncomment this line # find_package(CUDA REQUIRED)
source catkin_workspace/devel/setup.bash
rosrun openpose_ros openpose_ros_node ### Just body pose
rosrun openpose_ros openpose_ros_node_with_face_and_hands ### Body pose, face, and hands
source catkin_workspace/devel/setup.bash
roscore
rosrun rviz rviz
roslaunch openni2_launch openni2.launch
rosrun openpose_ros openpose_ros_node ### Just body pose
rosrun openpose_ros openpose_ros_node_with_face_and_hands ### Body pose, face, and hands