PR2 / pr2_mechanism

Infrastructure to control the PR2 robot in a hard realtime control loop.
Other
29 stars 27 forks source link

pr2_controller_manager/joints_to_diagnostics.py reports diagnostics at 0.5Hz (ros ticket #3878) #264

Closed ahendrix closed 11 years ago

ahendrix commented 11 years ago

Problems with this script:

Script fixes:

This determines publish time, and can screw up with just a little bit of jitter: {{{ def state_cb(msg): global last_publish_time now = rospy.get_rostime() if (now - last_publish_time).to_sec() > 1.0: d = DiagnosticArray() d.header.stamp = msg.header.stamp if msg.joint_statistics == []: ds = DiagnosticStatus() ds.level = 0 ds.message = 'No Joint states published by the controller manager' ds.name = "Joints: none" d.status = [ds] else: d.status = [joint_to_diag(js) for js in msg.joint_statistics] pub_diag.publish(d) last_publish_time = now }}}

trac data:

ahendrix commented 11 years ago

[watts] Should ROS_WARN and stop publishing if no messages for 3-5 seconds. ROS_WARN at startup if no messages for 10 seconds (initially), but don't publish to diagnostics

ahendrix commented 11 years ago

[wim] For the max: it is the controller manager that keeps track of the max value; the script only publishes this value to diagnostics. I don't think the script needs to store a state to keep track of the max.

ahendrix commented 11 years ago

[watts] The max value is the max value over the CM's publish interval. Since joints_to_diags doesn't publish every value, we need to track the max over joint_to_diags publish interval.

ahendrix commented 11 years ago

[watts] We're losing data because of this.

ahendrix commented 11 years ago

[watts] r32526 for all of these fixes.

ahendrix commented 11 years ago

[watts] r32624 for python version. max/min values still incorrect. Since its fixed in the CPP version, I think we're OK.

After talking with Wim and Ken, I'm going to spin out the CPP version to the sandbox, to pr2_mechanism_diagnostics. See #3941 for details on what it's supposed to do.

r32626 for removal.