[ROS in 5 mins] 047 – What is rqt plot

[ROS in 5 mins] 047 - What is rqt plot

Written by Ruben Alves

15/10/2018

In this video we’re going to see what is rqt_plot and how it works.

Before we start, if you are new to ROS, I highly recommend you to take any of the following courses on Robot Ignite Academy

ROS Basics In 5 Days (Python)
ROS Basics In 5 Days (C++)

The commands used during the video to create the package were the following:

cd ~/catkin_ws/src/
catkin_create_pkg tutorial rospy
cd tutorial/src/
touch learning.py
chmod +x learning.py
source ~/catkin_ws/devel/setup.bash

The content of learning.py is:

#! /usr/bin/env python
import rospy
from std_msgs.msg import Float32
from random import random

rospy.init_node(‘learning’)
pub = rospy.Publisher(‘reward’, Float32, queue_size=1)
rate = rospy.Rate(1)

while not rospy.is_shutdown():
pub.publish( random() * 50 )
rate.sleep()

And to see rqt_plot, the command was:

rqt_plot /reward

We love feedback, so, whether you like the video or not, please share your thoughts on the comments section below.

Thanks for watching.

Masterclass 2023 batch2 blog banner

Check Out These Related Posts

0 Comments

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This