In Unit 6 - Node composition.
I am currently following the Node composition tutorial, i build without any error, using the colcon build, then source the install/setup.bash but i cant see my component using the :
ros2 component types
the component does not appear int the list. I followed and verified each steps but can’t figure what is missing or wrong.
Hello @davidlinhares ,
I’ve been doing some tests and it’s working ok for me. Could you please try the following command:
ros2 component types | grep my_components
You don’t get any output from this command?
Hi @albertoezquerro and @davidlinhares ,
I have the same issue but there is no solution on the old topic. Below my CMakeList and a screenshot of the result. Do you know what is happening?
Thank you in advance for your help !
cmake_minimum_required(VERSION 3.8)
project(my_components)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(composition REQUIRED)
find_package(geometry_msgs REQUIRED)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()
include_directories(include)
add_library(moverobot_component SHARED src/moverobot_component.cpp)
target_compile_definitions(moverobot_component PRIVATE "COMPOSITION_BUILDING_DLL")
ament_target_dependencies(moverobot_component
"rclcpp"
"rclcpp_components"
"geometry_msgs")
rclcpp_components_register_nodes(moverobot_component "my_components::MoveRobot")
set(node_plugins "${node_plugins}my_components::MoveRobot;$<TARGET_FILE:moverobot_component>\n")
install(TARGETS
moverobot_component
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
@adluthi
If you are still having this problem, please post it as a separate post, including details specific to you.