Matlab

From RobotinoWiki

Installation

Robotino matlab icon 64.png A full set of m-Files and Simulink blocks is available for controlling all actuators of Robotino and reading all of its sensors. Download the executable and run the installer.

Package links

Robotino Matlab drivers

Running Robotino MATLAB drivers with 32 bit MATLAB

A C compiler is required to load the Robotino MATLAB drivers and fortunately, MATLAB provides a lcc-win32 compiler out-of-the-box. You need to make sure that this compiler is selected as the default one which can be done by running the following command in MATLAB's Command Prompt.

mex -setup

And select the Lcc-win32 compiler as default and confirm.

Running Robotino MATLAB drivers with 64 bit MATLAB

From MATLAB's website, "Unlike the 32-bit version of MATLAB, which bundles the lcc compiler, the 64-bit version of MATLAB does not include a C compiler. If you use a MathWorks product or feature that requires a C compiler, you will need to install a compiler separately."Depending on the MATLAB version you have installed on your machine, you will need to install a supported C compiler.

Supported C Compilers for different MATLAB Versions

  1. R2011b
  2. R2011a
  3. R2010b
  4. R2010a
  5. R2009b
  6. R2009a

Once you have installed the supported compiler for your 64bit MATLAB version, you will need to run the following command in MATLAB's Commmand Prompt to select the installed compiler as the default one

mex -setup

Using the Robotino MATLAB drivers

The installation sets an environment variable 'ROBOTINOMATLAB_DIR' which points to the 'RobotinoMatlab' dir. Change the working directory to 'RobotinoMatlab' by simply entering the following in MATLAB's Command Window

cd ( getenv('ROBOTINOMATLAB_DIR'))

You will also need to add the 'toolbox' and 'blockset' directories to MATLAB's search path. This can be done as follows

addpath( strcat( getenv('ROBOTINOMATLAB_DIR'), '/blockset' ) );
addpath( strcat( getenv('ROBOTINOMATLAB_DIR'), '/toolbox' ) );

or you could also just run the 'startup.m' file in RobotinoMatlab folder to add the directories to MATLAB's search path.

Robotino Toolbox [MATLAB m-files]

The Robotino Toolbox provides an extensive set of MATLAB functions which enable users to control nearly all actuators of Robotino and read all of its sensors in MATLAB. The m-files are located in the 'RobotinoMatlab/toolbox' directory. Robotino's Toolbox contains MATLAB functions for the following sensors and actuators.

MATLAB drivers for Robotino

  1. AnalogInput
  2. Bumper
  3. Com
  4. Camera
  5. DigitalInput
  6. DigitalOutput
  7. DistanceSensor
  8. EncoderInput
  9. Gripper
  10. Info
  11. LaserRangeFinder
  12. Manipulator
  13. Motor
  14. NorthStar
  15. Odometry
  16. OmniDrive
  17. PowerManagement
  18. PowerOutput
  19. Relay

Online Documentation

An online version of the documentation for Robotino's Toolbox can be viewed here.

Examples

Examples have been provided which illustrate the usage of Robotino's Toolbox. They can be viewed here.

Robotino Blockset [Simulink blocks]

The Robotino Blockset provides an extensive set of simulink blocks which enable users to control nearly every aspect of Robotino in Simulink. The simulink blocks are located in the 'RobotinoMatlab/blockset' directory. lib_robotinohardware.mdl contains the set of simulink blocks representing Robotino's hardware components. These blocks are build on top of the RobotinoMatlab m-files. Robotino's blockset contains the following simulink blocks.

Simulink blocks for Robotino

  1. AnalogInput
  2. Bumper
  3. Com
  4. Camera
  5. DigitalInput
  6. DigitalOutput
  7. DistanceSensor
  8. EncoderInput
  9. Gripper
  10. LaserRangeFinder
  11. LineFollower
  12. Manipulator
  13. Motor
  14. NorthStar
  15. Odometry
  16. OmniDrive
  17. PowerManagement
  18. PowerOutput
  19. Relay

Online Documentation

An online version of the documentation for Robotino's Blockset can be viewed here.

Examples

Examples have been provided which illustrate the usage of Robotino's Blockset. They can be viewed here.

Troubleshooting And FAQ

  • 'Error using loadlibrary (line 253) ..A 'Selected' compiler was not found. You may need to run mex -setup.' encountered
Please make sure you have the correct C compiler for MATLAB installed. See Installation for more information.
  • 'Error evaluating registered method ... ....Undefined function or variable...' encountered.
This is probably because the 'RobotinoMatlab/toolbox' and 'RobotinoMatlab/blockset' folders have not been included in MATLAB's search path. You can add them as follows.
addpath( strcat( getenv('ROBOTINOMATLAB_DIR'), '/blockset' ) );
addpath( strcat( getenv('ROBOTINOMATLAB_DIR'), '/toolbox' ) );
  • Help for Robotino Toolboox and Blockset not visible?
In this case in MATLAB, go to File>Preferences>Help. Make sure that 'Enable product filter' is not checked. Also make sure that the 'RobotinoMatlab/toolbox' and 'RobotinoMatlab/blockset' folders have been added to MATLAB's search path (Check File>Set Path). In case they haven't been added then run the following commands in MATLAB's Command Window.
addpath( strcat( getenv('ROBOTINOMATLAB_DIR'), '/blockset' ) );
addpath( strcat( getenv('ROBOTINOMATLAB_DIR'), '/toolbox' ) );

The Openrobotino Forum

The Openrobotino Forum connects the developers with the users. Here you will find more support and you can also post your questions/problems/bugs etc and get a quick response.

Uninstallation

The Robotino MATLAB Drivers can be uninstalled in any one of the following ways.

  • StartMenu > All Programs > Festo Didactic > RobotinoMatlab > Uninstall RobotinoMatlab
  • Uninstall the program from the Control Panel.