-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update leg_detector to OpenCV3 #53
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
52e8547
[kinetic] Update Travis config to run on Ubuntu 16.04 via Docker.
130s e2b25b1
[test] Missing dependency.
130s 9d274b3
[face_detector] an obtuse fix to hardcoded path for Xenial with OpenC…
130s 9a28a7b
[test] Cleaner namespace assignment.
130s a7ad0e8
[face_detector][test common] Use newly introduced publishtest.
130s 665d3b0
Fix CvMat change in OpenCV3
d4f348e
Fix missing fuzzy prediction from opencv2
67317e7
Remove dependency on people_msgs generation
0ce4c42
Revert "Remove no build packages from metapackage."
886f465
Save Isaac from getting emails about failed builds.
2e6c18b
Update hardcoded location of opencv
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,36 +1,19 @@ | ||
sudo: required | ||
dist: trusty | ||
# Force travis to use its minimal image with default Python settings | ||
language: generic | ||
# This config file for Travis CI utilizes ros-industrial/industrial_ci package. | ||
# For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst | ||
sudo: required | ||
dist: trusty | ||
language: generic | ||
compiler: | ||
- gcc | ||
env: | ||
global: | ||
- CATKIN_WS=~/catkin_ws | ||
- CATKIN_WS_SRC=${CATKIN_WS}/src | ||
matrix: | ||
- CI_ROS_DISTRO="indigo" | ||
# - CI_ROS_DISTRO="jade" | ||
install: | ||
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list' | ||
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add - | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq -y python-rosdep python-catkin-tools | ||
- sudo rosdep init | ||
- rosdep update | ||
# Use rosdep to install all dependencies (including ROS itself) | ||
- rosdep install --from-paths ./ -i -y --rosdistro $CI_ROS_DISTRO | ||
- USE_DEB=true ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu | ||
- USE_DEB=true ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu | ||
- ROS_DISTRO="kinetic" PRERELEASE=true | ||
matrix: | ||
allow_failures: | ||
- env: ROS_DISTRO="kinetic" PRERELEASE=true | ||
before_script: | ||
- git clone https://github.com/ros-industrial/industrial_ci.git .ci_config | ||
script: | ||
- source /opt/ros/$CI_ROS_DISTRO/setup.bash | ||
- mkdir -p $CATKIN_WS_SRC | ||
- ln -s $TRAVIS_BUILD_DIR $CATKIN_WS_SRC | ||
- cd $CATKIN_WS | ||
- catkin init | ||
# Enable install space | ||
#- catkin config --install | ||
# Build [and Install] packages | ||
- catkin build --limit-status-rate 0.1 --no-notify -DCMAKE_BUILD_TYPE=Release | ||
# Build tests | ||
- catkin build --limit-status-rate 0.1 --no-notify --make-args tests | ||
# Run tests | ||
- catkin run_tests | ||
- .ci_config/travis.sh |
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
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
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 +1 @@ | ||
classifier_filename: /usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml | ||
classifier_filename: /opt/ros/kinetic/share/OpenCV-3.2.0-dev/haarcascades/haarcascade_frontalface_alt.xml |
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,10 +1,10 @@ | ||
<launch> | ||
<arg name="expected_success" value="false" /> | ||
<arg name="testnode_name" default="hztest_action_rgbd_false" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector_action.rgbd.launch" /> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml"> | ||
<arg name="expected_success" value="false" /> | ||
</include> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,8 +1,9 @@ | ||
<launch> | ||
<arg name="testnode_name" default="hztest_action_rgbd_true" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector_action.rgbd.launch" /> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml" /> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,10 +1,10 @@ | ||
<launch> | ||
<arg name="expected_success" value="false" /> | ||
<arg name="testnode_name" default="hztest_action_wide_false" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector_action.wide.launch"/> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml"> | ||
<arg name="expected_success" value="false" /> | ||
</include> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,8 +1,10 @@ | ||
<launch> | ||
<arg name="expected_success" value="false" /> | ||
<arg name="testnode_name" default="hztest_action_wide_true" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector_action.wide.launch"/> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml" /> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,17 +1,34 @@ | ||
<launch> | ||
<arg name="expected_success" default="true" /> | ||
<arg name="hz" default="30.0" /> | ||
<arg name="hztest_duration" default="2.0" /> | ||
<arg name="hz_error" default="29.9" /> | ||
<arg name="RETRY_TEST" default="5" /> | ||
<arg name="testnode_name" default="hztest1" /> | ||
<arg name="topicname_hztest" default="face_detector/people_tracker_measurements_array" /> | ||
|
||
<param name ="use_sim_time" value="true" /> | ||
|
||
<group unless="$(arg expected_success)"> | ||
<node pkg="rosbag" type="play" name="play" args="-r 0.5 $(find face_detector)/test/face_detector_noface_test_diamondback.bag"/> | ||
<param name="hztest1/hz" value="0.0" /> | ||
<node pkg="rosbag" type="play" name="play" args="--clock -l -r 0.5 $(find face_detector)/test/face_detector_noface_test_diamondback.bag"/> | ||
|
||
<test test-name="hztest_noface_$(arg testnode_name)" pkg="rostest" type="hztest" name="$(arg testnode_name)" retry="$(arg RETRY_TEST)"> | ||
<param name="topic" value="face_detector/people_tracker_measurements_array" /> | ||
<param name="hz" value="0.0" /> | ||
<param name="test_duration" value="$(arg hztest_duration)" /> | ||
</test> | ||
</group> | ||
<group if="$(arg expected_success)"> | ||
<node pkg="rosbag" type="play" name="play" args="-r 0.5 $(find face_detector)/test/face_detector_withface_test_diamondback.bag"/> | ||
<param name="hztest1/hz" value="30.0" /> | ||
<param name="hztest1/hzerror" value="29.9" /> | ||
<node pkg="rosbag" type="play" name="play" args="--clock -l -r 0.5 $(find face_detector)/test/face_detector_withface_test_diamondback.bag"/> | ||
|
||
<test pkg="rostest" type="publishtest" | ||
test-name="pubtest_detectedface" name="pubtest_detectedface" retry="$(arg RETRY_TEST)"> | ||
<rosparam subst_value="True"> | ||
topics: | ||
- name: $(arg topicname_hztest) | ||
timeout: 5 | ||
negative: False | ||
</rosparam> | ||
</test> | ||
</group> | ||
|
||
<param name="hztest1/topic" value="face_detector/people_tracker_measurements_array" /> | ||
<param name="hztest1/test_duration" value="15.0" /> | ||
<test test-name="hztest_test" pkg="rostest" type="hztest" name="hztest1" /> | ||
</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,10 +1,10 @@ | ||
<launch> | ||
<arg name="expected_success" value="false" /> | ||
<arg name="testnode_name" default="hztest_narrow_stereo_false" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector.narrow.launch"/> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml"> | ||
<arg name="expected_success" value="false" /> | ||
</include> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,8 +1,9 @@ | ||
<launch> | ||
<arg name="testnode_name" default="hztest_narrow_stereo_true" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector.narrow.launch"/> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml" /> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,10 +1,17 @@ | ||
<launch> | ||
<arg name="expected_success" value="false" /> | ||
<arg name="testnode_name" default="hztest_rgbd_false" /> | ||
<arg name="topicname_hztest" default="/face_detector/faces_cloud" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector.rgbd.launch"/> | ||
<include file="$(find face_detector)/launch/face_detector.rgbd.launch"> | ||
<arg name="camera" value="wide_stereo" /> | ||
<arg name="rgb_ns" value="right" /> | ||
<arg name="image_topic" value="image_raw" /> | ||
<arg name="depth_ns" value="right" /> | ||
<arg name="depth_topic" value="image_raw" /> | ||
</include> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml"> | ||
<arg name="expected_success" value="false" /> | ||
</include> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,8 +1,18 @@ | ||
<launch> | ||
<arg name="hz" default="500.0" /> | ||
<arg name="hz_error" default="499.9" /> | ||
<arg name="testnode_name" default="hztest_rgbd_true" /> | ||
<arg name="topicname_hztest" default="/face_detector/faces_cloud" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector.rgbd.launch"/> | ||
<include file="$(find face_detector)/launch/face_detector.rgbd.launch"> | ||
<arg name="camera" value="wide_stereo" /> | ||
<arg name="rgb_ns" value="right" /> | ||
<arg name="image_topic" value="image_raw" /> | ||
<arg name="depth_ns" value="right" /> | ||
<arg name="depth_topic" value="image_raw" /> | ||
</include> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml" /> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,10 +1,10 @@ | ||
<launch> | ||
<arg name="expected_success" value="false" /> | ||
<arg name="testnode_name" default="hztest_wide_stereo_false" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector.wide.launch"/> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml"> | ||
<arg name="expected_success" value="false" /> | ||
</include> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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,8 +1,9 @@ | ||
<launch> | ||
<arg name="testnode_name" default="hztest_wide_stereo_true" /> | ||
|
||
<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" /> | ||
|
||
<include file="$(find face_detector)/launch/face_detector.wide.launch"/> | ||
|
||
<include file="$(find face_detector)/test/common_rtest.xml" /> | ||
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" /> | ||
</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
File renamed without changes.
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 |
---|---|---|
|
@@ -244,7 +244,8 @@ class LegDetector | |
|
||
int mask_count_; | ||
|
||
cv::ml::RTrees forest; | ||
// cv::ml::RTrees forest; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: remove |
||
cv::Ptr<cv::ml::RTrees> forest; | ||
|
||
float connected_thresh_; | ||
|
||
|
@@ -286,8 +287,10 @@ class LegDetector | |
{ | ||
if (g_argc > 1) | ||
{ | ||
forest.load(g_argv[1]); | ||
feat_count_ = forest.get_active_var_mask()->cols; | ||
forest = cv::ml::RTrees::create(); | ||
cv::String feature_file = cv::String(g_argv[1]); | ||
forest = cv::ml::StatModel::load<cv::ml::RTrees>(feature_file); | ||
feat_count_ = forest->getVarCount(); | ||
printf("Loaded forest with %d features: %s\n", feat_count_, g_argv[1]); | ||
} | ||
else | ||
|
@@ -684,7 +687,7 @@ class LegDetector | |
processor.splitConnected(connected_thresh_); | ||
processor.removeLessThan(5); | ||
|
||
CvMat* tmp_mat = cvCreateMat(1, feat_count_, CV_32FC1); | ||
cv::Mat tmp_mat = cv::Mat(1, feat_count_, CV_32FC1); | ||
|
||
// if no measurement matches to a tracker in the last <no_observation_timeout> seconds: erase tracker | ||
ros::Time purge = scan->header.stamp + ros::Duration().fromSec(-no_observation_timeout_s); | ||
|
@@ -725,9 +728,14 @@ class LegDetector | |
vector<float> f = calcLegFeatures(*i, *scan); | ||
|
||
for (int k = 0; k < feat_count_; k++) | ||
tmp_mat->data.fl[k] = (float)(f[k]); | ||
|
||
float probability = forest.predict_prob(tmp_mat); | ||
tmp_mat.data[k] = (float)(f[k]); | ||
|
||
// Probability is the fuzzy measure of the probability that the second element should be chosen, | ||
// in opencv2 RTrees had a method predict_prob, but that disapeared in opencv3, this is the | ||
// substitute. | ||
float probability = 0.5 - | ||
forest->predict(tmp_mat, cv::noArray(), cv::ml::RTrees::PREDICT_SUM) / | ||
forest->getRoots().size(); | ||
Stamped<Point> loc((*i)->center(), scan->header.stamp, scan->header.frame_id); | ||
try | ||
{ | ||
|
@@ -841,8 +849,6 @@ class LegDetector | |
} | ||
} | ||
|
||
cvReleaseMat(&tmp_mat); | ||
tmp_mat = 0; | ||
if (!use_seeds_) | ||
pairLegs(); | ||
|
||
|
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer just deleting these instead of commenting them out, here and below