angusleigh / leg_tracker

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

Issues with Leg_Tracker on Raspberry Pi 3 on ROS Kinetic (not Indigo) #2

Closed candersen10 closed 6 years ago

candersen10 commented 7 years ago

Hello,

We are working to integrate Leg Tracker, and are running into a few issues.

We have been try to figure out what could be the reason for the catkin_make to fail on raspberry pi. Below is the error which we get when we do a catkinmake in our ROS workspace. We believe the error is because the CvRTrees object forest is not recognized as type CvRTrees. We have done the below trouble shooting:

  1. CvRTrees is a package in the openCV. We uninstalled openCV from the Raspberry Pi 3 and then reinstalled but the issue still persists.
  2. One of the errors in the log says that the variables are not declared in the scope. To address this we changed the scope of the variable but still the issue persists(We are reluctant to change the scope of the variable because the same code on another machine works fine).

Other possibilities which we can think of is that the ROS package is in indigo and we are running ROS kinetic on a Raspberry Pi 3.

Could anyone here let us know if we are missing anything or suggest any approaches to fix this issue? Below is an error log.

agr@agr-desktop:~/catkin_ws$ catkin_make Base path: /home/agr/catkin_ws Source space: /home/agr/catkin_ws/src Build space: /home/agr/catkin_ws/build Devel space: /home/agr/catkin_ws/devel Install space: /home/agr/catkin_ws/install

Running command: "make cmake_check_build_system" in "/home/agr/catkin_ws/build"

Running command: "make -j4 -l4" in "/home/agr/catkin_ws/build"

