## Problem
When building openarm_ros2, the hardware interface tests fail because
the components_urdfs.hpp header from ros2_control_test_assets cannot be
found as
follows.
```console
$ colcon build
...
/home/otegami/work/cpp/ros2_ws/src/openarm_ros2/openarm_hardware/test/test_openarm_hardware.cpp:21:10: fatal error: ros2_control_test_assets/components_urdfs.hpp: No such file or directory
21 | #include "ros2_control_test_assets/components_urdfs.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/test_openarm_hardware.dir/build.make:79: CMakeFiles/test_openarm_hardware.dir/test/test_openarm_hardware.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:237: CMakeFiles/test_openarm_hardware.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< openarm_hardware [14.9s, exited with code 2]
Summary: 6 packages finished [15.1s]
1 package failed: openarm_hardware
5 packages had stderr output: openarm_bimanual_bringup openarm_bimanual_description openarm_bringup openarm_description openarm_hardware
1 package not processed
```
## Cause
Although ros2_control_test_assets was installed, it wasn’t declared as a
dependency of the GMock test
target.
## Solution
Add ros2_control_test_assets as a test dependency in both the
CMakeLists.txt and in the package.xml,
ensuring the test can locate its headers.
39 lines
1.3 KiB
XML
39 lines
1.3 KiB
XML
<?xml version="1.0"?>
|
||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||
<!--
|
||
Copyright 2025 Reazon Holdings, Inc.
|
||
|
||
Licensed under the Apache License, Version 2.0 (the "License");
|
||
you may not use this file except in compliance with the License.
|
||
You may obtain a copy of the License at
|
||
|
||
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
Unless required by applicable law or agreed to in writing, software
|
||
distributed under the License is distributed on an "AS IS" BASIS,
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
See the License for the specific language governing permissions and
|
||
limitations under the License.
|
||
-->
|
||
<package format="3">
|
||
<name>openarm_hardware</name>
|
||
<version>0.3.0</version>
|
||
<description>Hardware interface for OpenArm</description>
|
||
<maintainer email="t95zhou@uwaterloo.ca">Thomason Zhou</maintainer>
|
||
<license>Apache-2.0</license>
|
||
|
||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||
|
||
<depend>rclcpp</depend>
|
||
<depend>hardware_interface</depend>
|
||
<depend>pluginlib</depend>
|
||
|
||
<test_depend>ament_lint_auto</test_depend>
|
||
<test_depend>ament_lint_common</test_depend>
|
||
<test_depend>ros2_control_test_assets</test_depend>
|
||
|
||
<export>
|
||
<build_type>ament_cmake</build_type>
|
||
</export>
|
||
</package>
|