aniskoubaa / rosgpt

ROSGPT is a pioneering approach that combines the power of ChatGPT and ROS (Robot Operating System) to redefine human-robot interaction. By leveraging large language models like ChatGPT, ROSGPT enables the conversion of unstructured human language into actionable robotic commands. T
288 stars 63 forks source link

ROS 1 port #5

Closed antoan closed 1 year ago

antoan commented 1 year ago

Hi,

Many thanks for sharing this. I am interested in porting the code to ROS 1

You mentioned in your readme that:

"To use ROSGPT with ROS1, you will need to modify the ROS 2 code in the scripts to the corresponding ROS 1 code. We are actively working on developing this functionality, but it is still a work-in-progress."

I wondered if there are any particular hurdles that you are aware of, in the way, to make this happen - besides porting the node code from ROS 2 to 1.

Any tips or advice would be most appreciated.

Cheers

mustafabozkaya commented 1 year ago

Porting a ROS 2 code to ROS 1 requires modifying the ROS 2 code in the scripts to the corresponding ROS 1 code [2]. However, there are particular hurdles to be aware of when porting a ROS 2 code to ROS 1. One of the major hurdles is that ROS 2 uses DDS as its middleware while ROS 1 uses ROS 1 middleware. ROS 2 allows for more flexible and efficient communication between nodes, while ROS 1 has more limited communication capabilities. Therefore, when porting a ROS 2 code to ROS 1, it’s essential to ensure that the communication between nodes is still functioning optimally [1].

Another hurdle is that ROS 2 uses a different build system than ROS 1. ROS 2 uses the Colcon build system, while ROS 1 uses the Catkin build system. This means that when porting a ROS 2 code to ROS 1, it’s necessary to convert the package to the Catkin build system. This can be achieved by creating a new package in ROS 1 and copying the code from the ROS 2 package directory to the ROS 1 package directory. Then, the code can be modified to work with the ROS 1 middleware [3].

One approach to migrate a ROS project from ROS 1 to ROS 2 is to use the ros1_bridge package [4]. The ros1_bridge package allows communication between ROS 1 and ROS 2 nodes. This means that ROS 1 nodes can still communicate with ROS 2 nodes, and vice versa. To use the ros1_bridge package, the first step is to enable ROS 2 communication with the ROS 1 code base. This can be done by setting up the binding so that ROS 2 nodes can subscribe/publish/call services/etc. from the ROS 1 side. Then, nodes/packages can be migrated one by one by rewriting the ROS 1 functionalities into ROS 2 functionalities. During the migration, it’s essential to ensure that the communication between nodes is still functioning optimally. Once all packages are ported to ROS 2, the ROS 1 binding can be removed [4].

In conclusion, porting a ROS 2 code to ROS 1 requires modifying the ROS 2 code to match the ROS 1 middleware. ROS 2 uses DDS as its middleware, while ROS 1 uses ROS 1 middleware. Therefore, when porting a ROS 2 code to ROS 1, it’s necessary to ensure that the communication between nodes is still functioning optimally. Another hurdle is that ROS 2 uses a different build system than ROS 1. One approach to migrate a ROS project from ROS 1 to ROS 2 is to use the ros1_bridge package, which allows communication between ROS 1 and ROS 2 nodes.

ı hope that hepls you

antoan commented 1 year ago

Really appreciate it, thank you.