Throttle subscriptions.

This commit is contained in:
David Walsh
2019-03-28 14:58:11 -04:00
parent c0864faebc
commit a392db84bb

View File

@@ -20,7 +20,8 @@
var modeStatus = new ROSLIB.Topic({
ros : ros,
name : '/aescape/mode/status',
messageType : 'std_msgs/String'
messageType : 'std_msgs/String',
throttle_rate : 500 // 2Hz
});
modeStatus.subscribe(function(message) {
@@ -59,7 +60,8 @@ bagPlayingTopic.subscribe(function(message) {
var frankaStatus = new ROSLIB.Topic({
ros : ros,
name : '/franka_state_controller/franka_states',
messageType : 'franka_msgs/FrankaState'
messageType : 'franka_msgs/FrankaState',
throttle_rate : 500 // 2Hz
});
frankaStatus.subscribe(function(message) {
@@ -115,7 +117,8 @@ frankaStatus.subscribe(function(message) {
var robotiqDataTopic = new ROSLIB.Topic({
ros : ros,
name : '/robotiq_ft_wrench',
messageType : 'geometry_msgs/WrenchStamped'
messageType : 'geometry_msgs/WrenchStamped',
throttle_rate : 500 // 2Hz
});
robotiqDataTopic.subscribe(function(message) {
@@ -123,7 +126,7 @@ robotiqDataTopic.subscribe(function(message) {
document.getElementById("robotiqX").innerHTML = force.x.toFixed(1)
document.getElementById("robotiqY").innerHTML = force.y.toFixed(1)
document.getElementById("robotiqZ").innerHTML = force.z.toFixed(1)
if ((Math.abs(force.x) > 0.5) || (Math.abs(force.y) > 0.5) || (Math.abs(force.z) > 0.5))
{
document.getElementById("calibrateButton").className = "btn btn-danger"