joint_state_publisher_js not showing sliders
Hi, I have been testing the package from robotwebtools called joinstatepublisher_js. The main purpose of this package is to control a 3d urdf model through the explorer. I'm using ubuntu 14.04 and ROS indigo.
Well, the problem is that the sliders, which should appear at the right of the 3d model, are not being represented, it's an empty space in my case. The 3D representantion runs properly. I have followed the brief tutorial, so I'm getting the model r2d2.xacro from the urdf_tutorial package to test it. I don't know if something is going wrong in this package or what is the problem, I have only got the code from the tutorial.
Thank you very much! Regards
EDIT: Note that packages jointstatepublisherjs and jointstatepublisher are not the same. Anyway I tried to set the usegui param true, but It didn't work.
EDIT2: I attach the html code I'm using, it's the same the tutorial gives.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="http://cdn.robotwebtools.org/threejs/current/three.min.js"></script>
<script src="http://cdn.robotwebtools.org/threejs/current/ColladaLoader.min.js"></script>
<script src="http://cdn.robotwebtools.org/ColladaAnimationCompress/current/ColladaLoader2.min.js"></script>
<script src="http://cdn.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
<script src="http://cdn.robotwebtools.org/roslibjs/current/roslib.min.js"></script>
<script src="http://cdn.robotwebtools.org/ros3djs/current/ros3d.min.js"></script>
<script src="http://cdn.robotwebtools.org/joint_state_publisher_js/current/jointstatepublisher.min.js"></script>
<script>
/**
* Setup all visualization elements when the page is loaded.
*/
function init() {
// Connect to ROS.
var ros = new ROSLIB.Ros({
url : 'ws://localhost:9090'
});
// Create the main viewer.
var viewer = new ROS3D.Viewer({
divID : 'urdf',
width : 800,
height : 600,
antialias : true
});
// Add a grid.
viewer.addObject(new ROS3D.Grid());
// Setup a client to listen to TFs.
var tfClient = new ROSLIB.TFClient({
ros : ros,
angularThres : 0.01,
transThres : 0.01,
rate : 10.0
});
// Setup the URDF client.
var urdfClient = new ROS3D.UrdfClient({
ros : ros,
tfClient : tfClient,
path : 'http://resources.robotwebtools.org/',
rootObject : viewer.scene,
loader : ROS3D.COLLADA_LOADER_2
});
var jsp = new JOINTSTATEPUBLISHER.JointStatePublisher({
ros : ros,
divID : 'sliders'
});
}
</script>
</head>
<body onload="init()">
<div id="sliders" style="float: right"></div>
<div id="urdf"></div>
</body>
</html>
I'm using the r2d2 urdf movable model given my the urdftutorial package, you can find it there: https://github.com/ros/urdftutorial/blob/master/urdf/06-flexible.urdf
If I run the model by rviz and execute the normal jointstatepublisher I get it working and the joint menu appears when I set it to true. So I think the trouble is not in the model execution, because I can also view it properly on the web browser.
The command I use to set it up is the following:
roslaunch joint_state_publisher_js run_with_xacro.launch model:=/opt/ros/jade/share/urdf_tutorial/urdf/06-flexible.urdf
EDIT 3:
Thanks for your answer! I've checked it and I get the following messages:
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create "THREE.WebGLRenderer" "61" ReferenceError: JOINTSTATEPUBLISHER is not defined
I don't know why it says it's not defined when it really is.
EDIT 4:
I've been checking the source files and I' ve realised the last package source (http://cdn.robotwebtools.org/joint_state_publisher_js/current/jointstatepublisher.min.js) is not available, so I have set it through a local path. However it's not running properly yet. Now it's showing me an error from another source:
-If I use roslib.min.js version (http://cdn.robotwebtools.org/roslibjs/current/roslib.min.js):
TypeError: a is not a function1 roslib.min.js:1:7104
-If I use roslib.js version (http://cdn.robotwebtools.org/roslibjs/current/roslib.js):
TypeError: callback is not a function roslib.js:552:4
Any idea? Thanks again!
Asked by rubenvm on 2015-08-05 20:20:38 UTC
Comments
Are there any errors in the 'javascript console'? Not sure what it is called in other browsers (I mainly use Firefox).
Asked by gvdhoorn on 2015-08-06 05:28:18 UTC
I posted the same error on the RWT google groups and the CND link was updated. Try this http://cdn.robotwebtools.org/jointstatepublisherjs/current/jointstatepublisher.min.js It works for me now.
Asked by Shawn Schaerer on 2015-10-16 20:39:22 UTC