forked from dora-rs/dora
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dora-rs#431 from dora-rs/cxx-ros2-readme
Create README.md for cxx-ros2-example
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# `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 turtlesim example | ||
|
||
|
||
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. 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. |