[ROS Q&A] 145 – Customize plot axis with rqt_multiplot

[ROS Q&A] 145 - Customize plot axis with rqt_multiplot

Written by Alberto Ezquerro

02/08/2018

In this video we are going to see how to customize the axis of your plot, using the rqt_multiplot tool.

Step1. Create a project in Robot Ignite Academy(RIA)

We have the best online ROS course available in RIA. It helps you learn ROS in the easiest way without setting up ROS environment locally. The only thing you need is a browser! Create an account here and start to browse the trial course for free now! We’ll use the Using OpenAI with ROS unit 0 as an example today.

Step2. Plot with rqt_plot and rqt_multiplot

Let’s start by running the example

roslaunch cartpole_v0_training start_training.launch

You’ll see that the robot starts to move and learning to stand. The reward of each episode is publishing to the topic /openai/reward. You can see that with the following command

rostopic echo /openai/reward

It’s hard to tell the trend of the reward in the terminal. It will be nicer if we can plot it into a figure. We can use the rqt_plot tool to do it. You can run the following command to open rqt_plot.

rosrun rqt_plot rqt_plot

Then you have to open the graphical tool by click the monitor icon next to the simulation.

You can select the topic that you want to plot in rqt_plot. Let’s type openai/reward.  The tool plot the reward for us, but it’s not updating.

With rqt_plot, the x-axis is always the timestamp. The problem is, in openai gym, the environment keeps resetting itself, so the reward value is overriding itself.

To solve this problem, we need another tool called rqt_multiplot.

rosrun rqt_multiplot rqt_multiplot

After opening it, click on the configure plot button(gear shape) and select the /openai/reward topic again. We select the episode number as our x-axis and the reward as our y-axis. Then hit enter.

Select the curve and click ok. Then click the play button. You should see it’s plotting. The rewards over episodes plot show the training progress much better in this case!

Want to learn more?

If you are interested in this topic, you can check our Using OpenAI with ROS Online Course.

 

Edit by: Tony Huang


RELATED LINKS

ROS Development Studio (RDS)
Robot Ignite Academy
Using OpenAI with ROS Online Course


Feedback

Did you like this video? Do you have questions about what is explained? Whatever the case, please leave a comment on the comments section below, so we can interact and learn from each other.

If you want to learn about other ROS topics, please let us know on the comments area and we will do a video about it.

Topics:

Discover How to Equip Your Teams with ROS Skills Fast

The Construct For Enterprise

Check Out These Related Posts

5 Mistakes Robotics & ROS Teachers Make

5 Mistakes Robotics & ROS Teachers Make

Last week, a colleague of mine asked me for advice on how to teach ROS at university because she is going to start delivering a ROS class next month. Then I decided to record this video with 5 mistakes I have made in the past while teaching ROS at the university. I hope that this video is useful for you and helps you avoid the mistakes that I made so you can start delivering ROS classes smoothly.

read more

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.

Share This