Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

rqt_plot error from incomplete joint state data

I am trying to plot joint efforts from a Baxter robot in rqt_plot. I can subscribe to robot/joint_states and get the data just fine. The format for the effort portion of the data is like this (from a rostopic echo):

effort: [0.0, 0.0, -1.66, 0.0, -0.872, -4.472, -0.084, -0.168, -0.008, -0.2, -19.056, 0.216, -26.844, -0.288, 0.076, 0.056, -20.48]

However, when I try to plot individual components of this effort in rqt_plot, effort[0] is the only one that works. If I add effort[1] or higher, I get the following error:

PlotWidget.update_plot(): error in rosplot: [/robot/joint_states/effort[1]] index error for: header: ,   seq: 122200,   stamp: ,     secs: 1517944540,     nsecs: 889999872,   frame_id: '', name: [r_gripper_l_finger_joint], position: [0.0], velocity: [0.0], effort: [0.0]

My best theory for the cause is that sometimes the effort field has just one component, which seems to be what the error message above is complaining about. I don't know why this occurs, but is it possible to make rqt_plot ignore the occasional missing data and just display what shows up? Alternatively, is there a built in way to prune out this missing data before I pass it along?

I am running the latest versions of rqt_plot, Ros Kinetic, Ubuntu 16,