ROS tutorials - ROS services & RQT Console | ENPM 808X
Overview
An implementation of ROS tutorial for a simple publisher/subscriber setup with service routines to change the published text and rates
Dependencies
- The implementation setup requires ROS kinetic and catkin running on Ubuntu 16.04 distribution
- Follow the tutorial to install ROS
- Follow the link to install catkin
Building the repo via command-line
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
source devel/setup.bash
cd src/
git clone -b Week10_HW --recursive https://github.com/vijay4313/beginner_tutorials.git
cd ..
catkin_make
Running Demo
To run the demo:
- Open a new terminal and type
roscore
This initiates the ROS system and its dependencies
- Run the talker (Publisher) in a new terminal
cd ~catkin_ws
source ./devel/setup.bash
rosrun beginner_tutorials talker
- Run the listener (Subscriber) in a new terminal
cd ~catkin_ws
source ./devel/setup.bash
rosrun beginner_tutorials listener
Stop the program by typing Ctrl+C in each terminal
Running Using Launch file
roslaunch beginner_tutorials pubsub.launch
The launcher will launch both publisher and subscriber in separate terminals with default text and publish frequency
Modifying the display text
In a separate terminal:
cd ~/catkin_ws/
source devel/setup.bash
rosservice call /talker/change_string 'ENPM808X'
Setting logger levels
rosrun rqt_logger_level rqt_logger_level
Select the node and select logger level as needed form the GUI
Viewing the logger messages
In a new terminal
rqt_console