[Bug] Colcon Build error for the Dynamixel Workbench

This is an error report.


Screenshot of the error


Error details

Hello all,

I was working in the ROS2 Control Framework course. Everything has worked so far. I ran into issues building the Unit 5 packages for the Dynamixel Motor Control framework for the connection to ros2 controls. The issue that pops in is that it is a simple Cmake error of that it cannot read the package information but it states it cannot find a required package called dynamixel_workbench_toolbox which was supposedly added in the cmake file following the instructions on how to access it and I even copied the content of the desired XML format needed and the cmake file after I saw this error in case I forgot extra dependencies in the importation of these code. I understand what it could be but want to know your insights on how to fix it before progressing the course to test and see.</p>

Hi @Agarcia5612 ,

I think you are missing one or both of the steps:

  1. You have forgotten to download (clone) the Dynamixel Libraries from the provided Bitbucket repository source link.
  2. You have forgotten to add the dynamixel_workbench_toolbox as a depedency in either your CMakeLists.txt and/or package.xml file(s).

I have checked this specific part of this course and it currently works for me as-is.
Please go through the course instructions again to do the missing steps.

Regards,
Girish

Hi Girish

Thank you for your quick response. I was able to fix it you were correct I skipped the part of cloning the dynamixel library. I swore I did that step but I confused it with the step of the Dynamixel SDK package clone.
I ran into another error but I already had dependencies of the package in the cmake file and the package.xml file through past experience with these courses like the Moveit course and checked it with the solution posted for that unit.

I ran into a different problem when I did the dependency of # include file such as the line below from the file dynamixel_hardware_interface.cpp; I think I had an issue with my cmake setup with including the include library setup. But I found a workaround by changing it

from this line:
#include “dynamixel_hardware_interface/dynamixel_hardware_interface.hpp”

To this: It allowed to compile and execute the whole section without an issue.
#include “dynamixel_hardware_interface.hpp”

Current Cmake file for the Dynamixel_hardware package
cmake_minimum_required(VERSION 3.5)
project(dynamixel_hardware_interface)

Default to C99

if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

Default to C++14

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

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(hardware_interface REQUIRED)
find_package(pluginlib REQUIRED)
find_package(dynamixel_workbench_toolbox REQUIRED)

add_library(
${PROJECT_NAME}
SHARED
src/dynamixel_hardware_interface.cpp
)
target_include_directories(
${PROJECT_NAME}
PRIVATE
include
)
ament_target_dependencies(
${PROJECT_NAME}
rclcpp
hardware_interface
pluginlib
dynamixel_workbench_toolbox
)

pluginlib_export_plugin_description_file(hardware_interface dynamixel_hardware.xml)

INSTALL

install(
TARGETS ${PROJECT_NAME}
DESTINATION lib
)
install(
DIRECTORY include/
DESTINATION include
)

install(
DIRECTORY
launch
config
DESTINATION
share/${PROJECT_NAME}/
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)

the following line skips the linter which checks for copyrights

uncomment the line when a copyright and license is not present in all source files

#set(ament_cmake_copyright_FOUND TRUE)

the following line skips cpplint (only works in a git repo)

uncomment the line when this package is not in a git repo

#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

EXPORTS

ament_export_include_directories(
include
)
ament_export_libraries(
${PROJECT_NAME}
)
ament_export_dependencies(
rclcpp
hardware_interface
pluginlib
dynamixel_workbench_toolbox
)

ament_package()

Hi @Agarcia5612 ,

I cross-checked your CMakeLists.txt contents with that of mine, they are same. I believe it should work for you.

Reagrds,
Girish

Hi @Agarcia5612 ,

Glad to know that you have found the problem and fixed it.

Regards,
Girish

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.