Skip to content

Commit

Permalink
Merge pull request #64 from adamantivm/latched-publisher
Browse files Browse the repository at this point in the history
Adds latch parameter to Topics for publishing
  • Loading branch information
rctoris committed Feb 16, 2014
2 parents effb20c + 7564840 commit ecbb719
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/Topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ROSLIB.Topic = function(options) {
this.isAdvertised = false;
this.compression = options.compression || 'none';
this.throttle_rate = options.throttle_rate || 0;
this.latch = options.latch || false;

// Check for valid compression types
if (this.compression && this.compression !== 'png' && this.compression !== 'none') {
Expand Down Expand Up @@ -99,7 +100,8 @@ ROSLIB.Topic.prototype.advertise = function() {
op : 'advertise',
id : advertiseId,
type : this.messageType,
topic : this.name
topic : this.name,
latch : this.latch
};
this.ros.callOnConnection(call);
this.isAdvertised = true;
Expand Down Expand Up @@ -136,7 +138,8 @@ ROSLIB.Topic.prototype.publish = function(message) {
op : 'publish',
id : publishId,
topic : this.name,
msg : message
msg : message,
latch : this.latch
};
this.ros.callOnConnection(call);
};

0 comments on commit ecbb719

Please sign in to comment.