Closed cardboardcode closed 4 years ago
The issue is in the theora_image_transport
package. While it might build successfully it doesn't export its necessary dependencies. That is why the error happens within /opt/ros/eloquent/share/theora_image_transport/cmake/theora_image_transportConfig.cmake
. Please file a ticket in the theora_image_transport
repository instead.
Thanks for the clarification. Will file the ticket soon.
Just to record on further progress on debugging this issue.
Including it here since this still pertains to the build process of ros1_bridge.
Attempt failed.
Manually removed theora_image_transport dependency by inserting the following after line 92 of CMakeLists.txt
.
set(ros2_interface_packages "action_msgs"
"action_tutorials_interfaces"
"actionlib_msgs"
"builtin_interfaces"
"composition_interfaces"
"diagnostic_msgs"
"example_interfaces"
"gazebo_msgs"
"geometry_msgs"
"lifecycle_msgs"
"logging_demo"
"map_msgs"
"nav_msgs"
"pcl_msgs"
"pendulum_msgs"
"rcl_interfaces"
"rosgraph_msgs"
"rqt_py_common"
"sensor_msgs"
"shape_msgs"
"std_msgs"
"std_srvs"
"stereo_msgs"
"tf2_msgs"
"trajectory_msgs"
"unique_identifier_msgs"
"visualization_msgs")
Encountered Error
CMake Warning at CMakeLists.txt:208 (add_library):
Cannot generate a safe runtime search path for target ros1_bridge because
files in some directories may conflict with libraries in implicit
directories:
runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target simple_bridge_2_to_1
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:200 (custom_executable)
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target test_ros2_client_cpp
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:250 (custom_executable)
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target simple_bridge_1_to_2
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:197 (custom_executable)
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target static_bridge because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:228 (custom_executable)
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target simple_bridge because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:204 (custom_executable)
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target parameter_bridge
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:235 (custom_executable)
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target dynamic_bridge
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:242 (custom_executable)
CMake Warning at CMakeLists.txt:179 (add_executable):
Cannot generate a safe runtime search path for target test_ros2_server_cpp
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/opt/ros/eloquent/lib
Some of these libraries may not be found correctly.
Call Stack (most recent call first):
CMakeLists.txt:252 (custom_executable)
libros1_bridge.so: undefined reference to `ros1_bridge::get_factory_theora_image_transport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
libros1_bridge.so: undefined reference to `ros1_bridge::get_service_factory_theora_image_transport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [dynamic_bridge] Error 1
make[1]: *** [CMakeFiles/dynamic_bridge.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
libros1_bridge.so: undefined reference to `ros1_bridge::get_factory_theora_image_transport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
libros1_bridge.so: undefined reference to `ros1_bridge::get_service_factory_theora_image_transport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [parameter_bridge] Error 1
make[1]: *** [CMakeFiles/parameter_bridge.dir/all] Error 2
libros1_bridge.so: undefined reference to `ros1_bridge::get_factory_theora_image_transport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
libros1_bridge.so: undefined reference to `ros1_bridge::get_service_factory_theora_image_transport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [static_bridge] Error 1
make[1]: *** [CMakeFiles/static_bridge.dir/all] Error 2
make: *** [all] Error 2
---
Failed <<< ros1_bridge [28.4s, exited with code 2]
Backing away since removing the dependency only made the issue harder to disentangle.
Further progress on debugging this issue:
The superficial issue of getting it to compile can be resolved by:
[Open terminal]
mkdir -p ros1_bridge_ws/src && cd ros1_bridge_ws/src git clone https://github.com/ros2/ros1_bridge.git --branch eloquent --single-branch git clone https://github.com/ros-perception/image_transport_plugins.git --branch ros2 --single-branch cd ~/ros1_bridge_ws colcon build --symlink-install --packages-skip ros1_bridge
[Close terminal] [Open terminal]
cd ~/ros1_bridge_ws source /opt/ros/melodic/setup.bash source /opt/ros/eloquent/setup.bash colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure
2. Replace the following [line 96 to 102 of `image_transport_plugins\theora_image_transport\CMakeLists.txt`](https://github.com/ros-perception/image_transport_plugins/blob/0565f23dc955fa2d56cffcfebc63de5a97cd005f/theora_image_transport/CMakeLists.txt#L96-L102)
```cmake
ament_export_dependencies(rosidl_default_runtime
${OpenCV_LIBRARIES}
${PC_OGG_LIBRARIES}
${PC_THEORA_LIBRARIES}
${PC_THEORAENC_LIBRARIES}
${PC_THEORADEC_LIBRARIES}
${LIBRARY_NAME})
Replace the above lines with:
ament_export_dependencies(rosidl_default_runtime
OpenCV
PkgConfig
)
Will continue to update here once a proper fix is found.
Further progress on debugging this issue.
The original goal is to be able to compile ros1_bridge from source in order to conduct topic mapping for custom ROS messages.
With this fix, I am able to do the following:
Follow the steps below to achieve the aforementioned 2 objectives:
mkdir -p ros1_bridge_ws/src && cd ros1_bridge_ws/src
git clone https://github.com/ros2/ros1_bridge.git --branch eloquent --single-branch
git clone https://github.com/ros-perception/image_transport_plugins.git --branch ros2 --single-branch
This changes has been fixed in recent commits to this repository as of 8th June 2021. Ignore this step.
cd ros1_bridge_ws/src/image_transport_plugins
<Replace all instances of the following lines in the package directory>
Change #include "image_transport/simple_subscriber_plugin.hpp" to #include "image_transport/simple_subscriber_plugin.h"
Change #include "image_transport/simple_publisher_plugin.hpp" to #include "image_transport/simple_publisher_plugin.h"
[This is because, before ROS2 Foxy, .hpp has not been used yet. I am currently using ROS2 Eloquent.]
<Replace the following lines 96 to 102 of image_transport_plugins\theora_image_transport\CMakeLists.txt with the ones below>
ament_export_dependencies(rosidl_default_runtime
OpenCV
PkgConfig
)
cd ros1_bridge_ws/src
<Create your custom message package. Ensure that the package name has _msgs or _interface.>
cd YOUR_ROS1_WORSPACE/src
<Create your custom message package. Ensure it has the same name as the one in ROS2.>
<Build and source your ROS1 workspace>
Note that this is how ros1_bridge match ROS2-ROS1 message pairs together. See this link for the evidence
cd ~/ros1_bridge_ws
source /opt/ros/eloquent/setup.bash
colcon build --symlink-install --packages-skip ros1_bridge
source /opt/ros/melodic/setup.bash
source /opt/ros/eloquent/setup.bash
source ~/YOUR_ROS1_WORSPACE/devel/setup.bash # The ROS1 workspace that contains the custom message.
source ~/ros1_bridge_ws/devel/setup.bash # The ROS2 workspace that contains the custom message.
colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure
That's it. That was how I "fixed" my issue, at least temporarily, and achieved my original goal.
Don't close that terminal you used for building your ros1_bridge yet. But if you did, please do the following:
source /opt/ros/melodic/setup.bash
source /opt/ros/eloquent/setup.bash
source ~/YOUR_ROS1_WORSPACE/devel/setup.bash # The ROS1 workspace that contains the custom message.
source ~/ros1_bridge_ws/devel/setup.bash # The ROS2 workspace that contains the custom message.
If you had not close that terminal,
ros2 run ros1_bridge dynamic_bridge --print-pairs
It has worked properly if you see your custom message in the list of matching pairs printed on the terminal.
[Open new terminal]
ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
[Open new terminal]
source /opt/ros/eloquent/setup.bash
ros2 run [THE ROS2 NODE THAT IS PUBLISHING THE CUSTOM MESSAGE]
[Open new terminal]
source /opt/ros/melodic/setup.bash
roscore
[Open new terminal]
source /opt/ros/melodic/setup.bash
rostopic list
[The topic with custom message in ROS2 should now appear.]
Bug report
Required Info:
README.md
Steps to reproduce issue
Expected behavior
Colcon build passes.
Actual behavior
Colcon build fails with the following error:
Additional information
My goal is to build ros1_bridge from source so ROS2-ROS1 topic mapping can be done for custom interfaces/messages.
However, I am unable to build ros1_bridge from source.
I have verified the issue does not lie within theora_image_transport. When building theora_image_transport from source, I did not encounter this build failure.
Follow the steps below to reproduce how I built theora_image_transport from source.
N/A
Feature description
N/A
Implementation considerations
N/A