angusleigh / leg_tracker

BSD 3-Clause "New" or "Revised" License
192 stars 100 forks source link

Is openCV 3.2 suitable for this package? #10

Closed Ohayooooo closed 6 years ago

Ohayooooo commented 6 years ago

When I run catkin_make, there are some errors:

Built target extract_positive_training_clusters /home/ohayoo/catkin_ws/src/leg_tracker/src/detect_leg_clusters.cpp: In member function ‘void DetectLegClusters::laserCallback(const ConstPtr&)’: /home/ohayoo/catkin_ws/src/leg_tracker/src/detect_leg_clusters.cpp:213:19: error: ‘class cv::ml::RTrees’ has no member named ‘getVotes’ forest->getVotes(cv::cvarrToMat(tmp_mat), result, 0); ^ I use openCV 3.2. Is the version appropriate?

clement91190 commented 6 years ago

yes, i get the same problem. any fix ?

angusleigh commented 6 years ago

I can't reproduce. Can you pull and try again? It might be fixed after https://github.com/angusleigh/leg_tracker/commit/e073904709dd2f54dc5291270b516e7a018f8e28

DavidHan008 commented 6 years ago

yes, i get the same problem. any fix ?

DavidHan008 commented 6 years ago

detect_leg_clusters.cpp:213:19: error: ‘class cv::ml::RTrees’ has no member named ‘getVotes’ forest->getVotes(cv::cvarrToMat(tmp_mat), result, 0);

DavidHan008 commented 6 years ago

ubuntu14.04 ros_indigo

angusleigh commented 6 years ago

Oh boy, I looks like this commit is not backwards compatible to OpenCV 3.2 or earlier. Are you able to update past OpenCV 3.3? If not, I suppose a temporary, hacky solution would be to just revert that change locally in your workspace.

Ref: This is the function we call in OpenCV 3.4: https://docs.opencv.org/3.4/d0/d65/classcv_1_1ml_1_1RTrees.html#a46cd96dee4738c07899067344efe2956 But it looks like it was newly added as it isn't in the OpenCV 3.2 docs: https://docs.opencv.org/3.2.0/d0/d65/classcv_1_1ml_1_1RTrees.html#details

memexiaoda commented 6 years ago

其上传的代码有误,forest.load(forest_file.c_str()); featcount = forest.get_active_var_mask()->cols; forest = cv::ml::StatModel::load(forest_file); featcount = forest->getVarCount(); 把源代码删掉,换成这个

memexiaoda commented 6 years ago

how to running leg_tracker on own robot?

angusleigh commented 6 years ago

Fixed in 5d00d51. Try pulling and running again from head.

jnisa commented 5 years ago

Anyone knows how to solve this problem for ROS Melodic in Ubuntu 18.04? My OpenCV version is 3.2. Thanks in advance

angusleigh commented 5 years ago

I thought 5d00d51 would fix it. Can you pull and try again? What's your error message? You might be able to try manually deleting this section of code to see if it's just the compiler directive not working properly? https://github.com/angusleigh/leg_tracker/blob/melodic/src/detect_leg_clusters.cpp#L213-L220