diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9ca67d120a2a041855b55736ff8c520d379bf9eb --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Simple ROS-NNG-Test + +This project tests the combination of [NNG](https://nng.nanomsg.org/) and ROS. + +NNG supports several communication patterns. Currently, *pub-sub* is supported; others may follow. + +## Publish-Subscribe + +This demonstrator contains two nodes, a publisher and a subscriber. +The publisher listens to ROS messages. +Each received message is transmitted to the subscriber using NNG. +For each received message, the subscriber publishes another ROS message. +Currently, the transmission works using TCP with the fixed NNG URL `"tcp://localhost:6576"`. + +### Running the Example +- Checkout the project using git. + Since the CMake build uses git submodules, do not remove the git information! + It is not required to checkout the submodule manually, this is done using CMake. +- Build the project. +- Start ROS + ``` + $ roscore + ``` +- Start the `publisher` and `subscriber` nodes in two terminals. + Both are in the `nng_test` namespace. + ``` + $ rosrun nng_test publisher + ``` + ``` + $ rosrun nng_test subscriber + ``` +- Listen to received messages for the topic `/nnc_test/received_nng_subscription`. + ``` + $ rostopic echo /nnc_test/received_nng_subscription + ``` +- Trigger a transmission by publishing a string message to `/nnc_test/publish_to_nng`. + ``` + $ rostopic pub -1 /nnc_test/publish_to_nng std_msgs/String "Some Message" + ``` + The `rostopic echo` command will show the received message. \ No newline at end of file