Skip to content
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

Issue in Chapter 2 #6

Open
eraserpencil opened this issue Oct 20, 2017 · 10 comments
Open

Issue in Chapter 2 #6

eraserpencil opened this issue Oct 20, 2017 · 10 comments

Comments

@eraserpencil
Copy link

eraserpencil commented Oct 20, 2017

I couldn't find centroid.h in face_tracker_pkg and this snippet of code in face_tracker_node.cpp is causing an error. #include <face_tracker_pkg/centroid.h>

Update:
Error at catkin_make after copying the packages over /home/bla/ros/src/face_tracker_pkg/src/face_tracker_node.cpp:43:39: fatal error: face_tracker_pkg/centroid.h: No such file or directory compilation terminated. face_tracker_pkg/CMakeFiles/face_tracker_node.dir/build.make:62: recipe for target 'face_tracker_pkg/CMakeFiles/face_tracker_node.dir/src/face_tracker_node.cpp.o' failed make[2]: *** [face_tracker_pkg/CMakeFiles/face_tracker_node.dir/src/face_tracker_node.cpp.o] Error 1 CMakeFiles/Makefile2:3020: recipe for target 'face_tracker_pkg/CMakeFiles/face_tracker_node.dir/all' failed make[1]: *** [face_tracker_pkg/CMakeFiles/face_tracker_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 1%] Built target dynamic_reconfigure_generate_messages_lisp Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j2 -l2" failed Please advice/correct me corrective instructions. Also, it seems copying the packages from your repo makes everything work, instead of creating the packages. Please add a side note that copying is advised.

@qboticslabs
Copy link
Owner

Hi @eraserpencil

The centroid.h is automatically generated when we do the catkin_make. But some readers are getting this issue. Is the copying of this same package is working?
I think the problem will be inside the CMakeLists.txt of the new package, you can just compare two CMakeLists.txt. There is a line for message generation, that is making the problem.

@eraserpencil
Copy link
Author

eraserpencil commented Oct 20, 2017

@qboticslabs

Are you advising to remove the message generation line? What do you mean by 'new package'?

Because creating the package as suggested earlier in the chapter had no code, I deleted that package and did the copy.

@qboticslabs
Copy link
Owner

@eraserpencil No, don't remove that line. Because centroid is a custom message, for generating a header from the custom message, we need that line.

Are you getting the above error for the package that you have copied?

@eraserpencil
Copy link
Author

@qboticslabs

Apologies, that was the error from an amateurish attempt at fixing the header file.

Please refer to updated error. Much thanks

@kungfrank
Copy link

I got same problem too. Is there any way to fix it?

@qboticslabs
Copy link
Owner

@eraserpencil @kungfrank, Sorry for the delay.

I have done a fix in the CMakeLists.txt in the repo, you can check this change

86ea76f

@kungfrank
Copy link

kungfrank commented Nov 16, 2017

In the CMakeLists.txt catkin_package() must be called after add_message_files and generate_messages in project.
But after i fixed it ,i got new error as below.

fatal error: face_tracker_pkg/centroid.h: No such file or directory
compilation terminated.

did i miss anything?

@qboticslabs
Copy link
Owner

@kungfrank @eraserpencil Actually the centroid.h is an autogenerated header, it is working in ROS Kinetic perfectly, If you are not getting, I have included my centroid.h.

Please check the following link

https://github.com/qboticslabs/ros_robotics_projects/tree/master/chapter_2_codes

@kungfrank
Copy link

Problem solve! Thanks for your help.

@d9807302
Copy link

d9807302 commented Jan 2, 2018

@eraserpencil Excuse me, i want to know how you solve the problem of "In the CMakeLists.txt catkin_package() must be called after add_message_files and generate_messages in project.
But after i fixed it ,i got new error as below."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants