This repository contains code necessary to make a ROS topic message communication between two nodes (publisher and subscriber node) using c++ and python, For every 5 counts every 10 sec in the publisher node, It should publish a message to the subscriber node and change its state.
To run the program, you need to have the following installed :
- Ubuntu 16
- ROS Kinetic http://wiki.ros.org/kinetic/Installation
add the package in your catkin_ws
$ cd ~/catkin_ws/src
$ git clone https://github.com/hosniadel666/asmarine_pkg.git
first build the package source files and run roscore
$ cd asmarine_pkg/build
$ cmake ..
$ make
$ roscore
second we run the two nodes
$ ./talker
and in another terminal run
$ ./listener
$ roscore
$ rosrun asmarine_pkg talker.py
and in another terminal run
$ rosrun asmarine_pkg listener.py
- the execution of the program should be like that :
- You can visualize the relation between nodes By using the rqt_graph ROS plugin to visualize the ROS computation graph
$ rosrun rqt_graph rqt_graph