ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You need to tell the Collada loader where the meshes live (they must come from an HTTP file server as roslibjs has no access to the ROS file system). If a resource is package://pr2_description/meshes/base_v0/base.dae, roslibjs will replace this with http://localhost/pr2_description/meshes/base_v0/base.dae by default. You can change the preface with an optional argument.

Since you are using the PR2 meshes, you can use the Robot Web Tools file servers (http://wiki.ros.org/ros3djs#Mesh_Resource_Hosting). Any custom meshes will have to be setup on your local HTTP server. Setting up the interactive marker client to read from this server is similar to the line in this URDF example (http://wiki.ros.org/ros3djs/Tutorials/VisualizingAURDF#CA-ebdaf15416b7824dac6da89212baebbaf5c6df83_45). That is,

var imClient = new ROS3D.InteractiveMarkerClient({
  ros : ros,
  tfClient : tfClient,
  topic : '/basic_controls',
  camera : viewer.camera,
  rootObject : viewer.selectableObjects,
  path : 'http://resources.robotwebtools.org/'
});

Doc line as well: https://github.com/RobotWebTools/ros3djs/blob/develop/src/interactivemarkers/InteractiveMarkerClient.js#L14