ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
5

Has anyone written a trajectory plotting tool?

asked 2013-03-21 22:51:07 -0600

Adolfo Rodriguez T gravatar image

updated 2014-01-28 17:15:50 -0600

ngrennan gravatar image

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.

edit retag flag offensive close merge delete

Comments

Hi , David Lu could you explain how to use your program??? thanks

rem870 gravatar image rem870  ( 2013-07-31 12:22:56 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
4

answered 2018-06-07 05:42:52 -0600

Kei Okada gravatar image

updated 2018-06-07 05:44:04 -0600

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

https://github.com/tork-a/rqt_joint_t...

rqt joint trajectory plot

edit flag offensive delete link more

Comments

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?

d_joshi gravatar image d_joshi  ( 2020-10-01 23:54:36 -0600 )edit

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,

Kei Okada gravatar image Kei Okada  ( 2020-10-02 05:58:35 -0600 )edit

That worked. Thank you!

d_joshi gravatar image d_joshi  ( 2020-10-13 01:49:01 -0600 )edit

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_pt.velocities.push_back((*OP->NewVelocityVector)[0]);
joint_state.points.push_back(joint_state_pt) ;
            pub.publish(joint_state);

rqt throw err: 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'

oridong gravatar image oridong  ( 2021-01-31 01:19:45 -0600 )edit

@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?

Kei Okada gravatar image Kei Okada  ( 2021-02-01 17:48:25 -0600 )edit

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, oridong@126.com.

oridong gravatar image oridong  ( 2021-02-03 20:32:40 -0600 )edit
4

answered 2013-03-21 22:53:18 -0600

Adolfo Rodriguez T gravatar image

updated 2013-03-21 23:03:46 -0600

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?.

edit flag offensive delete link more

Comments

2

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.

Dorian Scholz gravatar image Dorian Scholz  ( 2013-03-22 01:47:24 -0600 )edit
3

answered 2013-04-03 21:25:37 -0600

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:

https://code.google.com/p/streamvis/

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. ;)

edit flag offensive delete link more

Comments

I have installed the streamvis but not able to add ROS topic to view data. How can i add ROS topic in streamvis.

bvbdort gravatar image bvbdort  ( 2014-09-04 09:36:32 -0600 )edit

Question Tools

8 followers

Stats

Asked: 2013-03-21 22:51:07 -0600

Seen: 6,654 times

Last updated: Jun 07 '18