Matlab Command/Control Scripts

SurveyorToolbox_v4.2.zip NEW, Modified 1/26/2010

Recent fixes:

  • Modified get_srv_image to work with Surveyor's 1/16/2010 SRV-1f irmware.
Previous fixes:
  • Small bug in get_srv_image for obtaining 680x512 images.
  • Modified surv.java to address network connection timeout issues
  • getImage.m is replaced w/ get_srv_image.m
  • Fixed buffer read timeout errors
  • Fixed Java memory leak

The above zipped file contains the following:

  • Java directory containing the following files surv.java, Surveyor.class, and TestApp.class
  • Matlab functions: addSurveyorJavaPath.m, initializeRobot.m, sendDriveCommand.m, get_srv_image.m, setLasers.m, setImageCaption.m, setImageQuality.m, setImageResolution.m, and shutdownRobot.m

surv.java contains the code for both the Surveyor and the TestApp class. You are welcome to modify this or use it as is.

Matlab Users

This code works with Matlab v 7.4 or later.

To start place all the *.m files and the Java directory in your working Matlab directory. To initialize the robot, at the command line type

>> srv1robot = initializeRobot('192.168.1.xx')

where 'xx' denotes the robot's ID number. Now you are ready to send robots different commands using the other Matlab functions. A brief description of what each function does is provided below. To get help on using the functions type help function_name at the Matlab command prompt. When you are done working with the robot, make sure you run the shutdownRobot.m function. Return the robot to the TAs.

Matlab Function Descriptions

addSurveyorJavaPath.m - Internal command used by initializeRobot.m to add the Java Class Path.

initializeRobot.m - Establishes connection with desired robot.

sendDriveCommand.m - Sends commands to drive the robot.

get_srv_image.m - Returns an image from the robot's camera.

setLasers.m - Turns the lasers on/off.

setImageResolution.m - Sets the resolution of the image that is sent by the robot

setImageQuality.m - Sets the quality of the JPEG image sent by the robot.

setImageCaption.m - Turns the caption on the images on/off.

shutdownRobot.m - Closes connection with the desired robot.

Return to MEM380 Course Website