Hi,
I have a package in my workspace that uses openCV and cv_bridge. I needed the cuda module of openCV, but it doesn't exist in the default openCV of ROS. I installed another version of openCV that included the cuda modules, I tried to link my workspace and my package to the new openCV and I had lots of errors like "undefined reference to 'cv_bridge::...' ", "undefined reference to 'ros::init::...' ", "undefined reference to 'rosbag::...' ". I tried to solve the problems but I wasn't able, so I tried to return to the default openCV (it worked fine with my package before I tried to use cuda, etc.), but it gives the same errors now. I have uninstalled and reinstalled ROS, deleted my workspace and the package and I have created them again, but I have the same errors. I have all the dependencies in the CMakeLists.txt.
These are some of the errors:
undefined reference to 'cv_bridge::toCvCopy(boost::shared_ptr> const> const&, std::string const&)'
undefined reference to 'ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
undefined reference to 'ros::init(int&, char**, std::string const&, unsigned int)'
undefined reference to 'ros::NodeHandle::NodeHandle(std::string const&, std::map, std::allocator>> const&)'
undefined reference to 'rosbag::Bag::open(std::string const&, unsigned int)'
undefined reference to 'rosbag::TypeQuery::TypeQuery(std::string const&)'
undefined reference to 'rosbag::MessageInstance::getTopic() const'
undefined reference to 'pcl_ros::transformPointCloud(std::string const&, sensor_msgs::PointCloud2_> const&, sensor_msgs::PointCloud2_>&, tf::TransformListener const&)'
undefined reference to 'pcl::PCDWriter::writeBinary(std::string const&, pcl::PCLPointCloud2 const&, Eigen::Matrix const&, Eigen::Quaternion const&)'
undefined reference to 'pcl::PCDWriter::writeASCII(std::string const&, pcl::PCLPointCloud2 const&, Eigen::Matrix const&, Eigen::Quaternion const&, int)'
undefined reference to 'rosbag::MessageInstance::getMD5Sum() const'
undefined reference to 'rosbag::Bag::readField(std::map, std::allocator>> const&, std::string const&, bool, std::string&) const'
undefined reference to 'rosbag::Bag::readField(std::map, std::allocator>> const&, std::string const&, bool, std::string&) const'
I don't know if trying to use the new openCV I have changed something in my CMakeLists.txt or package.xml, so I add them here.
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(b_c_f)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
pcl_conversions
pcl_msgs
pcl_ros
rosbag
roscpp
sensor_msgs
tf
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES b_c_f
# CATKIN_DEPENDS cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
include/b_c_f
src/log
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
add_executable(bag_to_pcd
src/BagCameraFiltering.cpp
src/Blob.cpp
src/timing-helper.cpp
src/Tracker.cpp
src/Vehicle.cpp
src/log/Logger.cpp
src/log/LogItem.cpp
src/log/Log.cpp
src/log/Thread.cpp
#include/bag_camera_filtering/Vehicle.h
)
## Specify libraries to link a library or executable target against
target_link_libraries(bag_to_pcd
${catkin_LIBRARIES}
${OpenCV_LIBS}
${PCL_LIBRARIES}
)
package.xml:
b_c_f 0.0.0 The b_c_f package portico TODO catkin cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf cv_bridge pcl_conversions pcl_msgs pcl_ros rosbag roscpp sensor_msgs tf
I don't know anything about how the bash or bashrc should be so the problem could be there too.
Pd: I cloned the cv_bridge from github as another package in my catkin_ws but that didn't solve anything.
Please, I need help!
↧