lucasw / ros_one2z

Similar node graphs in vanilla ros1 and ros2 and also zenoh, focus on localhost using python but also C++ and maybe rust
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link
ros ros2 rust zenoh

ros1, ros2, zenoh

Similar node graphs in vanilla/out-of-the-box ros1 and ros2 compared (except that ros1 is one version running on the latest Ubuntu, ros2 is iron or perhaps rolling on same OS), focus on localhost using python. Also serializing messages into zenoh.

Later publish and process a point cloud.

Probably won't devote too much to this until Jazzy and the alternative middleware (https://discourse.ros.org/t/ros-2-alternative-middleware-report/33771) arrives (or Rolling will have it earlier?), but it will be nice to have something to run against it when it does arrive.

Setup

The launch files below don't yet exist, but this is the idead of what they ought to be.

ros1

Follow https://github.com/lucasw/ros_from_src/blob/debianize/ubuntu_2204/README.md to build ros one on Ubuntu 23.04.

Then make an overlaying workspace:

mkdir -p ~/ros/ros1_one/src
cd ~/ros/ros1_one/src
git clone git@github.com:lucasw/ros1vs2.git
cd ..
source  ~/install_base_catkin_ws/install/setup.bash
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release -Wno-deprecated
catkin build
source devel/setup.bash
ros2 launch ros1vs2 ros1vs2.launch

ros2

Follow https://github.com/lucasw/ros_from_src/issues/29 to build ros2 iron

Then make an overlaying workspace

mkdir -p ~/ros/ros2_iron_misc/src
cd ~/ros/ros2_iron_misc/src
ln -s ../../ros1_one/src/ros1vs2
cd ..
source ~/ros/ros2_iron/install/local_setup.bash
colcon build --symlink-install --packages-skip ros1_example_pkg
source install/local_setup.bash
ros2 launch ros1vs2 ros1vs2.launch

zenoh

Instead of using https://github.com/eclipse-zenoh/zenoh-plugin-ros1 have ros messages published directly into zenoh using serialization and deserialization.

rosrun ros1_example_pkg zenoh_generate_image.py
rosrun ros1_example_pkg zenoh_image_to_contour.py

The ros parameter server and roscore is still used, but the actual messages go through zenoh.

ros1 mcap direct recording and playback

(inside a venv in Ubuntu 23.04 and later)

pip install mcap mcap-ros1-support

Create a test mcap (in C++):

rosrun one2z mcap_recorder

(it will be adapted to record from a single topic of any type later, currently it creates Float64 messages internally)

Play back an mcap (should work with any with ros1 messages in it):

rosrun one2z ros1_play_mcap.py test.mcap