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

ros1_bridge build error for Turtlebot3

asked 2020-06-08 00:27:37 -0500

swaroophs gravatar image

Hello all,

I am trying to build ros1_bridge from source and facing the following issue. Any idea where I am going wrong? It seems to be pointing to Turtlebot3's sound message/service:

$ colcon build --packages-select ros1_bridge --cmake-force-configure --cmake-args -DBUILD_TESTING=FALSE
Starting >>> ros1_bridge
[Processing: ros1_bridge]                            
[Processing: ros1_bridge]                                    
--- stderr: ros1_bridge                                      
CMakeFiles/ros1_bridge.dir/generated/turtlebot3_msgs__srv__Sound__factories.cpp.o: In function `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_1_to_2(turtlebot3_msgs::Sound_<std::allocator<void> > const&, turtlebot3_msgs::msg::Sound_<std::allocator<void> >&)':
turtlebot3_msgs__srv__Sound__factories.cpp:(.text+0x284): multiple definition of `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_1_to_2(turtlebot3_msgs::Sound_<std::allocator<void> > const&, turtlebot3_msgs::msg::Sound_<std::allocator<void> >&)'
CMakeFiles/ros1_bridge.dir/generated/turtlebot3_msgs__msg__Sound__factories.cpp.o:turtlebot3_msgs__msg__Sound__factories.cpp:(.text+0x284): first defined here
CMakeFiles/ros1_bridge.dir/generated/turtlebot3_msgs__srv__Sound__factories.cpp.o: In function `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_2_to_1(turtlebot3_msgs::msg::Sound_<std::allocator<void> > const&, turtlebot3_msgs::Sound_<std::allocator<void> >&)':
turtlebot3_msgs__srv__Sound__factories.cpp:(.text+0x2a0): multiple definition of `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_2_to_1(turtlebot3_msgs::msg::Sound_<std::allocator<void> > const&, turtlebot3_msgs::Sound_<std::allocator<void> >&)'
CMakeFiles/ros1_bridge.dir/generated/turtlebot3_msgs__msg__Sound__factories.cpp.o:turtlebot3_msgs__msg__Sound__factories.cpp:(.text+0x2a0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [libros1_bridge.so] Error 1
make[1]: *** [CMakeFiles/ros1_bridge.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< ros1_bridge    [ Exited with code 2 ]

Summary: 0 packages finished [1min 3s]
  1 package failed: ros1_bridge
  1 package had stderr output: ros1_bridge

These are my steps:

Terminal 1:

Source ROS 1 workspace:

$ source /opt/ros/melodic/setup.bash
$ source ~/catkin_ws/devel/setup.bash

Terminal 2:

Source ROS 2 workspace:

$ source /opt/ros/dashing/setup.bash
$ source ~/ros2_dd_ws/install/setup.bash

Terminal 3:

ros1_bridge workspace get source:

$ cd ~/ros1_bridge_ws/src
$ git clone -b dashing https://github.com/ros2/ros1_bridge.git
$ . ~/catkin_ws/devel/setup.bash
$ . ~/colcon_ws/install/setup.bash
ROS_DISTRO was set to 'melodic' before. Please make sure that the environment does not mix paths from different distributions.

Verify environment:

$ echo $CMAKE_PREFIX_PATH | tr ':' '\n'
/home/swaroophs/ros2_dd_ws/install/rosrect-listener-agent
/home/swaroophs/catkin_ws/devel
/opt/ros/melodic

ros1_bridge build (FAILS):

$ colcon build --packages-select ros1_bridge --cmake-force-configure --cmake-args -DBUILD_TESTING=FALSE
Starting >>> ros1_bridge
[Processing: ros1_bridge]                            
[Processing: ros1_bridge]                                    
--- stderr: ros1_bridge                                      
CMakeFiles/ros1_bridge.dir/generated/turtlebot3_msgs__srv__Sound__factories.cpp.o: In function `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_1_to_2(turtlebot3_msgs::Sound_<std::allocator<void> > const&, turtlebot3_msgs::msg::Sound_<std::allocator<void> >&)':
turtlebot3_msgs__srv__Sound__factories.cpp:(.text+0x284): multiple definition of `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_1_to_2(turtlebot3_msgs::Sound_<std::allocator<void> > const&, turtlebot3_msgs::msg::Sound_<std::allocator<void> >&)'
CMakeFiles/ros1_bridge.dir/generated/turtlebot3_msgs__msg__Sound__factories.cpp.o:turtlebot3_msgs__msg__Sound__factories.cpp:(.text+0x284): first defined here
CMakeFiles/ros1_bridge.dir/generated/turtlebot3_msgs__srv__Sound__factories.cpp.o: In function `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_2_to_1(turtlebot3_msgs::msg::Sound_<std::allocator<void> > const&, turtlebot3_msgs::Sound_<std::allocator<void> >&)':
turtlebot3_msgs__srv__Sound__factories.cpp:(.text+0x2a0): multiple definition of `ros1_bridge::Factory<turtlebot3_msgs::Sound_<std::allocator<void> >, turtlebot3_msgs::msg::Sound_<std::allocator<void> > >::convert_2_to_1(turtlebot3_msgs::msg::Sound_<std::allocator<void> > const&, turtlebot3_msgs::Sound_<std ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-08 14:33:59 -0500

Dirk Thomas gravatar image

This seems to be a bug in the ros1_bridge due to the fact that in the turtlebot3_msgs package there is a message and service with the same name: Sound. That case wasn't handled correctly.

Please see https://github.com/ros2/ros1_bridge/p... which fixes the problem on master. Backports of the various ROS distros will need to happen too.

You should be able to apply the patch locally to the dashing branch you are using before building the ros1_bridge package.

edit flag offensive delete link more

Comments

Thanks @Dirk for commenting on this so quickly! I tried out the patch in __init__.py locally and it works!

P.S: Thanks for being so active on these forums. I pretty much see you everywhere some one has a ROS 2 related question helping them. I really appreciate the time and effort you put in :). Big fan.

swaroophs gravatar image swaroophs  ( 2020-06-08 21:44:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-08 00:27:37 -0500

Seen: 298 times

Last updated: Jun 08 '20