Skip to content

Commit

Permalink
Merge pull request #167 from psoetens/indigo-devel
Browse files Browse the repository at this point in the history
Indigo devel
  • Loading branch information
rctoris committed Mar 9, 2015
2 parents 731f1b6 + 9d695ae commit c2962d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/core/Topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ var Message = require('./Message');
* * name - the topic name, like /cmd_vel
* * messageType - the message type, like 'std_msgs/String'
* * compression - the type of compression to use, like 'png'
* * throttle_rate - the rate at which to throttle the topics
* * throttle_rate - the rate (in ms in between messages) at which to throttle the topics
* * queue_size - the queue created at bridge side for re-publishing webtopics (defaults to 100)
* * latch - latch the topic when publishing
* * queue_length - the queue length at bridge side used when subscribing (defaults to 0, no queueing).
*/
function Topic(options) {
options = options || {};
Expand All @@ -30,6 +33,7 @@ function Topic(options) {
this.throttle_rate = options.throttle_rate || 0;
this.latch = options.latch || false;
this.queue_size = options.queue_size || 100;
this.queue_length = options.queue_length || 0;

// Check for valid compression types
if (this.compression && this.compression !== 'png' &&
Expand Down Expand Up @@ -73,7 +77,7 @@ Topic.prototype.subscribe = function(callback) {
topic: this.name,
compression: this.compression,
throttle_rate: this.throttle_rate,
queue_length: this.queue_size
queue_length: this.queue_length
});
};

Expand Down
9 changes: 8 additions & 1 deletion src/math/Quaternion.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ Quaternion.prototype.conjugate = function() {
this.z *= -1;
};

/**
* Return the norm of this quaternion.
*/
Quaternion.prototype.norm = function() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
};

/**
* Perform a normalization on this quaternion.
*/
Expand Down Expand Up @@ -81,4 +88,4 @@ Quaternion.prototype.clone = function() {
return new Quaternion(this);
};

module.exports = Quaternion;
module.exports = Quaternion;

0 comments on commit c2962d5

Please sign in to comment.