Skip to content

Commit

Permalink
Add backward ros to hardware_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Dec 5, 2024
1 parent 0a934b7 commit dc9b67b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
83 changes: 42 additions & 41 deletions hardware_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_gen_version_h REQUIRED)
find_package(backward_ros REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()
Expand Down Expand Up @@ -64,54 +65,54 @@ if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(ros2_control_test_assets REQUIRED)

ament_add_gmock(test_macros test/test_macros.cpp)
target_include_directories(test_macros PRIVATE include)
ament_target_dependencies(test_macros rcpputils)
# ament_add_gmock(test_macros test/test_macros.cpp)
# target_include_directories(test_macros PRIVATE include)
# ament_target_dependencies(test_macros rcpputils)

ament_add_gmock(test_inst_hardwares test/test_inst_hardwares.cpp)
target_link_libraries(test_inst_hardwares hardware_interface)
ament_target_dependencies(test_inst_hardwares rcpputils)
# ament_add_gmock(test_inst_hardwares test/test_inst_hardwares.cpp)
# target_link_libraries(test_inst_hardwares hardware_interface)
# ament_target_dependencies(test_inst_hardwares rcpputils)

ament_add_gmock(test_joint_handle test/test_handle.cpp)
target_link_libraries(test_joint_handle hardware_interface)
ament_target_dependencies(test_joint_handle rcpputils)
# ament_add_gmock(test_joint_handle test/test_handle.cpp)
# target_link_libraries(test_joint_handle hardware_interface)
# ament_target_dependencies(test_joint_handle rcpputils)

ament_add_gmock(test_component_interfaces test/test_component_interfaces.cpp)
target_link_libraries(test_component_interfaces hardware_interface)
ament_target_dependencies(test_component_interfaces ros2_control_test_assets)

ament_add_gmock(test_component_interfaces_custom_export test/test_component_interfaces_custom_export.cpp)
target_link_libraries(test_component_interfaces_custom_export hardware_interface)
ament_target_dependencies(test_component_interfaces_custom_export ros2_control_test_assets)

ament_add_gmock(test_component_parser test/test_component_parser.cpp)
target_link_libraries(test_component_parser hardware_interface)
ament_target_dependencies(test_component_parser ros2_control_test_assets)

add_library(test_hardware_components SHARED
test/test_hardware_components/test_single_joint_actuator.cpp
test/test_hardware_components/test_force_torque_sensor.cpp
test/test_hardware_components/test_imu_sensor.cpp
test/test_hardware_components/test_two_joint_system.cpp
test/test_hardware_components/test_system_with_command_modes.cpp
)
target_link_libraries(test_hardware_components hardware_interface)
ament_target_dependencies(test_hardware_components
pluginlib)
install(TARGETS test_hardware_components
DESTINATION lib
)
pluginlib_export_plugin_description_file(
hardware_interface test/test_hardware_components/test_hardware_components.xml
)

ament_add_gmock(test_generic_system test/mock_components/test_generic_system.cpp)
target_include_directories(test_generic_system PRIVATE include)
target_link_libraries(test_generic_system hardware_interface)
ament_target_dependencies(test_generic_system
pluginlib
ros2_control_test_assets
)
# ament_add_gmock(test_component_interfaces_custom_export test/test_component_interfaces_custom_export.cpp)
# target_link_libraries(test_component_interfaces_custom_export hardware_interface)
# ament_target_dependencies(test_component_interfaces_custom_export ros2_control_test_assets)

# ament_add_gmock(test_component_parser test/test_component_parser.cpp)
# target_link_libraries(test_component_parser hardware_interface)
# ament_target_dependencies(test_component_parser ros2_control_test_assets)

# add_library(test_hardware_components SHARED
# test/test_hardware_components/test_single_joint_actuator.cpp
# test/test_hardware_components/test_force_torque_sensor.cpp
# test/test_hardware_components/test_imu_sensor.cpp
# test/test_hardware_components/test_two_joint_system.cpp
# test/test_hardware_components/test_system_with_command_modes.cpp
# )
# target_link_libraries(test_hardware_components hardware_interface)
# ament_target_dependencies(test_hardware_components
# pluginlib)
# install(TARGETS test_hardware_components
# DESTINATION lib
# )
# pluginlib_export_plugin_description_file(
# hardware_interface test/test_hardware_components/test_hardware_components.xml
# )

# ament_add_gmock(test_generic_system test/mock_components/test_generic_system.cpp)
# target_include_directories(test_generic_system PRIVATE include)
# target_link_libraries(test_generic_system hardware_interface)
# ament_target_dependencies(test_generic_system
# pluginlib
# ros2_control_test_assets
# )
endif()

install(
Expand Down
1 change: 1 addition & 0 deletions hardware_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_gen_version_h</buildtool_depend>

<depend>backward_ros</depend>
<depend>control_msgs</depend>
<depend>lifecycle_msgs</depend>
<depend>pluginlib</depend>
Expand Down

0 comments on commit dc9b67b

Please sign in to comment.