pablopalafox / uav-autonomous-landing

Robust Visual-Aided Autonomous Takeoff, Tracking and Landing of a small UAV on a Moving Landing Platform for Life-Long Operation
MIT License
64 stars 23 forks source link

No such file #1

Closed andi00123456 closed 4 years ago

andi00123456 commented 4 years ago

Dear Author: Many thanks for your work.

When I was doing "cmake" to compile the project, it shows that no file named GroundtruthAltitude.h in takeoff folder. Please help me to double check it.

The full path is as follows:uav-autonomous-landing/takeoff/src/robot_state_broadcaster.cpp :::::#include <takeoff/GroundtruthAltitude.h>

Thanks

marioney commented 4 years ago

Hi, As explained on the readme the code needs to be compiled using catkin_make

Can you confirm us that you are using this command?

andi00123456 commented 4 years ago

@marioney Hi Marioney, I do use catkin_make to compile the project, this is part of ROS command. This error came from using catkin_make compiling period. I checked “takeoff” folder and no file named “GroundtruthAltitude.h”. Does this file exist in ROS pkg or somewhere else? I also read the source code “robot_state_broadcaster.cpp” and it seems that it needs pre-define data to process the data.

Thanks

pablopalafox commented 4 years ago

Hey @andi00123456, the problem was that the executable was being built before the message header (see this issue). For some reason, it had compiled correctly for us without adding

add_dependencies(robot_state_broadcaster takeoff_generate_messages_cpp)

to line 55 in takeoff/CMakeLists.txt, but now we added it and should work fine. Let us know otherwise.

andi00123456 commented 4 years ago

Hello @pablorpalafox, Thanks for your help. Your solution helps a lot. I still countered some problems and finally fixed it. I just provide here in case of other people to have the same issue.

First, using "takeoff_gencpp" works well on my computer instead of "takeoff_generate_messages_cpp". The ROS wiki community also refers to this point.

Second, use several times of "catkin_make" if compile doesn't succeed. Just as you mentioned, the executable was being built before the message header.

Third, add "add_compile_options(-std=c++11)" to all "CMakeLists.txt". When I was compiling project, it always shows some files needs C++11 features. My Ubuntu system is 16.04 LTS and in the ROS-kinetic version.

What's more, since I don't have PS3 joystick, I will develop by only using a mouse or keyboard to control ardrone. I hope this would be helpful.

Thanks a lot.

marioney commented 4 years ago

@andi00123456 thanks for your input.

@pablorpalafox maybe we should set the dependency to ${catkin_EXPORTED_TARGETS} That's actually more clear. We should also consider moving to catkin build as it handles better this type of errors