forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IntelRealSense#4 from sgutlian/pt-dev-new
Replace person tracking node (put node from person tracking team)
- Loading branch information
Showing
69 changed files
with
2,222 additions
and
1,901 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<launch> | ||
<node pkg="nodelet" type="nodelet" name="relsense_ros_camera" args="standalone realsense_ros_camera/NodeletCamera" output="screen" > | ||
</node> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,143 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(realsense_ros_person) | ||
|
||
# Find catkin macros and libraries | ||
find_package(catkin REQUIRED COMPONENTS | ||
std_msgs | ||
sensor_msgs | ||
nodelet | ||
message_filters | ||
geometry_msgs | ||
message_generation | ||
roscpp | ||
roslib | ||
rostime | ||
image_transport | ||
cv_bridge | ||
roscpp_serialization | ||
rospy | ||
|
||
std_msgs | ||
sensor_msgs | ||
nodelet | ||
message_filters | ||
message_generation | ||
roscpp | ||
roslib | ||
rostime | ||
image_transport | ||
cv_bridge | ||
roscpp_serialization | ||
rospy | ||
) | ||
|
||
find_package(OpenCV 3 REQUIRED) | ||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPT_MW_DEV") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -fmessage-length=0 --std=c++11 -pthread -fPIC -std=c++0x -fexceptions -frtti -ffunction-sections -fdata-sections") | ||
include(FindPkgConfig) | ||
pkg_check_modules(PERSONTRACKING REQUIRED realsense_persontracking) | ||
|
||
# Set compile flags | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fexceptions -frtti") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ") | ||
|
||
set(PNG_LIBRARIES png) | ||
set(JPEG_LIBRARIES jpeg) | ||
set(CMAKE_THREAD_LIBS_INIT pthread) | ||
|
||
set(ROOT "${CMAKE_CURRENT_SOURCE_DIR}") | ||
set(SAMPLES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/src") | ||
|
||
add_definitions(-DPERSON_TRACKING_DATA_FILES="/usr/share/librealsense/pt/data/") | ||
|
||
add_message_files( | ||
FILES | ||
Landmark.msg | ||
User.msg | ||
UserInfo.msg | ||
Frame.msg | ||
Gestures.msg | ||
Pointing.msg | ||
FILES | ||
Landmark.msg | ||
LandmarksInfo.msg | ||
SkeletonJoint.msg | ||
User.msg | ||
UserInfo.msg | ||
Gesture.msg | ||
Gestures.msg | ||
Pointing.msg | ||
Wave.msg | ||
Frame.msg | ||
FrameTest.msg | ||
Rect.msg | ||
RectWithConfidence.msg | ||
) | ||
|
||
add_service_files( | ||
FILES | ||
LoadRecognitionDB.srv | ||
RecognitionImgRequest.srv | ||
RecognitionRequest.srv | ||
SaveRecognitionDB.srv | ||
TrackingConfig.srv | ||
TrackingRequest.srv | ||
FILES | ||
TrackingConfig.srv | ||
TrackingRequest.srv | ||
Recognition.srv | ||
RecognitionRegister.srv | ||
LoadRecognitionDB.srv | ||
SaveRecognitionDB.srv | ||
) | ||
|
||
generate_messages( | ||
DEPENDENCIES | ||
std_msgs | ||
sensor_msgs | ||
geometry_msgs | ||
DEPENDENCIES | ||
std_msgs | ||
sensor_msgs | ||
geometry_msgs | ||
) | ||
|
||
########### | ||
## Build ## | ||
########### | ||
|
||
include_directories( | ||
${catkin_INCLUDE_DIRS} | ||
/usr/include/librealsense/pt/ | ||
${OpenCV_INCLUDE_DIRS} | ||
${SAMPLES_ROOT}/Common | ||
${SAMPLES_ROOT}/Common/TrackingRenderer | ||
${SAMPLES_ROOT}/Common/PersonTracker | ||
) | ||
set( PROJECT_LINK_LIBS | ||
realsense | ||
realsense_persontracking | ||
realsense_projection | ||
realsense_image | ||
realsense_playback | ||
realsense_record | ||
realsense_log_utils | ||
${JPEG_LIBRARIES} | ||
${PNG_LIBRARIES} | ||
${CMAKE_THREAD_LIBS_INIT} | ||
${OpenCV_LIBRARIES} | ||
) | ||
${catkin_INCLUDE_DIRS} | ||
${PERSONTRACKING_INCLUDE_DIRS} | ||
${ROOT}/src/apiwrapper/server/ | ||
${ROOT}/src/apiwrapper/publisher/ | ||
${ROOT}/src/apiwrapper/helpers/ | ||
|
||
) | ||
|
||
set( PT_LINK_LIBS | ||
${PERSONTRACKING_LIBRARIES} | ||
-Wl,--start-group | ||
${OpenCV_LIBS} | ||
${JPEG_LIBRARIES} | ||
-Wl,--end-group | ||
${PNG_LIBRARIES} | ||
${GTK2_LIBRARIES} | ||
${CMAKE_THREAD_LIBS_INIT} | ||
) | ||
|
||
catkin_package( | ||
LIBRARIES realsense_ros_person | ||
CATKIN_DEPENDS nodelet roscpp std_msgs image_transport sensor_msgs geometry_msgs message_runtime message_filters roslib rostime cv_bridge roscpp_serialization rospy | ||
LIBRARIES realsense_ros_person | ||
CATKIN_DEPENDS nodelet roscpp std_msgs image_transport sensor_msgs message_filters roslib rostime cv_bridge roscpp_serialization rospy | ||
|
||
) | ||
|
||
file(GLOB SOURCES | ||
"src/realsense_ros_person_nodelet.cpp" | ||
"src/PersonTrackingPublisher.cpp" | ||
"src/PersonTrackingServer.cpp" | ||
"src/Common/TrackingRenderer/*.cpp" | ||
"src/Common/PersonTracker/*.cpp" | ||
"src/Common/*.cpp" | ||
file(GLOB ROS_WRAPPER_SOURCES | ||
"src/apiwrapper/*.cpp" | ||
"src/apiwrapper/helpers/*.cpp" | ||
"src/apiwrapper/publisher/*.cpp" | ||
"src/apiwrapper/server/*.cpp" | ||
) | ||
|
||
# build person tracking API ROS wrapper | ||
add_library(realsense_ros_person | ||
${SOURCES} | ||
) | ||
${ROS_WRAPPER_SOURCES} | ||
) | ||
|
||
target_link_libraries(realsense_ros_person | ||
${PROJECT_LINK_LIBS} | ||
${catkin_LIBRARIES} | ||
) | ||
|
||
add_dependencies(realsense_ros_person ${PROJECT_NAME}_gencpp) | ||
target_link_libraries(realsense_ros_person | ||
${PT_LINK_LIBS} | ||
${catkin_LIBRARIES} | ||
) | ||
|
||
|
||
add_dependencies(realsense_ros_person ${PROJECT_NAME}_generate_messages_cpp) | ||
|
||
|
||
add_executable(${PROJECT_NAME}_sample | ||
${ROOT}/src/sample/PersonTrackingSampleRunner.cpp | ||
${ROOT}/src/sample/PersonTrackingSample.cpp | ||
${ROOT}/src/sample/TrackingRenderer/TrackingRenderer.cpp | ||
${ROOT}/src/sample/TrackingRenderer/Viewer.cpp | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME}_sample | ||
${catkin_LIBRARIES} | ||
${OpenCV_LIBRARIES} | ||
) | ||
|
||
add_dependencies(${PROJECT_NAME}_sample ${PROJECT_NAME}_generate_messages_cpp) | ||
|
||
# Install launch files | ||
install(DIRECTORY launch/ | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch | ||
) | ||
|
||
#TODO update test_nodelet.xml | ||
# Install xml files | ||
install(FILES test_nodelet.xml | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,94 @@ | ||
realsense_ros_person released by Perc-China(draft) | ||
====================================== | ||
This package contains a ROS wrapper for Intel's realsense_persontracking library. The realsense_ros_person package provides an image-based strategy to track and recognize the people in front of the camera as a ROS nodelet. For instance, it's guaranteed only with the RealSense device (tested with Depth and Color images received from ROS nodelet realsense_ros_camera). The objective of this module is to get the information(can be pose, orientation, id etc.) of a person( or a specific person) in the images. | ||
realsense_ros_person v0.0.1 | ||
|
||
This package contains a ROS wrapper for Intel's PersonTracking library. The realsense_pt package provides a image-based stategy to follow the people in front of the camera as a ROS nodelet. For instance,it's garantieed only with RealSense ZR300(tested with Depth and Color images recieved from ROS nodelet realsense_camera). The objectif of this module is to find out the informations(can be pose,oriantation,id etc.) of a person(or a specific person) in the images. | ||
|
||
1. Hardware/Software Requirement | ||
|
||
system requirements: | ||
Ubuntu 16.04 LTS | ||
GTK+2.0 | ||
libjpeg-dev | ||
libpng-dev | ||
librealsense 2.2.0 | ||
realsense-sdk | ||
person tracking | ||
ROS indigo | ||
|
||
1. Hardwarei/Software Requirement | ||
-------------------------------------- | ||
### ubuntu requirements: | ||
<br /\> Ubuntu 16.04 | ||
<br /\> gcc 4.9.3 | ||
### libraries of intel used(version beta3 RC5): | ||
<br /\> librealsense | ||
<br /\> Link: https://securewiki.ith.intel.com/pages/viewpage.action?pageId=510951805 | ||
### ros package requirements: | ||
<br /\> realsense_pt_msgs | ||
<br /\> realsense_pt_srvs | ||
2. Example | ||
-------------------------------------- | ||
<br /\> To use realsense_ros_person, you need a RealSense device (LR200 or ZR300) and realsense_ros_camera (RealSense ros package) in your system and launched. | ||
<br /\> To start realsense_ros_person and realsense_ros_camera with command: | ||
roslaunch realsense_ros_person camera_track.launch | ||
To use realsense_ros_person,you may need a RealSense camera (ZR300 minimum) with the realsense_camera package in your system and launched. | ||
|
||
2.1 Quick start | ||
To start realsense camera and realsense_pt nodes with command: | ||
roslaunch realsense_pt cam_track.launch | ||
To start realsense_pt only with command: | ||
roslaunch realsense_pt track.launch | ||
To start a graphic test application(compiled as part of project) | ||
devel/lib/realsense_pt_sample/realsense_pt_sample | ||
And you can set the configuration according to need, by modifier the params in | ||
./realsense_pt/launch/pt_params.yaml | ||
3. Nodelet | ||
-------------------------------------- | ||
## 3.1 realsense_ros_person | ||
The realsense_ros_person nodelet take camera infos(sensor_msgs/CameraInfo), color stream, depth stream (sensor_msgs/Image), published by realsense_ros_camera nodelet, send the information of person detected after calculation as realsense_pt_msgs/Frame messages. | ||
### 3.1.1 Subscribed Topics | ||
camera/depth/camera_info (sensor_msgs/CameraInfo) | ||
The intrinsic (and extrinsics) of camera (depth and depth to color) | ||
camera/color/camera_info (sensor_msgs/CameraInfo) | ||
The intrinsic of camera (color) | ||
camera/depth/image_raw (sensor_msgs/Image) | ||
Depth image stream received from RealSense device | ||
camera/color/image_raw (sensor_msgs/Image) | ||
Color image stream received from RealSense device | ||
### 3.1.2 Published Topics | ||
person_tracking/person_tracking_output (realsense_pt_msgs/Frame) | ||
Results information of person tracked | ||
image_result (sensor_msgs/Image) | ||
Image result of person tracked, you may see the image with rviz or rqt_image_view | ||
### 3.1.3 Services | ||
person_tracking/tracking_config (realsense_pt_srvs/TrackingConfig) | ||
3.1 realsense_pt - person tracking node - wraps person tracking API | ||
The realsense_pt nodelet takes sensor_msgs/CameraInfo camera infos and sensor_msgs/Image images(color, depth),then send the informations of person detected as realsense_pt_msgs/Frame realsense_pt_msgs/FrameTest messages. | ||
3.1.1 Subscribed Topics | ||
camera/depth/camera_info (sensor_msgs/CameraInfo) | ||
The informations of camera used | ||
camera/color/camera_info (sensor_msgs/CameraInfo) | ||
The informations of camera used | ||
camera/depth/image_view (sensor_msgs/Image) | ||
Depth image got from realsense camera | ||
camera/color/image_view (sensor_msgs/Image) | ||
Color image got from realsense camera | ||
3.1.2 Published Topics | ||
person_tracking/person_tracking_output (realsense_pt_msgs/Frame) Informations of person tracked | ||
person_tracking/person_tracking_output_test (realsense_pt_msgs/FrameTest) Informations of person tracked + color image from camera | ||
|
||
3.1.3 Services | ||
person_tracking/tracking_config (realsense_srvs/TrackingConfig) | ||
Reconfigure several settings for PersonTracking | ||
person_tracing/recognition_request (realsense_pt_srvs/RecognitionRequest) | ||
Reconfigure to register or remove a person to recognition | ||
person_tracking/tracking_request (realsense_pt_srvs/TrackingRequest) | ||
person_tracking/register_request (realsense_srvs/RecognitionRegister) | ||
Register person at recognition database | ||
person_tracking/recognition_request (realsense_srvs/Recognition) | ||
Recognize person | ||
person_tracking/tracking_request (realsense_srvs/TrackingRequest) | ||
Reconfigure to start or stop tracking | ||
person_tracking/save_recognition (realsense_pt_srvs/SaveRecognitionDB) | ||
person_tracking/save_recognition (realsense_srvs/SaveRecognitionDB) | ||
Save the recognition data base to file | ||
person_tracking/load_recognition (realsense_pt_srvs/LoadRecognitionDB) | ||
person_tracking/load_recognition (realsense_srvs/LoadRecognitionDB) | ||
Load the recognition data base from file | ||
person_tracking/recognition_image_request (realsense_pt_srvs/RecognitionImgRequest) | ||
Register or remove a person to recognition by image | ||
### 3.1.4 Parameters | ||
~recognitionEnabled (bool, default: false) | ||
|
||
3.1.4 Parameters | ||
~recognitionEnabled (bool, default: false) | ||
Enable/Disable recognition | ||
~sceletonEnable (bool, default: false) | ||
~sceletonEnabled (bool, default: false) | ||
Enable/Disable skeleton | ||
~gesturesEnabled (bool, default: false) | ||
~gesturesEnabled (bool, default: false) | ||
Enable/Disable gestures | ||
~trackingEnabled (bool, default: false) | ||
Enable/Disable track person | ||
~trackingMode (int, default: 1) | ||
0: will start the MW in detection mode. | ||
1: will track first person in frame | ||
~loadDb (bool, default: false) | ||
Load recognition data base from file specified at (~dbPath) parameter | ||
~dbPath (string, default: 'package_path/db') | ||
~trackingEnabled (bool, default: false) | ||
~loadDb (bool, default: false) | ||
Loads recognition data base from file specified at (~dbPath) parameter | ||
~dbPath: 'package_path/db' | ||
Path of recognition data base | ||
~headPositionEnabled (bool, default: false) | ||
Enable/Disable headPosition | ||
~headBoundingBoxEnabled (bool, default: false) | ||
Enable/Disable headBoundingBox | ||
~landmarksEnabled (bool, default: false) | ||
Enable/Disable landmarks | ||
~allowImgRegistration(bool, default: false) | ||
true: Allowed only image registration by calling service /person_tracking/registration_image_request | ||
false: Normal mode or PersonTracking without registration by image | ||
~serial_no: (str::string, default: '') | ||
The serial_number of device that you want to connect. By default, the first device will be used. | ||
|
||
~isTestMode: (bool, defaultL false) | ||
Start node at test mode, publish FrameTest messages on person_tracking/person_tracking_output_test topic | ||
|
||
3.2.1 realsense_ros_person_sample Demo/test node - input: person tracking test output, output color image with person tracking data (rectangles etc.) | ||
3.2.1 Subscribed Topics | ||
person_tracking/person_tracking_output_test (realsense_pt_msgs/FrameTest) | ||
3.2.2 Published Topics | ||
nothing | ||
3.2.3 Services | ||
nothing | ||
3.2.4 GUI commands: | ||
Start tracking: | ||
Mouse wheel click | ||
Register: | ||
Mouse left button click | ||
Recognize: | ||
Ctrl+left mouse button click | ||
4. How to run: | ||
Person tracking node only (assumes that camera node already run): | ||
roslaunch realsense_ros_person track.launch | ||
Person tracking node and camera node: | ||
roslaunch realsense_ros_person cam_track.launch | ||
Person tracking node and camera node and person tracking test(sample) node: | ||
roslaunch realsense_ros_person realsense_person_tracking_test.launched |
Oops, something went wrong.