ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

kutschkem's profile - activity

2019-06-05 17:39:48 -0500 received badge  Famous Question (source)
2019-04-04 02:11:07 -0500 received badge  Notable Question (source)
2019-03-12 15:07:39 -0500 received badge  Popular Question (source)
2019-03-11 04:32:03 -0500 commented answer Use rosdep to install dependencies from workspace, but only selected

This answer could be improved by an example of how to use rosdep to install dependecies of one of the packages in the wo

2019-03-11 02:35:10 -0500 commented question Use rosdep to install dependencies from workspace, but only selected

@gvdhoorn Yes, I use --from-paths to point to a complete ros2 ardent release workspace, and I want requirements of the b

2019-03-11 02:34:48 -0500 commented question Use rosdep to install dependencies from workspace, but only selected

Yes, I use --from-paths to point to a complete ros2 ardent release workspace, and I want requirements of the built packa

2019-03-08 03:11:10 -0500 marked best answer Linking problem with rosidl cpp

The following is my CMakeLists.txt

cmake_minimum_required(VERSION 3.5)

project(matrix2_ros)


## generate messages
include (ExternalProject)
ExternalProject_Add(matrix2_msgs
SOURCE_DIR "${ros_impl_dir}"
INSTALL_COMMAND ""
)

ExternalProject_Get_Property(matrix2_msgs BINARY_DIR)
set(ros_msg_dir ${BINARY_DIR})
##

if(NOT WIN32)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra -Wpedantic")
endif()

find_package(ament_cmake_ros REQUIRED)
find_package(example_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rcutils)
find_package(rmw REQUIRED)

set(ros_algo_hdr
  "include/rosBinding.h"
)

set(ros_algo_src
    "src/main.cpp"

)

    set(ros_protobuf

    "protobuf/Test/Mat.msg2structs.h"
    "protobuf/Test/Mat.msg2structs.cc"
    "protobuf/Test/Mat.structs2msg.h"
    "protobuf/Test/Mat.structs2msg.cc"
    )


add_executable(${PROJECT_NAME} ${ros_algo_hdr} ${ros_algo_src} ${ros_protobuf})

add_dependencies(${PROJECT_NAME} matrix2_msgs)

 target_link_libraries(${PROJECT_NAME} ${MODULE_NAME}_core)

ament_target_dependencies(${PROJECT_NAME}
    "rclcpp"
    "rcutils"
    "matrix2_msgs")
  install(TARGETS ${PROJECT_NAME}
  DESTINATION lib/${PROJECT_NAME})


    # handle library dependencies   
    if(MSVC)
        find_package(OpenCV REQUIRED core highgui imgproc)
        include_directories("${OPENCV_INCLUDE_DIRS}") 
        message(STATUS "OpenCV win include dir: ${OPENCV_INCLUDE_DIRS}") 
        target_link_libraries(${PROJECT_NAME} ${OpenCV_LIB_CORE} ${OpenCV_LIB_HIGHGUI} ${OpenCV_LIB_IMGPROC})
    else(MSVC)
        find_package(PkgConfig REQUIRED) 
        pkg_check_modules(OPENCV REQUIRED opencv)
        include_directories("${OPENCV_INCLUDE_DIRS}") 
        message(STATUS "OpenCV include dir: ${OPENCV_INCLUDE_DIRS}")
        # remove test lib which conflicts with GTest (see https://schneide.wordpress.com/2014/02/03/testing-c-code-with-opencv-dependencies/ 
        list(REMOVE_ITEM OPENCV_LIBRARIES opencv_ts)
        target_link_libraries(${PROJECT_NAME} ${OPENCV_LIBRARIES})
        message(STATUS "OpenCV included in ara project: ${OPENCV_LIBRARIES}")
    endif(MSVC)



    source_group("Autogen\\Header Files" FILES "${ros_algo_hdr}" )
    source_group("Autogen\\Source Files" FILES "${ros_algo_src}" )
    source_group("Autogen\\Protobuf\\Converters" FILES "${ros_protobuf}")

    target_include_directories(${PROJECT_NAME}
        PRIVATE "include/"
        PRIVATE "protobuf/"
        PRIVATE "${ros_msg_dir}/rosidl_generator_cpp/"
    )

ament_package()

And the package.xml

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://
www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>matrix2_ros</name>
  <version>0.1.0</version>
  <description>ROS binding for matrix2</description>
  <maintainer email="maintainer@example.com">FillMeIn</maintainer>
  <license></license>

  <member_of_group>rosidl_interface_packages</member_of_group>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <build_depend>rosidl_default_generators</build_depend>
  <build_depend>builtin_interfaces</build_depend>
  <exec_depend>builtin_interfaces</exec_depend>
  <build_depend>matrix2_msgs</build_depend>
  <exec_depend>matrix2_msgs</exec_depend>

  <build_depend>rclcpp</build_depend>
  <build_depend>rcutils</build_depend>
  <build_depend>rmw_implementation_cmake</build_depend>  

  <exec_depend>rclcpp</exec_depend>
  <exec_depend>rcutils</exec_depend>
  <exec_depend>rmw_implementation</exec_depend>
  <exec_depend>rosidl_default_runtime</exec_depend>

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>

