From 1ea08c3b4151a69da77129c8f751aab5ea7c0a56 Mon Sep 17 00:00:00 2001 From: Bob Ding <4655609+bobd988@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:59:43 -0800 Subject: [PATCH 1/2] Create README.md --- examples/c++-ros2-dataflow/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 examples/c++-ros2-dataflow/README.md diff --git a/examples/c++-ros2-dataflow/README.md b/examples/c++-ros2-dataflow/README.md new file mode 100644 index 000000000..32c844a3e --- /dev/null +++ b/examples/c++-ros2-dataflow/README.md @@ -0,0 +1,28 @@ +# `cxx-ros2-dataflow` Example + +This c++ example shows how to publish/subscribe to both ROS2 and Dora. The dataflow consists of a single node that sends random movement commands to the [ROS2 `turtlesim_node`](https://docs.ros.org/en/iron/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.html). + +## Setup + +This examples requires a sourced ROS2 installation. + +- To set up ROS2, follow the [ROS2 installation](https://docs.ros.org/en/iron/Installation.html) guide. +- Don't forget to [source the ROS2 setup files](https://docs.ros.org/en/iron/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files) +- Follow tasks 1 and 2 of the [ROS2 turtlesim tutorial](https://docs.ros.org/en/iron/Tutorials/Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.html#id3) + - Install the turtlesim package + - Start the turtlesim node through `ros2 run turtlesim turtlesim_node` + +## Running + + +From terminal 1 , sourcing the ROS2 installation and start ROS2 turtlesim window +``` +source /opt/ros/galactic/setup.bash +ros2 run turtlesim turtlesim_node +``` + +From terminal 2 from dora folder +``` +cargo run --example cxx-ros2-dataflow --features ros2-examples +``` +And you will see the turtle move a few steps. From d968ffca3fa5ddb73987c8682b71da367287b786 Mon Sep 17 00:00:00 2001 From: Bob Ding <4655609+bobd988@users.noreply.github.com> Date: Thu, 29 Feb 2024 08:19:15 -0800 Subject: [PATCH 2/2] Update README.md --- examples/c++-ros2-dataflow/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/c++-ros2-dataflow/README.md b/examples/c++-ros2-dataflow/README.md index 32c844a3e..ac117fd9e 100644 --- a/examples/c++-ros2-dataflow/README.md +++ b/examples/c++-ros2-dataflow/README.md @@ -12,7 +12,7 @@ This examples requires a sourced ROS2 installation. - Install the turtlesim package - Start the turtlesim node through `ros2 run turtlesim turtlesim_node` -## Running +## Running turtlesim example From terminal 1 , sourcing the ROS2 installation and start ROS2 turtlesim window @@ -21,8 +21,9 @@ source /opt/ros/galactic/setup.bash ros2 run turtlesim turtlesim_node ``` -From terminal 2 from dora folder +From terminal 2 from dora folder. Note the source command here is necessary as this allow ROS2 message types to be found and compile dynamically. ``` +source /opt/ros/galactic/setup.bash cargo run --example cxx-ros2-dataflow --features ros2-examples ``` And you will see the turtle move a few steps.