Documentation

Using the Remote Lab

The current website for the remote lab resides at the following location SITE HERE

Using the current example

The current web example allows two types of interaction with the robot. Below we show two images showing the interface with the different different control methods. These interfaces are on the left hand side. The user can click upon the tab, hilighted in red, two switch between the interfaces. On the right hand side is the camera stream. In the image the user has the ability to view 3 camera images at once however the website may have less than this. The user can select between muliple camera streams using the box. The middle of the interfaces is a three dimensional visualization of the robot. The user can move the sections of the interface to be hidden or larger as they needed using the sliders hilighted in blue.



The first allows the user to select objects and runs an autonomous controller. On the left hand side



The second allows more direct control of the robot. Users may move the webjoystick to drive the base. The keyboard is used to move the arms and hands.

If you are serving the website elsewhere or creating your own site. There are currently two servers provided for the remote lab. The first is frodo - frodo provides the interface to the robot through rosjs. The second is shelob - shelob provides the mjpeg_server which serves the images. The current IP for both of these servers is 66.134.138.102.

Modifying/Creating your own interface

To create or make your own interface it is best to know some Javascript and to have read the rosjs tutorial if you have never used rosjs before.

Widgets for robot functionality

The goal of widgets is to encapsulate commonly used functionality in a way that is easy to add to a website. The goal of the widgets is to only require the user to only create a location for the widget within the web interface and provide information about that location and perhaps additional information about the display or types of messages the interface requires. The widget should handle the subscription to the messages as well as displaying the information. Widgets use the widgetmanager in wviz/ros/widgets. In order for the widgetmanager to know about a widget it must be included preferably in the wviz/ros/widgets/widgets.js file.
Creating a new widget
  • Write a javascript file that provides functionality that is easily transferable to new web interfaces.
  • Add widget file to be included in the ros object. Prefereably using the following file wviz/ros/widgets/widgets.js
    Using a widget
  • The widget can then be added by declaring a new instantiation of the widget. For example the following call will create a new mjpeg widget:
    var video1 = new ros.widgets.MJPEGWidget("image_display1",video_width, video_height, url1);
    The variables in the parens are arguments specific to camera streaming and will be explained when we describe camera feeds.

    3d visualization

    Adding a camera feed

    The remote lab uses an mjpeg_server to stream topics with the type sensor_msgs/Image. In order to subscribe to messages, the developer uses a url to interact with the mjpeg_server. Through the url the developer can specify the height, width, and resolution of the image that is provided. For example, the following url:
    shelob:8080/?topic=/remote_lab_cam0/image_raw?width=320?height=240?quality=30 sends a message to the mjpeg_server served from shelob on port 8080 and requests the mjpeg_server send images from the /remote_lab_cam0/image_raw with width 320, height 240 and an image quality of 30.

    The recommended way of adding a camera feed to a new interface is to use the following code to create a new mjpeg widget that serves:

    within the javascript section of the webpage:
    var video1=new.ros.widgetsMJPEGWidet("image_display1", 320, 240, shelob:8080/??topic=/remote_lab_cam0/image_raw?width=320?height=240?\quality=30);
    in the html the following line of code is all that is required is the following line
    <div id="image_display1"></div>

    The camera feed in the example interface
    In the example interface we constructed an interface that allows users to select between multiple camera images. To add another image to this simply add another option to the sector with id camera_stream_selector1. In order to use multiple camera streams without running into memory problems we use iframes. The callback for the selector sends the desired url to another page (mjpeg_iframe_web.html) which then handles refreshing when a new camera stream is requested.

    Setting up Remote Access on a Robot

    This section will cover setting up a remote interface on a PR2 robot. However, it should be noted that while this documentation is for a PR2 the tools can generally be used on any robot. Many of these tools have been used by Crick et al. to create a remote lab for HRI studies using a iRobot Create robot. We plan to generalize these instructions to general robots using ROS.

    Installation of Software

    The current remote lab interface in its entirety depends on several packages that are not part of the PR2's default software must be downloaded and installed. Many of the additional packages are in the bosch-ros-pkg. In order to download the remote lab portion of the repository. This is probably best done using an svn checkout: svn co https://bosch-ros-pkg.svn.sourceforge.net/svnroot/bosch-ros-pkg/trunk/stacks/remote_lab/ remote_lab The website for the bosch-ros-pkg can be found at the following location: https://sourceforge.net/projects/bosch-ros-pkg/
    rosjs
    The remote lab interface uses Javascript for visualization and interacting with ROS. rosjs is a lightweight Javascript binding for ROS. rosjs resides in the brown-ros-pkg. Documentation and instructions for installation can be found at: http://code.google.com/p/brown-ros-pkg/wiki/rosjs
    mjpeg_server
    The mjpeg_server allows image messages being published in ROS to be streamed over the web as mjpegs. While rosjs can transmit images this allows the interface to benefit from optimizations to the web browswer to efficiently download images. The mjpeg_server is located in the bosch-ros-pkg in the remote_lab directory.
    pr2_pickandplace_service
    The pr2_pickandplace_service wraps the pr2_pickandplace_demos created by Matei Ciocarlie and Kaijen Hsiao. This code is also located in the bosch-ros-pkg is located in the remote_lab directory. The code allows the user to indicate which objects to pick up and set down and the robot autonoumously performs the manipulation.

    Packages to Run/ Launch Files

    Once the required software is installed the correct packages must be started. In the wviz package in the remote_lab directory we provide some of the necessary files in the launch directory. The basic_startup.launch file will launch the majority of the required packages. After launching this run the following commands in the wviz/launch directory:
    rosrun rosrun pr2_controller_manager pr2_controller_manager stop l_arm_controller
    rosrun rosrun pr2_controller_manager pr2_controller_manager stop r_arm_controller
    roslaunch jtteleop.launch

    Serving the Website

    Once the following commands are launched you may serve the website (located in the wviz directory) from any location you like. You must change lines lines 37 and 38 to point to the correct web addresses/ IPs. Once you have the website served you can look above at how to use the remote lab. This will allow you to begin to edit

    Planned/Desired Improvements