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

ROS1-ROS2 across different machines through ros1_bridge

asked 2021-07-21 15:34:22 -0500

updated 2021-07-21 15:35:37 -0500

Hi all,

My PC 1 which is going to be on physical robot, runs on ROS1 melodic. My workstation is on PC 2 which runs on ROS2 foxy.

From workstation, I output a set of velocity commands that robot needs to recieve. The problem is how to publish this message to PC 1 which is listening to the same topic but the nodes are running on ROS1. I know if it’s on the same machine ros1_bridge is capable to deal with this but since the nodes are running on different machines I am not sure if this is going to work. If anyone has experience with a same situation please do let me know. Many thanks !

edit retag flag offensive close merge delete

Comments

Do you absolutely need to do this? It seems to me that it would be easier to run a VM on your workstation with Melodic thant trying to set up a bridge to relay controll commands.

kscottz gravatar image kscottz  ( 2021-07-23 13:27:17 -0500 )edit

because the robot in my hand has code base running on ROS1 and I don’t have source code to translate it ROS2. Also my navigation code is all built in ROS2. Do you think if I run VM, the topics running on the VM will be discoverable to actual machine ? I am not sure if it’s yes

Fetullah Atas gravatar image Fetullah Atas  ( 2021-07-24 11:42:29 -0500 )edit

Did you ever arrive at a solution for this? I am in a similar situation where I've got some ROS2 packages (Nvidia Isaac ROS) which requires ROS2 Humble, and some ROS1 packages (MAVROS) that i need to communicate with each other, however, I can't figure out a good way to install both ROS1 and ROS2 on ubuntu 22.04 (which is required for ROS2 Humble)

ripdk12 gravatar image ripdk12  ( 2022-11-03 03:19:14 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2023-03-28 05:19:29 -0500

It's been 2 years but I hope my experience can help whoever comes next.

I am currently working with 3 machines:

  1. A Raspberry Pi with Ubuntu 18 and Ros1 Melodic
  2. A Jetson Nano with Ubuntu 18 that runs a Docker container with Ubuntu 20 and Ros1 Melodic + Ros2 Foxy
  3. A VM on my windows laptop with Ubuntu 20 and Ros2 Foxy that i use only for visualization purpose

PC1 and PC2 are connected via ethernet and PC2 and PC3 are connected via Wifi. You will have to figure out the networking aspect for your own case, but once every machine is able to ping the others you should be set.

After that you need to set the ROS_IP and ROS_MASTER_URI variables, ROS_MASTER_URI should point to your PC1 (or wherever is your roscore) and the ROS_IP should be the local host ip.

To open ros1/ros2 communication you need the ros1_bridge package on the PC2 (ros2 machine) and I advise you to read the github page. Just a quick rundown: you have to source Ros1 and then Ros2 on PC2 and execute the command ros2 run ros1_bridge dynamic_bridge ; if you have the roscore running on PC1 the bridge should be able to detect it.

That's it, or at least this worked for me. To be honest the initial network setup was way more challenging than the ros bridge stuff.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-07-21 15:34:22 -0500

Seen: 786 times

Last updated: Jul 21 '21