Closed amifsud closed 2 years ago
Can you please provide a copy of your source to reproduce the problem?
Here is a repo with the different workspaces (ros1_bridge as submodule)
Thanks for your reply Alexis
@amifsud I've managed to reproduce your problem, but only under certain conditions.
If I run the commands you have given in sequence in a single terminal, I can reproduce your behaviour. However, if I run them in three separate terminals, one for each of the three workspaces, then the bridge builds correctly and behaves correctly.
Please try running the commands in three terminals like this:
In terminal 1:
$ source /opt/ros/noetic/setup.bash
$ catkin_make install
$ source ~/ros1_ws/install/setup.bash
$ rosmsg show ros1_msgs/Example
$ rosmsg show ros1_msgs/Example1
In terminal 2:
$ source /opt/ros/foxy/setup.bash
$ colcon build --build-base foxy_build --install-base foxy_install
$ source ~/ros2_ws/foxy_install/setup.bash
$ ros2 interface show ros2_msgs/msg/Example2
$ ros2 interface show ros2_msgs/msg/Example3
In terminal 3:
$ source ~/ros1_ws/install/setup.bash
$ source ~/ros2_ws/foxy_install/setup.bash
$ colcon build --build-base foxy_build --install-base foxy_install --cmake-force-configure
$ source ~/bridge_ws/foxy_install/setup.bash
$ ros2 run ros1_bridge dynamic_bridge --print-pairs | grep Example
ROS 1 and ROS 2 workspaces are not meant to be overlayed on each other (the ros1_bridge
is a special case that uses a lot of careful engineering to work), and complex overlaying often causes problems. I think that is what is causing the problem you are seeing.
Hello,
I didn't mention in the first post that it was actually in different terminals, sorry for that. I tested again today, I got the same issue. @quarkytale : did you get the same issue as you said in #353 using also different terminals ?
Thanks, Alexis
I actually could reproduce even in three separate terminals. Which branch of ros1_bridge
are you using @gbiggs if building from source, or just binaries? I'm using this dockerfile and building foxy branch of ros1_bridge from source.
@amifsud Opened a PR for this issue too. Please test it (using quarkytale/parsing_ros2_msg_fields branch) with your project if you get a chance!
Bug report
Required Info:
Operating System: Ubuntu 20.04
Installation type: Binaries, ros1_bridge from sources
Version or commit hash: Foxy HEAD
DDS implementation: Compile time issue
Steps to reproduce issue
Trying to map the following messages in ros1:
Example.msg :
Example1.msg :
to those ones in ros2:
Example2.msg :
Example3.msg :
With the mapping rules :
Or the following ones :
In ros1 workspace (~/ros1_ws):
In ros2 workspace (~/ros2_ws):
In ros1_bridge workspace (~/bridge_ws):
Expected behavior
In ros1 workspace (~/ros1_ws):
Result :
Result :
In ros2 workspace (~/ros2_ws):
Result :
Result :
In ros1_bridge workspace (~/bridge_ws):
Result : No error or warning for both mapping rules
Result : for both mapping rules :
Actual behavior
Expected behavior until in ros1_bridge workspace.
In ros1_bridge workspace (~/bridge_ws):
Result: Expected behavior for the first mapping rules. For the second mapping rule (field selection to the right)
Result: Expected behavior for the first mapping rules. For the second :
Additional information
I tried to use field_2_to_1 to take field selection always to the left, but I got another problem (see this issue).