szebedy / autonomous-drone

This repository intends to enable autonomous drone delivery with the Intel Aero RTF drone and PX4 autopilot. The code can be executed both on the real drone or simulated on a PC using Gazebo. Its core is a robot operating system (ROS) node, which communicates with the PX4 autopilot through mavros. It uses SVO 2.0 for visual odometry, WhyCon for visual marker localization and Ewok for trajectoy planning with collision avoidance.
167 stars 73 forks source link

Suggestions on compiling usb_cam #17

Closed hibetterheyj closed 3 years ago

hibetterheyj commented 3 years ago

When compiling usb_cam, I have encountered the following problem:

ld: error: /home/he/catkin_ws/devel/.private/usb_cam/lib/libusb_cam.so: undefined reference to av_frame_alloc
ld: error: /home/he/catkin_ws/devel/.private/usb_cam/lib/libusb_cam.so: undefined reference to av_free
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/home/he/catkin_ws/devel/.private/usb_cam/lib/usb_cam/usb_cam_node] Error 1
make[1]: *** [CMakeFiles/usb_cam_node.dir/all] Error 2
make: *** [all] Error 2
cd /home/he/catkin_ws/build/usb_cam; catkin build --get-env usb_cam | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -

After checking related issues on ros_driver/usb_cam, I still get stuck on it. Therefore, I would like to seek advice from you. Thanks in advance!

hibetterheyj commented 3 years ago

Finally, I fixed the problem by adding set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} -Wall -g -lavcodec") in CMakeLists.txt. Sorry for bothering