Creating a URDF client

This section of code creates a URDF client, which is responsible for loading the robot's URDF file. For proper working of the URDF client, we should provide a ROS node object, TF client object, base URL for COLLADA files to load, and the 3D viewer scene object to render the URDF file. To load the meshes into the 3D viewer, we may have to use a mesh loader such as ROS3D.COLLADA_LOADER from Three.js, which is included in the beginning of the code. This loader can retrieve the COLLADA file from the robot_description parameter:

        var urdfClient = new ROS3D.UrdfClient({ 
          ros : ros, 
          tfClient : tfClient, 
          path : 'http://resources.robotwebtools.org/', 
          rootObject : viewer.scene, 
          loader : ROS3D.COLLADA_LOADER 
        }); 

After the init() function, we can see two other functions. One is for handling the slider, which can set the speed of the robot, and next function is submit_values(), which will execute when the Submit button is clicked on. This function retrieves the teleop topic and base frame name from the input text box and calls the init() function using it. This tool can be used for teleoperating all robots without changing the code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.49.106