The problem I am facing is that during the linking phase, some symbols are not found. Here is the output of make VERBOSE=1.

[ 82%] Linking CXX executable matrix2_ros
cd /home/uidq3479/Jenkins/workspace/XCitDevelopment_PR-164-OI7ZPASJZEV3XGQWBFQY2PEQXIELKYENI5G6JZQZXQR3CPC6F5NA/tests/eclipseProject/projects/math/build/cmake/algos/matrix/matrix2/ros && /usr/bin/cmake -E cmake_link_script CMakeFiles/matrix2_ros.dir/link.txt --verbose=1
/usr/bin/c++  -Wl,--no-as-needed -pthread -g -std=c++14 -Wall -std=c++14 -Wall -Wextra -Wpedantic   CMakeFiles/matrix2_ros.dir/src/main.cpp.o CMakeFiles/matrix2_ros.dir/protobuf/Test/Mat.msg2structs.cc.o CMakeFiles/matrix2_ros.dir/protobuf/Test/Mat.structs2msg.cc.o  -o matrix2_ros -Wl,-rpath,/usr/local/lib:/home/uidq3479/ros2-linux/lib: ../implementation/libmatrix2_core.a /home/uidq3479/ros2-linux/lib/librosidl_typesupport_c.so /home/uidq3479/ros2-linux/lib/librosidl_typesupport_cpp.so /home/uidq3479/ros2-linux/lib/libbuiltin_interfaces__rosidl_typesupport_c.so /home/uidq3479/ros2-linux/lib/libbuiltin_interfaces__rosidl_typesupport_cpp.so /home/uidq3479/ros2-linux/lib/libbuiltin_interfaces__rosidl_typesupport_introspection_c.so /home/uidq3479/ros2-linux/lib/libbuiltin_interfaces__rosidl_generator_c.so /home/uidq3479/ros2-linux/lib/libbuiltin_interfaces__rosidl_typesupport_introspection_cpp.so /home/uidq3479/ros2-linux/lib/librcl_interfaces__rosidl_typesupport_c.so /home/uidq3479/ros2-linux/lib/librcl_interfaces__rosidl_typesupport_cpp.so /home/uidq3479/ros2-linux/lib/librcl_interfaces__rosidl_typesupport_introspection_c.so /home/uidq3479/ros2-linux/lib/librcl_interfaces__rosidl_generator_c.so /home/uidq3479/ros2-linux/lib/librcl_interfaces__rosidl_typesupport_introspection_cpp.so /usr/local/lib/libfastcdr.so ...
(more)
2019-03-08 03:11:10 -0500 received badge  Scholar (source)
2019-03-08 02:35:14 -0500 received badge  Famous Question (source)
2019-03-08 02:35:14 -0500 received badge  Notable Question (source)
2019-03-07 10:06:09 -0500 asked a question Use rosdep to install dependencies from workspace, but only selected

Use rosdep to install dependencies from workspace, but only selected I want to build a selected subset of the ROS2 distr

2019-02-11 13:01:15 -0500 received badge  Famous Question (source)
2018-08-04 10:16:18 -0500 received badge  Notable Question (source)
2018-07-24 05:01:20 -0500 received badge  Self-Learner (source)
2018-07-24 05:01:20 -0500 received badge  Teacher (source)
2018-06-12 05:10:26 -0500 received badge  Student (source)
2018-06-12 05:10:18 -0500 received badge  Popular Question (source)
2018-05-23 10:08:58 -0500 received badge  Popular Question (source)
2018-04-05 03:04:49 -0500 answered a question Linking problem with rosidl cpp

The problem here was that matrix2_msgs was not being linked into matrix2_ros. Since the compiler generates an actual ins

2018-04-05 01:56:52 -0500 commented question Linking problem with rosidl cpp

@Dirk Thomas I see a similar problem happened when you tried to build code related to this issue https://github.com/ros2

2018-04-04 10:06:33 -0500 asked a question Linking problem with rosidl cpp

Linking problem with rosidl cpp The following is my CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(matrix2

2018-04-03 07:39:57 -0500 commented question Cpp message generation fails for introspection

I filed a bug report with rosidl now https://github.com/ros2/rosidl/issues/267 I will close this question in favor of th

2018-04-03 06:41:49 -0500 commented question Cpp message generation fails for introspection

@Dirk Thomas I can reproduce that the error only happens when I try to build multiple message packages in the same CMake

2018-04-03 05:33:46 -0500 commented question Cpp message generation fails for introspection

@Dirk Thomas I tested that this works if I just compile the message project itself. I assume that maybe the order of the

2018-03-29 08:28:50 -0500 asked a question Cpp message generation fails for introspection

Cpp message generation fails for introspection My message package fails to generate properly, with this output: [ros-te