[ 0%] Built target std_msgs_generate_messages_cpp [ 0%] Built target geometry_msgs_generate_messages_cpp [ 5%] Built target sweep_node [ 5%] Built target _leg_tracker_generate_messages_check_deps_Leg [ 5%] Built target geometry_msgs_generate_messages_eus [ 5%] Built target _leg_tracker_generate_messages_check_deps_LegArray [ 5%] Built target _leg_tracker_generate_messages_check_deps_Person [ 5%] Built target std_msgs_generate_messages_eus [ 5%] Built target _leg_tracker_generate_messages_check_deps_PersonArray [ 5%] Built target std_msgs_generate_messages_nodejs [ 5%] Built target geometry_msgs_generate_messages_nodejs [ 5%] Built target geometry_msgs_generate_messages_py [ 5%] Built target std_msgs_generate_messages_py [ 5%] Built target geometry_msgs_generate_messages_lisp [ 5%] Built target std_msgs_generate_messages_lisp [ 15%] Built target leg_tracker_generate_messages_cpp [ 26%] Built target leg_tracker_generate_messages_nodejs [ 39%] Built target leg_tracker_generate_messages_py [ 50%] Built target leg_tracker_generate_messages_lisp [ 50%] Built target leg_tracker_gencpp [ 63%] Built target leg_tracker_generate_messages_eus [ 71%] Built target extract_positive_training_clusters [ 78%] Built target local_occupancy_grid_mapping [ 81%] Building CXX object leg_tracker/CMakeFiles/train_leg_detector.dir/src/train_leg_detector.cpp.o [ 84%] Building CXX object leg_tracker/CMakeFiles/detect_leg_clusters.dir/src/detect_leg_clusters.cpp.o [ 84%] Built target leg_tracker_generate_messages /home/agr/catkin_ws/src/leg_tracker/src/train_legdetector.cpp:294:3: error: ‘CvRTrees’ does not name a type CvRTrees forest; ^ /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp: In member function ‘void TrainLegDetector::train()’: /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp:188:34: error: ‘CV_VAR_ORDERED’ was not declared in this scope cvSet( var_type, cvScalarAll(CV_VAR_ORDERED)); ^ /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp:189:41: error: ‘CV_VAR_CATEGORICAL’ was not declared in this scope cvSetReal1D( var_type, featcount, CV_VAR_CATEGORICAL ); ^ /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp:196:5: error: ‘CvRTParams’ was not declared in this scope CvRTParams fparam( ^ /home/agr/catkin_ws/src/leg_tracker/src/train_legdetector.cpp:210:5: error: ‘forest’ was not declared in this scope forest_.train( ^ /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp:212:7: error: ‘CV_ROW_SAMPLE’ was not declared in this scope CV_ROW_SAMPLE, // tflag ^ /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp:218:7: error: ‘fparam’ was not declared in this scope fparam // parameters ^ /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp: In member function ‘void TrainLegDetector::test(bool)’: /home/agr/catkin_ws/src/leg_tracker/src/train_legdetector.cpp:260:11: error: ‘forest’ was not declared in this scope if (forest_.predict( tmp_mat) > 0) ^ /home/agr/catkin_ws/src/leg_tracker/src/train_legdetector.cpp:271:11: error: ‘forest’ was not declared in this scope if (forest_.predict( tmp_mat ) < 0) ^ /home/agr/catkin_ws/src/leg_tracker/src/train_leg_detector.cpp: In member function ‘void TrainLegDetector::save()’: /home/agr/catkin_ws/src/leg_tracker/src/train_legdetector.cpp:289:5: error: ‘forest’ was not declared in this scope forest_.save(savefile.c_str()); ^ leg_tracker/CMakeFiles/train_leg_detector.dir/build.make:62: recipe for target 'leg_tracker/CMakeFiles/train_leg_detector.dir/src/train_leg_detector.cpp.o' failed make[2]: [leg_tracker/CMakeFiles/train_leg_detector.dir/src/train_leg_detector.cpp.o] Error 1 CMakeFiles/Makefile2:1431: recipe for target 'leg_tracker/CMakeFiles/train_leg_detector.dir/all' failed make[1]: [leg_tracker/CMakeFiles/train_leg_detector.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... /home/agr/catkin_ws/src/leg_tracker/src/detect_leg_clusters.cpp:112:3: error: ‘CvRTrees’ does not name a type CvRTrees forest; ^ /home/agr/catkin_ws/src/leg_tracker/src/detect_leg_clusters.cpp: In constructor ‘DetectLegClusters::DetectLegClusters()’: /home/agr/catkin_ws/src/leg_tracker/src/detect_leg_clusters.cpp:98:5: error: ‘forest’ was not declared in this scope forest.load(forest_file.c_str()); ^ /home/agr/catkin_ws/src/leg_tracker/src/detect_leg_clusters.cpp: In member function ‘void DetectLegClusters::laserCallback(const ConstPtr&)’: /home/agr/catkin_ws/src/leg_tracker/src/detect_leg_clusters.cpp:208:38: error: ‘forest’ was not declared in this scope float probability_of_leg = forest.predict_prob(tmp_mat); ^ leg_tracker/CMakeFiles/detect_leg_clusters.dir/build.make:62: recipe for target 'leg_tracker/CMakeFiles/detect_leg_clusters.dir/src/detect_leg_clusters.cpp.o' failed make[2]: [leg_tracker/CMakeFiles/detect_leg_clusters.dir/src/detect_leg_clusters.cpp.o] Error 1 CMakeFiles/Makefile2:1545: recipe for target 'leg_tracker/CMakeFiles/detect_leg_clusters.dir/all' failed make[1]: [leg_tracker/CMakeFiles/detect_leg_clusters.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j4 -l4" failed

mikaelarguedas commented 7 years ago

Kinetic is using openCV 3.1. Having a quick look at openCV migration documentation it looks like the type CvRTrees is now named cv::ml::RTrees. For future questions, please open an issue (like you did here) or ask on answers.ros.org but please do not write emails to ros-buildfarm-* mailing lists.

candersen10 commented 7 years ago

Mikaelarguedas, thank you for the reply.

We changed the code and then did catkin-make but still get same error as before. We are searching for a way to link opencv2.4 version to ros kinetic see if that would fix. Any suggestions?

Thanks!

candersen10 commented 7 years ago

Has anyone had any luck migrating this code to Open CV 3.1 to get it to run on ROS Kinetic? Or any suggestions on how to do this quickly?

tejaswid commented 7 years ago

Yes, OpenCV3 seems to be the problem. Ros Kinetic by default uses OpenCV3.

@candersen10 Yes, there is a way to use opencv 2.4 with ros kinetic. Please take a look at the ros packages opencv2_catkin. (You might also need catkin_simple to get opencv_catkin running)

If you download it into the src folder of your workspace and run catkin_make, you get a local version of opencv inside your workspace.

To use it you have to add opencv2_catkin to the find_package(catkin .......) command in the CMakeLists.txt of the leg_tracker package and also add opencv2_catkin as a build and run rependency in the package.xml file.

I can confirm that the leg_tracker package builds with Opencv 2.4.13 (installed using opencv2_catkin) and Ros Kinetic on Ubuntu 16.04.

angusleigh commented 6 years ago

FYI, I think this should be resolved since ewerlopes migrated the repo to OpenCV3.