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.
0 Comments