Rosanswers logo

Adam Leeper asked on ros-users:

I'd like a tool that plots a series of joint trajectories. In my work, I continuously re-plan motions, meaning I need each trajectory to spline smoothly at a particular time with the previously commanded trajectory. Having a graphical tool to verify that this is happening correctly would be very useful.

Has anyone already written such a tool? Otherwise, I guess I'll start getting familiar with rqt and matplotlib...

David Lu answered on ros-users:

I have a tool based around a library here: https://code.google.com/p/wu-robotics/source/browse/trunk/precise_trajectory/graph_trajectory/src/graph_trajectory/__init__.py

It also uses a JointWatcher to record the values that are actually performed. https://code.google.com/p/wu-robotics/source/browse/trunk/precise_trajectory/pr2_precise_trajectory/src/pr2_precise_trajectory/joint_watcher.py

Dorian Scholz answered on ros-users:

the rqt GUI has a 2D plotter rqt_plot that can plot numerical data from messages. It is very similar to rxplot, but there is no restriction (as far as I know) on how many variables can be plotted. It's just dependent on you CPU power... rqt_plot has three different drawing backends selectable from it's configuration menu:

  • qwt plot (fast, but not using message timestamps and needs python-qwt bindings)
  • pyqtgraph (fast and needs pyqtgraph to be installed which is not in the repos)
  • matplotlib (slow but always available)

Dirk Thomas answered on ros-users:

Even without any further information how you want to plot the trajectories I would recommend looking into QGraphicsScene as the backend. May be this is a better fit than using matplotlib.

Originally posted by Adolfo Rodriguez T on ROS Answers with karma: 3907 on 2013-03-21

Post score: 5

Original comments

Comment by rem870 on 2013-07-31:
Hi , David Lu could you explain how to use your program???



3 Answers 3


Rosanswers logo

recently my college wrote the rqt plugin for visualize joint trajectory , try apt-get install ros-kinetic-rqt-joint-trajectory-plot


rqt joint trajectory plot

Originally posted by Kei Okada with karma: 1186 on 2018-06-07

This answer was ACCEPTED on the original site

Post score: 4

Original comments

Comment by d_joshi on 2020-10-01:
I tried apt-get install ros-melodic-rqt-joint-trajectory-plot but the JointTrajectoryPlot option does not appear in rqt (Plugins->Visualization). Am I missing a step?

Comment by Kei Okada on 2020-10-02:
rqt couldn't find plugins, just after it's install. But you can force update cache? of installed plugins by running rqt rqt --force-discover,

Comment by d_joshi on 2020-10-13:
That worked. Thank you!

Comment by oridong on 2021-01-31:
the examples given works well,but my own

"auto pub =n.advertise<trajectory_msgs::JointTrajectory>("trajV_reflexx", 1000); "

doesn't work.

    trajectory_msgs::JointTrajectory joint_state; 
trajectory_msgs::JointTrajectoryPoint joint_state_pt; 
joint_state.points.push_back(joint_state_pt) ;

rqt throw err: [ERROR] [1612077374.663698]: bad callback: <bound method MainWidget.callback of <rqt_joint_trajectory_plot.main_widget.MainWidget object at 0x7f86614cd670>> Traceback (most recent call last): File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 748, in _invoke_callback cb(msg, cb_args) File "/home/d/planning/ws_traj/src/rqt_joint_trajectory_plot/src/rqt_joint_trajectory_plot/main_widget.py", line 109, in callback msg = JointTrajectory().deserialize(anymsg._buff) AttributeError: 'JointTrajectory' object has no attribute '_buff'

Comment by Kei Okada on 2021-02-01:
@oridong thanks for the feedback. How can I re-produce your problem? Could you provide a bag file or source code to publish your example?

Comment by oridong on 2021-02-03:
yes, would you mind leaving me your e-mail, I would send you a simple example. if you find my faulty ,you can modify it , just to make it that trajectory_msgs::JointTrajectory can be plotted. or you could send me your demo, [email protected].


Rosanswers logo

I've used rxplot to visualize joint trajectory messages as they are being sent to the controllers. The downside is that there is no proper way to reconstruct the spline. For example, you can visualize the position of the waypoints and see the plotting tool reconstruct a smooth curve, but you can't enforce the actual waypoint velocity and acceleration specified in the message.

I don't know if there exists an rqt plugin for reconstructing splines from JointTrajectory messages, but if not, it would be a very valuable addition.

A question from my side would be: are you explicitly computing the blending patches for trajectory replacement, or are you letting the controller (eg. joint trajectory action controller) do that for you?.

Originally posted by Adolfo Rodriguez T with karma: 3907 on 2013-03-21

This answer was NOT ACCEPTED on the original site

Post score: 4

Original comments

Comment by Dorian Scholz on 2013-03-22:
rqt_plot does not know anything about trajectories, it just plots numeric data over time (like rxplot, but with a choice of multiple plotting backends). Feel free to add a plugin for trajectory plotting, which can reuse the plotting backends.


Rosanswers logo

We had a student in our lab who implement a real-time plotting tool that worked pretty well under ROS (but also supports YARP) displaying numerous trajectories at high frequencies. Rxplot used to not deliver in those situations. You can have a look at it here:


I am still using the tool under fuerte. Don't know if it works under groovy out of the box. The user community is pretty small but the tool is still supported. In case you encounter installation problems do not hesitate to send an email. ;)

Originally posted by Georg Bartels with karma: 157 on 2013-04-03

This answer was NOT ACCEPTED on the original site

Post score: 3

Original comments

Comment by bvbdort on 2014-09-04:
I have installed the streamvis but not able to add ROS topic to view data. How can i add ROS topic in streamvis.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.