Skip to content

Commit

Permalink
Merge pull request #32 from rctoris/devel
Browse files Browse the repository at this point in the history
r6-devel started
  • Loading branch information
rctoris committed Apr 9, 2013
2 parents 1340190 + abf8c3d commit 08b3d29
Show file tree
Hide file tree
Showing 108 changed files with 12,445 additions and 13,655 deletions.
17 changes: 10 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
DEVEL - **r5**
* Replaces build system with Grunt (baalexander)
DEVEL - **r6**

2013-04-09 - **r5**
* Replaces build system with Grunt [(baalexander)](https://github.com/baalexander/)
* Code cleanup for linter [(baalexander)](https://github.com/baalexander/)

2013-04-02 - **r4**
* Bug in UrdfVisual origin to Pose conversion fixed (rctoris)
* Unit test infrastructure started (baalexander)
* Bug in UrdfVisual origin to Pose conversion fixed [(rctoris)](https://github.com/rctoris/)
* Unit test infrastructure started [(baalexander)](https://github.com/baalexander/)

2013-03-28 - **r3**
* URDF XML parser added (rctoris)
* URDF XML parser added [(rctoris)](https://github.com/rctoris/)

2013-03-14 - **r2**
* First stable release (rctoris, baalexander)
* First stable release [(rctoris)](https://github.com/rctoris/), [(baalexander)](https://github.com/baalexander/)

2013-03-14 - **r1**
* Initial development of ROSLIB (rctoris)
* Initial development of ROSLIB [(rctoris)](https://github.com/rctoris/)

2 changes: 1 addition & 1 deletion build/roslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

var ROSLIB = ROSLIB || {
REVISION : '5-devel'
REVISION : '6-devel'
};

//URDF types
Expand Down
2 changes: 1 addition & 1 deletion build/roslib.min.js

Large diffs are not rendered by default.

165 changes: 165 additions & 0 deletions doc/ActionClient.js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: actionlib/ActionClient.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Source: actionlib/ActionClient.js</h1>





<section>
<article>
<pre class="prettyprint source"><code>/**
* @author Russell Toris - rctoris@wpi.edu
*/

/**
* An actionlib action client.
*
* Emits the following events:
* * 'timeout' - if a timeout occurred while sending a goal
* * 'status' - the status messages received from the action server
* * 'feedback' - the feedback messages received from the action server
* * 'result' - the result returned from the action server
*
* @constructor
* @param options - object with following keys:
* * ros - the ROSLIB.Ros connection handle
* * serverName - the action server name, like /fibonacci
* * actionName - the action message name, like 'actionlib_tutorials/FibonacciAction'
* * timeout - the timeout length when connecting to the action server
*/
ROSLIB.ActionClient = function(options) {
var that = this;
options = options || {};
this.ros = options.ros;
this.serverName = options.serverName;
this.actionName = options.actionName;
this.timeout = options.timeout;
this.goals = {};

// flag to check if a status has been received
var receivedStatus = false;

// create the topics associated with actionlib
var feedbackListener = new ROSLIB.Topic({
ros : this.ros,
name : this.serverName + '/feedback',
messageType : this.actionName + 'Feedback'
});

var statusListener = new ROSLIB.Topic({
ros : this.ros,
name : this.serverName + '/status',
messageType : 'actionlib_msgs/GoalStatusArray'
});

var resultListener = new ROSLIB.Topic({
ros : this.ros,
name : this.serverName + '/result',
messageType : this.actionName + 'Result'
});

this.goalTopic = new ROSLIB.Topic({
ros : this.ros,
name : this.serverName + '/goal',
messageType : this.actionName + 'Goal'
});

this.cancelTopic = new ROSLIB.Topic({
ros : this.ros,
name : this.serverName + '/cancel',
messageType : 'actionlib_msgs/GoalID'
});

// advertise the goal and cancel topics
this.goalTopic.advertise();
this.cancelTopic.advertise();

// subscribe to the status topic
statusListener.subscribe(function(statusMessage) {
receivedStatus = true;
statusMessage.status_list.forEach(function(status) {
var goal = that.goals[status.goal_id.id];
if (goal) {
goal.emit('status', status);
}
});
});

// subscribe the the feedback topic
feedbackListener.subscribe(function(feedbackMessage) {
var goal = that.goals[feedbackMessage.status.goal_id.id];
if (goal) {
goal.emit('status', feedbackMessage.status);
goal.emit('feedback', feedbackMessage.feedback);
}
});

// subscribe to the result topic
resultListener.subscribe(function(resultMessage) {
var goal = that.goals[resultMessage.status.goal_id.id];

if (goal) {
goal.emit('status', resultMessage.status);
goal.emit('result', resultMessage.result);
}
});

// If timeout specified, emit a 'timeout' event if the action server does not respond
if (this.timeout) {
setTimeout(function() {
if (!receivedStatus) {
that.emit('timeout');
}
}, this.timeout);
}
};
ROSLIB.ActionClient.prototype.__proto__ = EventEmitter2.prototype;

/**
* Cancel all goals associated with this ActionClient.
*/
ROSLIB.ActionClient.prototype.cancel = function() {
var cancelMessage = new ROSLIB.Message();
this.cancelTopic.publish(cancelMessage);
};

</code></pre>
</article>
</section>




</div>

<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="ROSLIB.ActionClient.html">ActionClient</a></li><li><a href="ROSLIB.Goal.html">Goal</a></li><li><a href="ROSLIB.Message.html">Message</a></li><li><a href="ROSLIB.Param.html">Param</a></li><li><a href="ROSLIB.Pose.html">Pose</a></li><li><a href="ROSLIB.Quaternion.html">Quaternion</a></li><li><a href="ROSLIB.Ros.html">Ros</a></li><li><a href="ROSLIB.Service.html">Service</a></li><li><a href="ROSLIB.ServiceRequest.html">ServiceRequest</a></li><li><a href="ROSLIB.ServiceResponse.html">ServiceResponse</a></li><li><a href="ROSLIB.TFClient.html">TFClient</a></li><li><a href="ROSLIB.Topic.html">Topic</a></li><li><a href="ROSLIB.Transform.html">Transform</a></li><li><a href="ROSLIB.UrdfBox.html">UrdfBox</a></li><li><a href="ROSLIB.UrdfColor.html">UrdfColor</a></li><li><a href="ROSLIB.UrdfCylinder.html">UrdfCylinder</a></li><li><a href="ROSLIB.UrdfLink.html">UrdfLink</a></li><li><a href="ROSLIB.UrdfMaterial.html">UrdfMaterial</a></li><li><a href="ROSLIB.UrdfMesh.html">UrdfMesh</a></li><li><a href="ROSLIB.UrdfModel.html">UrdfModel</a></li><li><a href="ROSLIB.UrdfSphere.html">UrdfSphere</a></li><li><a href="ROSLIB.UrdfVisual.html">UrdfVisual</a></li><li><a href="ROSLIB.Vector3.html">Vector3</a></li></ul><h3>Global</h3><ul><li><a href="global.html#ROSLIB">ROSLIB</a></li></ul>
</nav>

<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Tue Apr 09 2013 11:13:19 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
</body>
</html>
131 changes: 131 additions & 0 deletions doc/Goal.js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: actionlib/Goal.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Source: actionlib/Goal.js</h1>





<section>
<article>
<pre class="prettyprint source"><code>/**
* @author Russell Toris - rctoris@wpi.edu
*/

/**
* An actionlib goal goal is associated with an action server.
*
* Emits the following events:
* * 'timeout' - if a timeout occurred while sending a goal
*
* @constructor
* @param object with following keys:
* * actionClient - the ROSLIB.ActionClient to use with this goal
* * goalMessage - The JSON object containing the goal for the action server
*/
ROSLIB.Goal = function(options) {
var that = this;
this.actionClient = options.actionClient;
this.goalMessage = options.goalMessage;
this.isFinished = false;

// Used to create random IDs
var date = new Date();

// Create a random ID
this.goalID = 'goal_' + Math.random() + '_' + date.getTime();
// Fill in the goal message
this.goalMessage = new ROSLIB.Message({
goal_id : {
stamp : {
secs : 0,
nsecs : 0
},
id : this.goalID
},
goal : this.goalMessage
});

this.on('status', function(status) {
that.status = status;
});

this.on('result', function(result) {
that.isFinished = true;
that.result = result;
});

this.on('feedback', function(feedback) {
that.feedback = feedback;
});

// Add the goal
this.actionClient.goals[this.goalID] = this;
};
ROSLIB.Goal.prototype.__proto__ = EventEmitter2.prototype;

/**
* Send the goal to the action server.
*
* @param timeout (optional) - a timeout length for the goal's result
*/
ROSLIB.Goal.prototype.send = function(timeout) {
var that = this;
that.actionClient.goalTopic.publish(that.goalMessage);
if (timeout) {
setTimeout(function() {
if (!that.isFinished) {
that.emit('timeout');
}
}, timeout);
}
};

/**
* Cancel the current goal.
*/
ROSLIB.Goal.prototype.cancel = function() {
var cancelMessage = new ROSLIB.Message({
id : this.goalID
});
this.actionClient.cancelTopic.publish(cancelMessage);
};
</code></pre>
</article>
</section>




</div>

<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="ROSLIB.ActionClient.html">ActionClient</a></li><li><a href="ROSLIB.Goal.html">Goal</a></li><li><a href="ROSLIB.Message.html">Message</a></li><li><a href="ROSLIB.Param.html">Param</a></li><li><a href="ROSLIB.Pose.html">Pose</a></li><li><a href="ROSLIB.Quaternion.html">Quaternion</a></li><li><a href="ROSLIB.Ros.html">Ros</a></li><li><a href="ROSLIB.Service.html">Service</a></li><li><a href="ROSLIB.ServiceRequest.html">ServiceRequest</a></li><li><a href="ROSLIB.ServiceResponse.html">ServiceResponse</a></li><li><a href="ROSLIB.TFClient.html">TFClient</a></li><li><a href="ROSLIB.Topic.html">Topic</a></li><li><a href="ROSLIB.Transform.html">Transform</a></li><li><a href="ROSLIB.UrdfBox.html">UrdfBox</a></li><li><a href="ROSLIB.UrdfColor.html">UrdfColor</a></li><li><a href="ROSLIB.UrdfCylinder.html">UrdfCylinder</a></li><li><a href="ROSLIB.UrdfLink.html">UrdfLink</a></li><li><a href="ROSLIB.UrdfMaterial.html">UrdfMaterial</a></li><li><a href="ROSLIB.UrdfMesh.html">UrdfMesh</a></li><li><a href="ROSLIB.UrdfModel.html">UrdfModel</a></li><li><a href="ROSLIB.UrdfSphere.html">UrdfSphere</a></li><li><a href="ROSLIB.UrdfVisual.html">UrdfVisual</a></li><li><a href="ROSLIB.Vector3.html">Vector3</a></li></ul><h3>Global</h3><ul><li><a href="global.html#ROSLIB">ROSLIB</a></li></ul>
</nav>

<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Tue Apr 09 2013 11:13:19 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
</body>
</html>
Loading

0 comments on commit 08b3d29

Please sign in to comment.