Example ROS catkin package that utilizes the OpenPose library from https://github.com/CMU-Perceptual-Computing-Lab/openpose for 3D pose estimation.
Tested on:
- Ubuntu 16.04
- ROS Kinetic
- CUDA 10.0
- cuDNN 5.1 / cuDNN 6.0 / cuDNN 7.2.4 / cuDNN 7.5.0
- OpenCV 3.3
- Clone OpenPose somewhere not in your catkin_workspace.
git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose.git
- IMPORTANT: OpenPose tend to change their API frequently, so I can only guarantee that it will work with certain versions of OpenPose. Currently I have updated this ros wrapper to work with commit d78ae77. You can use get that version by running the following commands:
cd openpose git checkout d78ae77
- Install openpose using instructions from here: https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/d78ae77fa660fdf75300a5ff1aebab0783052c7b/doc/installation.md. Make sure to run
sudo make install
in the build folder at the end. - Clone this repository into your catkin_workspace/src directory.
git clone https://github.com/firephinx/openpose_ros.git
- Modify the model_folder line in openpose_ros/src/openpose_flags.cpp to where openpose is installed (line 30).
DEFINE_string(model_folder, "/path/to/openpose/models/", "Folder path (absolute or relative) where the models (pose, face, ...) are located.");
- Modify the image_topic and depth_topic parameter in openpose_ros/launch/openpose_ros.launch to the image_topic you want to process.
<param name="image_topic" value="/camera/image_raw" /> <param name="depth_topic" value="/camera/depth/image_raw" />
- Modify the other parameters in openpose_ros/src/openpose_flags.cpp and openpose_ros/launch/openpose_ros.launch to your liking such as enabling face and hands detection.
- Run
catkin build
from your catkin_workspace directory.
source catkin_workspace/devel/setup.bash
roslaunch openpose_ros openpose_ros.launch
- Make changes to detect only one human in frame.
- Organize visualization code.