Hello,
I'm trying to cross compile my project for my raspberry Pi 3 without success, I'm using Ubuntu 16.04 LTS . I have the following warning (which leads to an error) :
CMake Warning at kobuki/yocs_velocity_smoother/CMakeLists.txt.20 (add_library):
Cannot generate a safe linker search path for target
yocs_velocity_smoother_nodelet because files in some directories may
conflict with libraries in implicit directories:
link library [libpthread.so] in /usr/arm-linux-gnueabihf/lib may be hidden by files in:
/usr/lib/x86_64-linux-gnu
Some of these libraries may not be found correctly
I have this Warning for all my packages and with `libdl.so` and `librt.so` too, it's generating those kind of errors :
/opt/ros/kinetic/lib/libnodeletlib.so: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
Here's my `rostoolchain.cmake` :
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabihf)
set(CMAKE_LIBRARY_PATH
/usr/arm-linux-gnueabihf/
/usr/arm-linux-gnueabihf/lib)
set(LD_LIBRARY_PATH ${LD_LIBRARY_PATH}
/usr/arm-linux-gnueabihf/
/usr/arm-linux-gnueabihf/lib)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
I can't manage to tell CMake to look only for the libraries in `usr/arm-linux-gnueabihf/lib` instead of `/usr/lib/x86_64-linux-gnu`, which variables need to be set to do that ? Or is my `rostoolchain.cmake` incomplete/wrong ?
Thank you in advance
↧
Libraries issues when cross compiling for ARM
↧
Check ROS Version in CMake File with Catkin
Is there a way to check the version of ROS being used in the CMakeLists.txt file? i.e., are there any variables or macros to query the version?
↧
↧
How to cross compile for Raspberry Pi 3 ?
Hello,
Compiling my project directly on my raspberry has a high failure rate so I thought the cross compilation was a good option to avoid that. But it appears to be more difficult than I thought and there are not that much tutorials on the internet about this topic.
Can somebody help me figure it out by describing how to proceed step by step not to miss anything ?
**Here's what I did :** ([this answer](https://stackoverflow.com/questions/19162072/how-to-install-the-raspberry-pi-cross-compiler-on-my-linux-host-machine) from stackoverflow helped me a lot)
1) Install the compiler for the raspberry on my computer (running Ubuntu 16.04) -> for my raspberry it's `arm-linux-gnueabihf`
2) Create a `rostoolchain.cmake` file :
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#avoid RT_LIBRARY-NOT-FOUND issue
set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)
#set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(LD_LIBRARY_PATH ${LD_LIBRARY_PATH}
$ENV{HOME}/raspberrypi/devel/lib)
set(PKG_CONFIG_PATH ${PKG_CONFIG_PATH}
$ENV{HOME}/raspberrypi/devel/lib/pkgconfig)
# specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_FIND_ROOT_PATH $ENV{HOME}/raspberrypi/rootfs)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_LIBRARY_PATH
$ENV{HOME}/raspberrypi/rootfs)
# Set compiler flag
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${CMAKE_FIND_ROOT_PATH}")
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${CMAKE_FIND_ROOT_PATH}" )
3) Create a catkin profile to cross compile :
Profile: cross
Extending: [explicit] /opt/ros/kinetic
Workspace: /home/robotics/raspberrypi
-------------------------------------------------------------------------------------------------------------------------
Source Space: [exists] /home/robotics/raspberrypi/src
Log Space: [exists] /home/robotics/raspberrypi/logs
Build Space: [exists] /home/robotics/raspberrypi/build
Devel Space: [exists] /home/robotics/raspberrypi/devel
Install Space: [unused] /home/robotics/raspberrypi/install
DESTDIR: [unused] None
-------------------------------------------------------------------------------------------------------------------------
Devel Space Layout: linked
Install Space Layout: None
-------------------------------------------------------------------------------------------------------------------------
Additional CMake Args: -DBUILD_SHARED_LIBS=Off -DCMAKE_TOOLCHAIN_FILE=/home/robotics/raspberrypi/rostoolchain.cmake
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
-------------------------------------------------------------------------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
4) Finally, run `catkin build` but it generates this warning (I display for only one package) :
Warnings << tile_manager:cmake /home/robotics/raspberrypi/logs/tile_manager/build.cmake.001.log
CMake Warning at /home/robotics/raspberrypi/src/tile_manager/CMakeLists.txt:79 (add_executable):
Cannot generate a safe linker search path for target tile_marker_node
because there is a cycle in the constraint graph:
dir 0 is [/home/robotics/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf]
dir 1 must precede it due to link library [libpthread.so]
dir 1 is [/usr/lib/x86_64-linux-gnu]
dir 0 must precede it due to link library [libpthread.so]
Some of these libraries may not be found correctly.
Leading to this error :
Errors << tile_manager:make /home/robotics/raspberrypi/logs/tile_manager/build.make.002.log
/opt/ros/kinetic/lib/libtf.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
It seems that there is a conflict with the paths `/usr/lib/x86_64-linux-gnu`, `/home/robotics/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf` and I have other warnings with `/opt/ros/kinetic/lib` too but I can't find which variable is defining those paths (I think I should only have `/home/robotics/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf` )
Am I missing something here or is it possible that the issues come from my `CMakeLists.txt` files ?
Any insight would be greatly appreciated.
↧
Automatically run tests on ROS build farm for pure cmake project
I'm hosting a [pure cmake project ](http://wiki.ros.org/ifopt)(not dependent on catkin) on the ROS build farm, for which I generate some unit test in my *CMakeLists.txt* similar to:
find_package(GTest)
add_executable(test my_test.cpp)
target_link_libraries(test ${GTEST_BOTH_LIBRARIES} pthread)
add_test(test test)
I can run these with `make test` after a non-catkin build, this works fine.
**How can I tell the ROS build farm (which seems to be internally calling `catkin_make run_tests`) to run that gtest binary as well after building?** [(jenkins-log)](http://build.ros.org/view/Kdev/job/Kdev__ifopt__ubuntu_xenial_amd64/)
I don't want to *catkinize* my project, which would allow me to use `catkin_add_gtest`. I want to keep allowing the ` cd build && cmake ..` pure cmake build for users that don't have catkin installed.
Any help would be greatly appreciated.
↧
Migrating a custom library package used outside of ROS
Hi all,
We have a custom ROS package which exposes ROS services to the outside world (so as to let the app we are developing call ROS services). The ROS package and app used to work fine under indigo (Ubuntu 14.04), now we are migrating to kinetic (Ubuntu 16.04) and it did not work straight away: the compiler cannot find the `#include "ros/ros.h"` and `#include `. It turns out that we had to add the following lines to our app's `CMakeLists.txt` in order to have the app compile:
include_directories( /opt/ros/kinetic/include )
link_directories( /opt/ros/kinetic/lib )
which is ugly and problably not the intended way.
Has anything changed in kinetic regarding the external use of ROS? We did not find much about this in the migration guides (link [here](http://wiki.ros.org/kinetic/Migration) and [here](http://wiki.ros.org/jade/Migration)). What should we actually do, rather than the CMake include and link instructions above? Anyone knows more about the problem?
As a reference, here are the `CMakeLists.txt` and `package.xml` files of the ROS package:
**package.xml:**
lc_toolkitLink 0.0.1 Tools for linking the toolkit with ROS. Antoine Rennuit Antoine Rennuit Proprietary catkin roscpp std_msgs geometry_msgs lc_control
**CMakeLists.txt:**
cmake_minimum_required(VERSION 2.8.3)
project(lc_toolkitLink)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
################################################################################
# Find packages.
# Eigen.
# NOTE: for reasons we do not understand it is not possible to set
# CMAKE_MODULE_PATH as a relative path (although we do it in the toolkit)
# hence we use function get_filename_component() to transform the relative
# path to an absolute path.
get_filename_component(LC_CMAKE_FOLDER_PATH "../../../../CMake" ABSOLUTE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LC_CMAKE_FOLDER_PATH})
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ../../../../../Dependencies/Eigen/v3.2.0)
find_package(Eigen3 REQUIRED)
# Catkin.
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs geometry_msgs lc_control)
################################################################################
catkin_package(
INCLUDE_DIRS .
LIBRARIES lc_toolkitLink
CATKIN_DEPENDS roscpp std_msgs geometry_msgs lc_control
)
################################################################################
# Headers.
include_directories(
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
../../../../ # This path is used to find headers from [Core] and [System].
)
################################################################################
# Dependencies.
#add_subdirectory(../../../../Core ../../Core)
################################################################################
# Binaries.
add_library(
lc_toolkitLink
src/RosBase.h
src/RosBase.cpp
src/RosFrameSubscriber.h
src/RosFrameSubscriber.cpp
src/RosServices.h
src/RosServices.cpp
)
add_dependencies(lc_toolkitLink ${catkin_EXPORTED_TARGETS})
target_link_libraries(lc_toolkitLink
${catkin_LIBRARIES}
Core)
################################################################################
# Install.
install(TARGETS lc_toolkitLink DESTINATION lib)
and both CMakeLists.txt of the app:
**Top level CMakeLists.txt:**
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
cmake_policy(SET CMP0015 NEW)
# Projet.
project(ToolKit)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#SET( CMAKE_BUILD_TYPE Debug )
find_package(catkin REQUIRED COMPONENTS rtt_ros)
set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed.
set(CMAKE_PREFIX_PATH ../Dependencies/Qt/v5.9.1/5.9.1/gcc_64)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5Qml REQUIRED)
find_package(Qt5QuickControls2 REQUIRED)
#include_directories( /opt/ros/kinetic/include )
#link_directories( /opt/ros/kinetic/lib )
# Find dependencies.
set(CMAKE_MODULE_PATH ../src/CMake)
find_package(Eigen3 REQUIRED)
set(CMAKE_PREFIX_PATH ../Dependencies/pcl/v1.8.1)
find_package(PCL 1.7 REQUIRED COMPONENTS common io filters)
set(CMAKE_PREFIX_PATH ../Dependencies/gtest/v0a439623)
find_package(GTest REQUIRED)
set(CMAKE_PREFIX_PATH ../Dependencies/OpenSceneGraph/v3.4.1)
find_package(OpenSceneGraph 3.4.1 REQUIRED
osg
osgGA
osgDB
osgUtil
osgText
osgViewer
OpenThreads
)
set(QT_DIR ../../Dependencies/Qt/v5.9.1/5.9.1/gcc_64) #TODO: use find_package() for all dependencies.
set(STEPCODE_INSTALL_DIR ../../Dependencies/sc-install)
# Add subfolders.
add_subdirectory(Core)
add_subdirectory(System)
add_subdirectory(DataModel)
add_subdirectory(SceneGraph)
add_subdirectory(TkRenderer)
add_subdirectory(UnitTests)
add_subdirectory(ToolKitApp)
#add_subdirectory(Importer)
**Lower level CMakeLists.txt:**
project(SceneGraph)
# List sources.
set(${PROJECT_NAME}_headers
RosFrameSubscriberNode.h
)
set(${PROJECT_NAME}_sources
...
RosFrameSubscriberNode.cpp
...
)
# Headers.
include_directories(
../ ${EIGEN3_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
../catkin_ws/src/le_painters_companion/lc_toolkitLink/src)
# Link.
link_directories(
${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
find_library(LC_TOOLKIT_LINK NAMES "lc_toolkitLink" PATHS ../catkin_ws/install/lib)
if (${LC_TOOLKIT_LINK})
message(FATAL_ERROR "COULD NOT find library lc_toolkitLink")
endif()
# Output library.
add_library(${PROJECT_NAME} STATIC ${${PROJECT_NAME}_headers} ${${PROJECT_NAME}_sources})
# Linker.
target_link_libraries(${PROJECT_NAME}
DataModel
${PCL_COMMON_LIBRARIES}
${PCL_IO_LIBRARIES}
${LC_TOOLKIT_LINK})
Kind regards,
Olof and Antoine.
↧
↧
How can I generate pkg-config files for my package?
I have a Catkin package that generates several binaries and libraries, but unlike some other packages, pkg-config can't find them.
ROS seems to have set the path to both my Kinetic installation, as well as my workspace.
echo $PKG_CONFIG_PATH
somelocation/workspace/devel/lib/pkgconfig:somelocation/ros_catkin_ws/install_isolated/lib/pkgconfig
When I ask ` pkg-config --list-all` about it, it does know about all of the ROS libraries, and also about things I installed in my own workspace, like `joy` and `uuid`. But it does not find the libraries I wrote myself.
I went over to the `CMakeLists.txt` of `joy` to see if I could find anything obvious that has to be done to generate the correct files, but can't see anything. There is no `.pc` file in the repo either. I also tried to google around, but all results are about using external packages inside ROS, not about using ROS package outside it.
Currently I'm just doing this, but that apparently does not get you any `pkg-config` files.
add_library(Skill
$
$
$
$
$
)
add_dependencies(Skill
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
When I run this, there is no output
$ pkg-config --list-all | grep -i skill
So what is the correct way to tell `pkg-config` about my library, just like `joy` and `uuid`?
↧
How to catkin_make_isolated a non-catkin package when CMakeLists.txt not in pkg root
Hi,
We'd like to make our projects self-contained, so we are adding all possible (external) packages to our GIT repo as submodule, and build our project with `catkin_make_isolated`. This works with Ceres, Google Cartographer, etc., but does not seem to be working with some other module.
I added it as submodule, but the problem (apart from the missing `package.xml`, which I created) is that the `CMakeLists.txt` file is in a `cmake/` directory, not in the package root. It looks like `catkin_make_isolated` fails to find the `cmake/CMakeLists.txt` file.
Moving or symlinking does not work, as the file uses other files in the `cmake/` directory.
Is there a way to force catkin to look for `CMakeLists.txt` in `cmake/`?
Thanks.
↧
Correctly linking local OpenCV library in ROS as TesseractOCR is not found in ROS OpenCV library
I'm doing an OpenCV project to identify signs for hazardous substances. I also have to be able identify the UN numbers, for that I'm using TesseractOCR. My problem is that when working in gedit without ROS Tesseract works fine, but in ROS (kinetic) after I launch the program and run it (no compilation errors) i get the following error in the command line:
OCRTesseract(00): Tesseract not found.
Strangely enough all the other OpenCV functions are found and work. As TesseractOCR is in the ocr.hpp, it should find Tesseract once the local OpenCV library is linked correctly, which it isn't.
I have already read this [answer](https://answers.ros.org/question/264140/add-local-opencv-to-path/) and also tried to link to the local OpenCV library (/usr/local/include/opencv2) as explained in the answer. I changed CMakeLists.txt and also CMakeCache.txt. This is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(ELROB_2018)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
image_transport
roscpp
sensor_msgs
std_msgs
)
find_package(OpenCV REQUIRED
NO_MODULE #Should be optional, tells CMake to use config mode
PATHS /usr/local # Tells CMake to look here
NO_DEFAULT_PATH #and don't look anywhere else
)
find_package( PkgConfig REQUIRED)
catkin_package(CATKIN_DEPENDS sensor_msgs
DEPENDS OpenCV
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)
include_directories(
# include
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
#set(OpenCV_INCLUDE_DIRS /usr/local/include/opencv2)
#set(OpenCV_LIBS /usr/local/lib/libopencv_core.so)
#${Tesseract_INCLUDE_DIRS}
)
add_executable(ELROB_2018_node src/main.cpp src/image_processing1.cpp src/checklist1.cpp src/checklist2.cpp)
add_dependencies(ELROB_2018_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(ELROB_2018_node ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
#target_link_libraries( ELROB_2018_node ${OpenCV_LIBS} )
#target_link_libraries(ELROB_2018_node ${catkin_LIBRARIES} )
target_link_libraries(ELROB_2018_node lept tesseract)
I have tried changing CMakeCache.txt to /usr/local/include/opencv2, but it always changes back to this after catkin_make:
//The directory containing a CMake configuration file for OpenCV.
OpenCV_DIR:PATH=/opt/ros/kinetic/share/OpenCV-3.3.1
Now I'm not quite sure what to do next as Tesseract is still not found when when I roslaunch my node and run my program. As mentioned strangely enough all of the other OpenCV functions work.
↧
Compilation Wall of Errors Seemingly Unrelated to .cpp
Hi guys,
I've been writing a ROS publisher/subscriber node in C++ on ROS kinetic using a Navio2 board. When I attempt to compile, I don't get any syntax errors, but instead get a wall of errors involving dependencies, serializations, and whatnot:
----------
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `imuCallback(boost::shared_ptr> const> const&)':
roscomm.cpp:(.text+0x868): undefined reference to `ros::NodeHandle::NodeHandle(std::__cxx11::basic_string, std::allocator> const&, std::map, std::allocator>, std::__cxx11::basic_string, std::allocator>, std::less, st$
::allocator>>, std::allocator, std::allocator> const, std::__cxx11::basic_string, std::alloca$
or>>>> const&)'
roscomm.cpp:(.text+0x8e4): undefined reference to `ros::Rate::Rate(double)'
roscomm.cpp:(.text+0x978): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text+0x9c4): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, $
os::console::levels::Level)'
roscomm.cpp:(.text+0xa08): undefined reference to `ros::console::setLogLocationLevel(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text+0xa10): undefined reference to `ros::console::checkLogLocationEnabled(ros::console::LogLocation*)'
roscomm.cpp:(.text+0xa78): undefined reference to `ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text+0xa90): undefined reference to `ros::spinOnce()'
roscomm.cpp:(.text+0xac0): undefined reference to `ros::Publisher::~Publisher()'
roscomm.cpp:(.text+0xacc): undefined reference to `ros::NodeHandle::~NodeHandle()'
roscomm.cpp:(.text+0xc08): undefined reference to `ros::Publisher::~Publisher()'
roscomm.cpp:(.text+0xc14): undefined reference to `ros::NodeHandle::~NodeHandle()'
roscomm.cpp:(.text+0xcf0): undefined reference to `ros::console::g_initialized'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `main':
roscomm.cpp:(.text+0xd54): undefined reference to `ros::init(int&, char**, std::__cxx11::basic_string, std::allocator> const&, unsigned int)'
roscomm.cpp:(.text+0xd98): undefined reference to `ros::NodeHandle::NodeHandle(std::__cxx11::basic_string, std::allocator> const&, std::map, std::allocator>, std::__cxx11::basic_string, std::allocator>, std::less, st$
::allocator>>, std::allocator, std::allocator> const, std::__cxx11::basic_string, std::alloca$
or>>>> const&)'
roscomm.cpp:(.text+0xe3c): undefined reference to `ros::spin()'
roscomm.cpp:(.text+0xe4c): undefined reference to `ros::Subscriber::~Subscriber()'
roscomm.cpp:(.text+0xe58): undefined reference to `ros::NodeHandle::~NodeHandle()'
roscomm.cpp:(.text+0xed4): undefined reference to `ros::Subscriber::~Subscriber()'
roscomm.cpp:(.text+0xee0): undefined reference to `ros::NodeHandle::~NodeHandle()'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
roscomm.cpp:(.text+0xf48): undefined reference to `boost::system::generic_category()'
roscomm.cpp:(.text+0xf58): undefined reference to `boost::system::generic_category()'
roscomm.cpp:(.text+0xf68): undefined reference to `boost::system::system_category()'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `ros::Publisher ros::NodeHandle::advertise>>(std::__cxx11::basic_string, std::a$
locator> const&, unsigned int, bool)':
roscomm.cpp:(.text._ZN3ros10NodeHandle9advertiseIN8std_msgs7String_ISaIvEEEEENS_9PublisherERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjb[_ZN3ros10NodeHandle9advertiseIN8std_msgs7String_ISaIvEE$
EENS_9PublisherERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjb]+0x90): undefined reference to `ros::NodeHandle::advertise(ros::AdvertiseOptions&)'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `void ros::Publisher::publish>>(std_msgs::String_> const&) const':
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x44): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x90): undefined reference to `ros::console::initializeLogLoca
tion(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xd4): undefined reference to `ros::console::setLogLocationLev
el(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xdc): undefined reference to `ros::console::checkLogLocationE
nabled(ros::console::LogLocation*)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x140): undefined reference to `ros::console::print(ros::conso
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x15c): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x1a8): undefined reference to `ros::console::initializeLogLoc
ation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x1ec): undefined reference to `ros::console::setLogLocationLe
vel(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x1f4): undefined reference to `ros::console::checkLogLocation
Enabled(ros::console::LogLocation*)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x240): undefined reference to `ros::console::print(ros::conso
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x25c): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x2a8): undefined reference to `ros::console::initializeLogLoc
ation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x2ec): undefined reference to `ros::console::setLogLocationLe
vel(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x2f4): undefined reference to `ros::console::checkLogLocation
Enabled(ros::console::LogLocation*)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x340): undefined reference to `ros::console::print(ros::conso
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x35c): undefined reference to `ros::Publisher::Impl::isValid(
) const'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x38c): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x3d8): undefined reference to `ros::console::initializeLogLoc
ation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x41c): undefined reference to `ros::console::setLogLocationLe
vel(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x424): undefined reference to `ros::console::checkLogLocation
Enabled(ros::console::LogLocation*)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x488): undefined reference to `ros::console::print(ros::conso
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x4a4): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x4f0): undefined reference to `ros::console::initializeLogLoc
ation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x534): undefined reference to `ros::console::setLogLocationLe
vel(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x53c): undefined reference to `ros::console::checkLogLocation
Enabled(ros::console::LogLocation*)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x5b0): undefined reference to `ros::console::print(ros::conso
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x5cc): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x618): undefined reference to `ros::console::initializeLogLoc
ation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x65c): undefined reference to `ros::console::setLogLocationLe
vel(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x664): undefined reference to `ros::console::checkLogLocation
Enabled(ros::console::LogLocation*)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x8e0): undefined reference to `ros::console::print(ros::conso
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)' roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x8fc): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x948): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x98c): undefined reference to `ros::console::setLogLocationL$
vel(ros::console::LogLocation*, ros::console::levels::Level)' roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0x994): undefined reference to `ros::console::checkLogLocatio$
Enabled(ros::console::LogLocation*)' roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xa50): undefined reference to `ros::console::print(ros::cons$
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)' roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xa6c): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xab8): undefined reference to `ros::console::initializeLogLo$
ation(ros::console::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)' roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xafc): undefined reference to `ros::console::setLogLocationL$
vel(ros::console::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xb04): undefined reference to `ros::console::checkLogLocatio$
Enabled(ros::console::LogLocation*)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xb50): undefined reference to `ros::console::print(ros::cons$
le::FilterBase*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xbe0): undefined reference to `ros::Publisher::publish(boost$
:function const&, ros::SerializedMessage&) const'
roscomm.cpp:(.text._ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_[_ZNK3ros9Publisher7publishIN8std_msgs7String_ISaIvEEEEEvRKT_]+0xd80): undefined reference to `ros::console::g_initialized'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `ros::Subscriber ros::NodeHandle::subscribe>>(std::__cxx11::basic_string, std::a
llocator> const&, unsigned int, void (*)(boost::shared_ptr> const> const&), ros::TransportHints const&)':
roscomm.cpp:(.text._ZN3ros10NodeHandle9subscribeIN11sensor_msgs4Imu_ISaIvEEEEENS_10SubscriberERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjPFvRKN5boost10shared_ptrIKT_EEERKNS_14TransportHintsE[_
ZN3ros10NodeHandle9subscribeIN11sensor_msgs4Imu_ISaIvEEEEENS_10SubscriberERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjPFvRKN5boost10shared_ptrIKT_EEERKNS_14TransportHintsE]+0xac): undefined ref
erence to `ros::NodeHandle::subscribe(ros::SubscribeOptions&)'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `void ros::serialization::Serializer::write(ros::serialization::OStream&, unsigned int)':
roscomm.cpp:(.text._ZN3ros13serialization10SerializerIjE5writeINS0_7OStreamEEEvRT_j[_ZN3ros13serialization10SerializerIjE5writeINS0_7OStreamEEEvRT_j]+0x60): undefined reference to `ros::serialization::th$
owStreamOverrun()'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `void ros::serialization::Serializer, std::allocator>>::write(ros::serialization::OStream&, std::__cxx11::basic_string, std::allocator> const&)':
roscomm.cpp:(.text._ZN3ros13serialization10SerializerINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5writeINS0_7OStreamEEEvRT_RKS7_[_ZN3ros13serialization10SerializerINSt7__cxx1112basic_stringIcSt$
1char_traitsIcESaIcEEEE5writeINS0_7OStreamEEEvRT_RKS7_]+0x98): undefined reference to `ros::serialization::throwStreamOverrun()'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `ros::SubscriptionCallbackHelperT> const> const&, void>::deserialize(ros::SubscriptionCallb$
ckHelperDeserializeParams const&)':
roscomm.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallba$
kHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x60): undefined reference to `ros::console::initialize()'
roscomm.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallba$
kHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0xac): undefined reference to `ros::console::initializeLogLocation(ros::c$
nsole::LogLocation*, std::__cxx11::basic_string, std::allocator> const&, ros::console::levels::Level)'
roscomm.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallba$
kHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0xf0): undefined reference to `ros::console::setLogLocationLevel(ros::con$
ole::LogLocation*, ros::console::levels::Level)'
roscomm.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallba$
kHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0xf8): undefined reference to `ros::console::checkLogLocationEnabled(ros:$
console::LogLocation*)'
roscomm.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbac
kHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x178): undefined reference to `ros::console::print(ros::console::FilterBa
se*, void*, ros::console::levels::Level, char const*, int, char const*, char const*, ...)'
roscomm.cpp:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbac
kHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x288): undefined reference to `ros::console::g_initialized'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `void ros::serialization::ArraySerializer::read(ros::serialization::IStream&, boost::array&
)':
roscomm.cpp:(.text._ZN3ros13serialization15ArraySerializerIdLj9EvE4readINS0_7IStreamEEEvRT_RN5boost5arrayIdLj9EEE[_ZN3ros13serialization15ArraySerializerIdLj9EvE4readINS0_7IStreamEEEvRT_RN5boost5arrayIdLj
9EEE]+0x74): undefined reference to `ros::serialization::throwStreamOverrun()'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `void ros::serialization::Serializer::read(ros::serialization::IStream&, unsigned int&)':
roscomm.cpp:(.text._ZN3ros13serialization10SerializerIjE4readINS0_7IStreamEEEvRT_Rj[_ZN3ros13serialization10SerializerIjE4readINS0_7IStreamEEEvRT_Rj]+0x60): undefined reference to `ros::serialization::thr
owStreamOverrun()'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `void ros::serialization::Serializer, std::allocator>>::read(ros::serialization::IStream&, std::__cxx11::basic_string, std::allocator>&)':
roscomm.cpp:(.text._ZN3ros13serialization10SerializerINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE4readINS0_7IStreamEEEvRT_RS7_[_ZN3ros13serialization10SerializerINSt7__cxx1112basic_stringIcSt11c
har_traitsIcESaIcEEEE4readINS0_7IStreamEEEvRT_RS7_]+0x84): undefined reference to `ros::serialization::throwStreamOverrun()'
CMakeFiles/roscomm.dir/src/roscomm.cpp.o: In function `void ros::serialization::Serializer::read(ros::serialization::IStream&, double&)':
roscomm.cpp:(.text._ZN3ros13serialization10SerializerIdE4readINS0_7IStreamEEEvRT_Rd[_ZN3ros13serialization10SerializerIdE4readINS0_7IStreamEEEvRT_Rd]+0x60): undefined reference to `ros::serialization::thr
owStreamOverrun()'
collect2: error: ld returned 1 exit status
link/CMakeFiles/roscomm.dir/build.make:94: recipe for target '/home/pi/ros_ws/devel/lib/link/roscomm' failed
make[2]: *** [/home/pi/ros_ws/devel/lib/link/roscomm] Error 1
CMakeFiles/Makefile2:1159: recipe for target 'link/CMakeFiles/roscomm.dir/all' failed
make[1]: *** [link/CMakeFiles/roscomm.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
----------
Now I don't think it's possible that I made more errors than lines of code written, and my package and CMake files are pretty standard and unspectacular:
CMake:
cmake_minimum_required(VERSION 2.8.3)
project(link)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
sensor_msgs
std_msgs
)
catkin_package()
include_directories( ${catkin_INCLUDE_DIRS} )
add_executable(roscomm src/roscomm.cpp) target_link_libraries(roscomm ${catkin_INCLUDE_DIRS})
----------
package.xml:
link 0.0.0 The link package pi TODO catkin roscpp rospy sensor_msgs std_msgs roscpp_serialization roscpp rospy sensor_msgs std_msgs roscpp_serialization roscpp rospy sensor_msgs std_msgs roscpp_serialization
----------
Can anyone tell me what's going on? I'm new to ROS. Thanks
↧
↧
gtest not found by Catkin
Hi all,
Since yesterday none of my packages containin tests build. Catkin complains it cannot find gtest when using catkin_add_gtests(), since GTEST_FOUND is FALSE. You can see this in the error msg below, with the custom output I added to my CMakeLists. Up to yesterday, GTEST_FOUND was TRUE when catkin_add_gtests() was called.
This is the error I always get. In this case I'm trying to build a mockup package on a clean catkin workspace:
Errors << silly_pkg:cmake /home/paco/catkin_ws2/logs/silly_pkg/build.cmake.002.log
Not searching for unused variables given on the command line.
Re-run cmake no build system arguments
-- Using CATKIN_DEVEL_PREFIX: /home/paco/catkin_ws2/devel/.private/silly_pkg
-- Using CMAKE_PREFIX_PATH: /home/paco/catkin_ws2/devel;/opt/ros/kinetic
-- This workspace overlays: /home/paco/catkin_ws2/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/paco/catkin_ws2/build/silly_pkg/test_results
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.11
-- GTEST_FOUND: FALSE
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:149 (message):
skipping gtest 'test_silly_pkg' in project 'silly_pkg' because gtest was
not found
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:79 (_catkin_add_executable_with_google_test)
/opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:28 (_catkin_add_google_test)
CMakeLists.txt:28 (catkin_add_gtest)
CMake Error at /home/paco/catkin_ws2/src/silly_pkg/CMakeLists.txt:33 (target_link_libraries):
Cannot specify link libraries for target "test_silly_pkg" which is not
built by this project.
-- Configuring incomplete, errors occurred!
See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeOutput.log".
See also "/home/paco/catkin_ws2/build/silly_pkg/CMakeFiles/CMakeError.log".
cd /home/paco/catkin_ws2/build/silly_pkg; catkin build --get-env silly_pkg | catkin env -si /usr/bin/cmake /home/paco/catkin_ws2/src/silly_pkg --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/paco/catkin_ws2/devel/.private/silly_pkg -DCMAKE_INSTALL_PREFIX=/home/paco/catkin_ws2/install; cd -
I am using catkin 0.7.11, libgtest-dev 1.7.0 and cmake 3.5.1. I use ROS Kinetic with Ubuntu 16.04. The only thing I did yesterday was reinstalling ROS Kinetic, but the package versions are exactly the same. Did anybody have this problem? Do you have any ideas on what could be happening?
Thank you very much,
Paco
↧
How to link `devel` directory for using library with pre-made custom library.
Hello, ROS experts.
I referenced below two link.
- [link1](https://answers.ros.org/question/231199/using-catkin-to-install-pre-made-libraries/)
- [link2](https://github.com/ros-drivers/prosilica_gige_sdk/blob/32aea9be0de7e40c647166d5f54de09948635b9f/CMakeLists.txt#L149)
On my project, there are two packages. For our convenience, I'll call these A and B project.
- A project: This project have a general library, a pre-made library. (there are two library)
- B project: This project will use two library from A project.
--> There project placed on same catkin_workspace.
> The problem is that I can't not use **pre-made library** on **B project**.
detail: I succeed it to install the pre-made library on `catkin_ws/devel/lib`. But, when I build the project B, It can not find pre-made library.
How can I fix this issue?
There is more detail on below description.
---
ProjectA, CMakeLists.txt
find_library(PreMade NAMES "caffe" PATHS "${PreMade_DIR}")
message(STATUS "${PreMade}")
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
std_msgs
interface_model
)
catkin_package(
CATKIN_DEPENDS roscpp std_msgs
LIBRARIES ${PROJECT_NAME}_lib PreMade
INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/include ${PreMade_INCLUDEDIR}
)
...
add_library(PreMade EXCLUDE_FROM_ALL ${PreMade} )
add_custom_command(TARGET PreMade POST_BUILD COMMAND cp ${PreMade} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ )
set_target_properties(PreMade PROPERTIES LINKER_LANGUAGE CXX ``` )
install( FILES ${PreMade}
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
ProjectA, CMakeLists.txt
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
ProjectA
)
...
add_executable(${PROJECT_NAME}_node ${SOURCES})
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
PreMade
)
---
**Build Log**(Catkin_make)
-- Configuring done
-- Generating done
-- Build files have been written to: /catkin_ws/build
####
#### Running command: "make -j8 -l8" in "/catkin_ws/build"
####
[ 6%] Built target Caffe
[ 26%] Built target interface_model_lib
[ 40%] Built target refine_det_lib
[ 93%] Linking CXX executable /catkin_ws/devel/lib/ProjectB/ProjectB_node
/usr/bin/ld: cannot find -lProejctA_premade_lib
collect2: error: ld returned 1 exit status
ProjectB/CMakeFiles/ProjectB_node.dir/build.make:199: recipe for target '/catkin_ws/devel/lib/ProjectB/ProjectB_node' failed
make[2]: *** [/catkin_ws/devel/lib/ProjectB/ProjectB_node] Error 1
CMakeFiles/Makefile2:1536: recipe for target 'ProjectB/CMakeFiles/ProjectB_node.dir/all' failed
make[1]: *** [ProjectB/CMakeFiles/ProjectB_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
---
* In catkin_ws/devel/lib
- [ProjectB]
- libGeneralForProejctA.so
- libPremade.so
↧
Installation clCaffe, ros_opencl_caffe, make -j4 issue
Hello,
While I was installing clCaffe, after typing command
$ make -j4
the following error arrived:
> [ 1%] Built target proto [ 1%]
> Building CXX object
> src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/pretune_convert.cpp.o
> In file included from
> /home/machine/code/clCaffe/include/caffe/common.hpp:25:0,
> from /home/machine/code/clCaffe/include/caffe/blob.hpp:8,
> from /home/machine/code/clCaffe/src/caffe/opencl/vendors/intel/tools/pretune_convert.cpp:7:
> /home/machine/code/clCaffe/include/caffe/greentea/greentea.hpp:30:19:
> fatal error: CL/cl.h: No such file or
> directory compilation terminated.
> src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/build.make:62:
> recipe for target
> 'src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/pretune_convert.cpp.o'
> failed make[2]: ***
> [src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/pretune_convert.cpp.o]
> Error 1 CMakeFiles/Makefile2:331:
> recipe for target
> 'src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/all'
> failed make[1]: ***
> [src/caffe/opencl/vendors/intel/tools/CMakeFiles/pretune_convert.dir/all]
> Error 2 Makefile:127: recipe for
> target 'all' failed make: *** [all]
> Error 2
source: https://github.com/01org/caffe/wiki/clCaffe
The part after adding LD_LIBRARY_PATH to indicate MKL directory,
I'm newbie in Linux, and I have no idea what to do.
Whole project: http://wiki.ros.org/IntelROSProject
↧
how to make sure that libraries in target_link_libraries are built already
how does target_link_library makes sure that all the libraries are built at that point.? Do we need to provide any path or package?
↧
↧
importing header files using target_link_library
I have one package and cmakeList.txt inside that package makes add_library(X y.cpp z.cpp). y.cpp is including A.h. I have another package B in which source files are using A.h from first package. Now one way to use these header files is do catkin_make() install() and add package dependency.
But if I dont want to include package dependency and instead target_link_library() to import header files from X. can i just do add_dependency(curret_target X) without adding any package dependency? Do i still need catkin_make() and install() in first package?
↧
Refer to package root in CMakeLists.txt
Hi,
I would like to run some custom commands when running catkin_make. In particular, I want to generate python scripts from QT resources and .ui files. How can it be done? How can I refer to files/scripts inside my package? I read the tutorial, but no way to find some good documentation about custom pre/post scripts, neither if catkin exports cmake symbols to refer to the current package source tree.
↧
Mac Kinetic Install: Qt5CoreConfig.cmake Error
I'm installing Kinetic on my Mac (Mojave 10.14). I'm following the tutorial at http://wiki.ros.org/kinetic/Installation/OSX/Homebrew/Source.
I ran the following command:
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$(brew --prefix qt5)
I got the following error:
-- Looking for ccache - not found
CMake Error at /usr/local/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:15 (message):
The imported target "Qt5::Core" references the file
"/usr/local/.//mkspecs/macx-clang"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/local/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"
but not all the files it references.
Call Stack (most recent call first):
/usr/local/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake:50 (_qt5_Core_check_file_exists)
/usr/local/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:166 (include)
cmake/OpenCVFindLibsGUI.cmake:18 (find_package)
CMakeLists.txt:600 (include)
-- Configuring incomplete, errors occurred!
I did some investigating; it looks like Homebrew users have experienced the same issue when installing other software packages. I'm sure there is a solution, but I can't find it. Does anyone know how to solve this issue?
If there is additional info that I should report, I can do so.
↧
CMAKE_PREFIX_PATH package not found
Hello,
I've been stuck on an issue in my ROS project after I started using an overlay. I used to just place all of my packages inside /src/ros2/ . I am trying to move my project into an overlay to make it more modular.
I have reduced my problem to just two packages. Package 1 is named "qualified_msgs" and builds with no issues. My second package is "ros_can_bridge" and this **depends** on the "qualified_msgs" package. My build process is as follows:
1. Build qualified_msgs
2. source /install/local_setup.bash (this should place the qualified_msgs cmake files in the path)
3. Build ros_can_bridge
When I try to execute step I get the following error:
> CMake Error at CMakeLists.txt:20 (find_package):> By not providing "Findqualified_msgs.cmake" in CMAKE_MODULE_PATH this> project has asked CMake to find a package configuration file provided by> "qualified_msgs", but CMake did not find one.>> Could not find a package configuration file provided by "qualified_msgs"
with any of the following names:>> qualified_msgsConfig.cmake> qualified_msgs-config.cmake>> Add the installation prefix of "qualified_msgs" to CMAKE_PREFIX_PATH or set> "qualified_msgs_DIR" to a directory containing one of the above files. If> "qualified_msgs" provides a separate development package or SDK, be sure it> has been installed.>> ---
Failed <<< ros_can_bridge [ Exited with code 1 ]
However, If I view my build log I can see that this **is** in the path:
Portion of Log:
>Invoking command in '/home/ros/overlay/build/ros_can_bridge': /usr/bin/cmake /home/ros/overlay/ros_can_bridge -DCMAKE_TOOLCHAIN_FILE=/usr/ros2_ws/aarch64_toolchainfile.cmake -DTHIRDPARTY=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCOMPILE_EXAMPLES=OFF -DCMAKE_C_STANDARD=99 -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING:BOOL=OFF -DCMAKE_PREFIX_PATH=**/home/ros/overlay/install/qualified_msgs;**/usr/ros2_ws/install/common_interfaces;/usr/ros2_ws/install/visualization_msgs;/usr/ros2_ws/install/ament_lint_common;/usr/ros2_ws/install/ament_cmake_uncrustify;/usr/ros2_ws/install/ament_uncrustify;/usr/ros2_ws/install/uncrustify_vendor;/usr/ros2_ws/install/trajectory_msgs;
I can see that my CMAKE files are indeed in this directory:

https://imgur.com/a/ZKj2dG6
Any advice on this would be appreciated, I'm pretty stuck!
Thanks,
↧
↧
What is adding -std=gnu++11 to my compiler options in ROS Melodic using catkin_tools?
Hi! I am running [loam_velodyne](https://github.com/laboshinl/loam_velodyne) package which needs c++14 language level. For this, the package adds `add_compile_options(-std=c++14)` in `CMakeLists.txt`.
On my Ubuntu 16.04 and Ros Kinetic with `catkin_make`, all works fine and the package is compiled with c++14 support. But on Ubuntu 18.04, something interferes and adds additional compiler option `-std=gnu++11` when using `catkin_tools` command `catkin build loam_velodyne`. So, as a result, in 16.04 and Kinetic my `flags.make` file in *build* directory has a line:
CXX_FLAGS = -O3 -DNDEBUG -fPIC -march=native -std=c++14 -fPIC
but in 18.04 and Melodic, there is additional compiler option `-std=gnu++11` that overrides the setting in CMakeLists.txt:
CXX_FLAGS = -O3 -DNDEBUG -fPIC -march=native -std=c++14 -std=gnu++11
Hence on Melodic the compilation fails as gnu++11 language level is used.
The *loam_velodyne* package is identical on both computers. I cannot figure out if this `-std=gnu++11` option is added by the ROS, catkin tools, Ubuntu version, compiler version or something else. I have grepped the /src folder for gnu++11 and CXX_FLAGS modifications, but nothing there. In 16.04 I am using gcc version 5.4.0 and cmake 3.5.1, in 18.04 I am using gcc 7.3.0 as default compiler (but I also have *clang* installed in the system) and cmake 3.10.2. I already tried to build the package with `catkin_make` in separate workspace on Melodic, but got the same result. Any hints on how to debug this would be greatly appreciated!
My `catkin config` output looks like this:
-----------------------------------------------------------
Profile: default
Extending: [explicit] /opt/ros/melodic
Workspace: /home/username/catkin_ws
-----------------------------------------------------------
Source Space: [exists] /home/username/catkin_ws/src
Log Space: [exists] /home/username/catkin_ws/logs
Build Space: [exists] /home/username/catkin_ws/build
Devel Space: [exists] /home/username/catkin_ws/devel
Install Space: [unused] /home/username/catkin_ws/install
DESTDIR: [unused] None
-----------------------------------------------------------
Devel Space Layout: linked
Install Space Layout: None
-----------------------------------------------------------
Additional CMake Args: -DCMAKE_BUILD_TYPE=Release
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
-----------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
-----------------------------------------------------------
Workspace configuration appears valid.
-----------------------------------------------------------
↧
gazebo7 "/physics/dart/DARTSurfaceParams.hh" no such file?
I'm using a project. And one include looks like this:
#include
During compilation, it reports cannot find such file. Then I searched this file in my machine too but also cannot find this file. What is the problem?
My versions:
ros: kinetic
gazebo: 8
ros_gazebo: 7
↧
How to cleanly handle dependencies in ament?
If I build a library to be used by other ROS 2 developers, what is the way to make it easy to use for downstream packages?
In modern CMake one answer should be exporting targets. This would then allow downstream packages to easily use that target via e.g. `find_package(some_dependency REQUIRED)` and `target_link_libraries(new_target [PUBLIC | PRIVATE | INTERFACE] some_dependency::some_dependency)` and if the author of `some_dependency` has done things right, that's all I have to do as the author of `my_target`.
Ament_cmake provides help for the exporting mechanism using `install(TARGETS my_dependency EXPORT some_dependency ...)` and `ament_export_interface(some_dependency)` (which does the heavy lifting if I'm right). Now if `some_dependency` itself depends on `some_other_dependency`, it seems that this dependency must have been added to `ament_export_dependencies()` for the target `some_dependency` even if it is not used in any header and could be linked privately. Otherwise I would have to `find_package(some_other_dependency)` in the build of `new_target`, which is wrong. This might be an artifact of the problem that it seems impossible to use `target_link_libraries` together with keywords `PUBLIC | PRIVATE | INTERFACE` as they are not used internally in ament (at least that's what CMake tells me).
However, there is also `ament_target_dependencies()` and `ament_export_dependencies()` and they seem to provide another way of handling dependencies: If I have a ROS 2 package where the export target (if it exists) does not have the same name as the target (then, for some reason, it seems I have to use `target_link_libraries`, see below for an example), I can just use `ament_target_dependencies(new_target some_dependency)`. If the dependency is used in a header and therefore needs to be linked publicly/by interface, I additionally have to add `ament_export_dependency(some_dependency)` (in contrast to how I have to use it with exported targets, see above).
**What's the preferred way of doing things and how to do this way right?**
Some real world examples:
- Currently, rosbag2 relies entirely on the second mechanism. See https://github.com/ros2/rosbag2/blob/master/rosbag2/CMakeLists.txt for an example (no `target_link_libraries`, no EXPORT, etc.)
- RViz relies on a mix of using targets and not (see for instance https://github.com/ros2/rviz/blob/42e3c4b47bc6acd90ed690b884bcc385555c382c/rviz_rendering/CMakeLists.txt#L104, but the CMakeLists should be cleaned up...).
- When trying to clean this up I found: For the `resource_retriever`, I have to use `target_link_libraries`, for `ament_index_cpp`, I can also use `ament_target_dependencies`. The only difference between the two is that the name of the EXPORT target in `ament_index_cpp` is different from the target, while it is the same for `resource_retriever` (see https://github.com/ros/resource_retriever/blob/ros2/resource_retriever/CMakeLists.txt#L50 vs https://github.com/ament/ament_index/blob/2ae14036e2c4f9db6fce022a47e300f71c47ea64/ament_index_cpp/CMakeLists.txt#L59)
↧