ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ros1_bridge installation error "libros1_bridge.so: undefined reference to controller_manager_msgs"

asked 2022-08-10 07:28:38 -0500

sanmool gravatar image

Hello,

I am trying to install ros1_bridge inside a NUC. On this NUC I have installed: the Ubuntu 20.04.4 LTS OS; the ros-noetic-desktop-full of ROS1 Noetic; the ros-foxy-desktop and ros-foxy-ros-base of ROS2 Foxy.

I followed the steps of the ros1_bridge repository (https://github.com/ros2/ros1_bridge), both the foxy branch steps and the master branch steps. But, in both cases I got the same error when I compiled the ros1_bridge with the command:

colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure

These are all the steps I have followed.

First, in a Shell_1 I have compiled my ROS1 code:

source /opt/ros/noetic/setup.bash
cd ~/catkin_ws/
catkin build
source devel/setup.bash

Then, in a Shell_2 I compiled my ROS2 code:

source /opt/ros/foxy/setup.bash
cd ~/colcon_ws
colcon build --symlink-install
source install/setup.bash

In another terminal that does not have the ROS 1 environment sourced (Shell_3), I have tried to install ros1_bridge unsuccessfully by doing the following:

source /opt/ros/foxy/setup.bash    
mkdir -p ~/ros1_bridge/src
cd ~/ros1_bridge/src
git clone -b foxy https://github.com/ros2/ros1_bridge.git
cd ~/ros1_bridge
colcon build --symlink-install --packages-skip ros1_bridge

source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash
source /opt/ros/foxy/setup.bash
source ~/colcon_ws/install/setup.bash

colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure

And this is the error I get during compilation:

/usr/bin/ld: libros1_bridge.so: undefined reference to `ros1_bridge::Factory<controller_manager_msgs::ControllerState_<std::allocator<void> >, controller_manager_msgs::msg::ControllerState_<std::allocator<void> > >::convert_1_to_2(controller_manager_msgs::ControllerState_<std::allocator<void> > const&, controller_manager_msgs::msg::ControllerState_<std::allocator<void> >&)'
/usr/bin/ld: libros1_bridge.so: undefined reference to `ros1_bridge::Factory<controller_manager_msgs::ControllerState_<std::allocator<void> >, controller_manager_msgs::msg::ControllerState_<std::allocator<void> > >::convert_2_to_1(controller_manager_msgs::msg::ControllerState_<std::allocator<void> > const&, controller_manager_msgs::ControllerState_<std::allocator<void> >&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/parameter_bridge.dir/build.make:451: parameter_bridge] Error 1
make[1]: *** [CMakeFiles/Makefile2:314: CMakeFiles/parameter_bridge.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: libros1_bridge.so: undefined reference to `ros1_bridge::Factory<controller_manager_msgs::ControllerState_<std::allocator<void> >, controller_manager_msgs::msg::ControllerState_<std::allocator<void> > >::convert_1_to_2(controller_manager_msgs::ControllerState_<std::allocator<void> > const&, controller_manager_msgs::msg::ControllerState_<std::allocator<void> >&)'
/usr/bin/ld: libros1_bridge.so: undefined reference to `ros1_bridge::Factory<controller_manager_msgs::ControllerState_<std::allocator<void> >, controller_manager_msgs::msg::ControllerState_<std::allocator<void> > >::convert_2_to_1(controller_manager_msgs::msg::ControllerState_<std::allocator<void> > const&, controller_manager_msgs::ControllerState_<std::allocator<void> >&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/static_bridge.dir/build.make:451: static_bridge] Error 1
make[1]: *** [CMakeFiles/Makefile2:233: CMakeFiles/static_bridge.dir/all] Error 2
/usr/bin/ld: warning: libconsole_bridge.so.0.4, needed by /opt/ros/noetic/lib/libcpp_common.so, may conflict with libconsole_bridge.so.1.0
/usr/bin/ld: libros1_bridge.so: undefined reference to `ros1_bridge::Factory<controller_manager_msgs::ControllerState_<std::allocator<void> >, controller_manager_msgs::msg::ControllerState_<std::allocator<void> > >::convert_1_to_2(controller_manager_msgs::ControllerState_<std::allocator<void> > const&, controller_manager_msgs::msg::ControllerState_<std::allocator<void> >&)'
/usr/bin/ld: libros1_bridge.so: undefined reference to `ros1_bridge::Factory<controller_manager_msgs::ControllerState_<std::allocator<void> >, controller_manager_msgs::msg::ControllerState_<std::allocator<void> > >::convert_2_to_1(controller_manager_msgs::msg::ControllerState_<std::allocator<void> > const&, controller_manager_msgs::ControllerState_<std::allocator<void> >&)'
collect2: error: ld returned 1 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-08-11 00:58:46 -0500

sanmool gravatar image

updated 2022-08-11 01:00:12 -0500

Hello,

I finally got the compilation working. These are the steps I followed:

I deleted the ros1_bridge workspace:

rm -rf ~/ros1_bridge

Then, I uninstalled the ros controller-manager-msgs packages:

sudo apt remove ros-noetic-controller-manager-msgs
sudo apt remove ros-foxy-controller-manager-msgs
sudo apt purge ros-noetic-controller-manager-msgs
sudo apt purge ros-foxy-controller-manager-msgs

After that, I re-created the ros1_bridge workspace and again followed the installation steps from the repository (https://github.com/ros2/ros1_bridge).

source /opt/ros/foxy/setup.bash    
sudo apt update
mkdir -p ~/ros1_bridge_ws/src
cd ~/ros1_bridge_ws/src
git clone -b foxy https://github.com/ros2/ros1_bridge.git
cd ~/ros1_bridge_ws
colcon build --symlink-install --packages-skip ros1_bridge

source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash
source /opt/ros/foxy/setup.bash
source ~/colcon_ws/install/setup.bash

colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure

Once the compilation finished successfully, I reinstalled the ros controller-manager-msgs packages:

sudo apt update
sudo apt install ros-noetic-controller-manager-msgs
sudo apt install ros-foxy-controller-manager-msgs

Finally, I tested that the bridge worked!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-08-10 07:28:38 -0500

Seen: 584 times

Last updated: Aug 11 '22