No announcement yet.

Matlab Robotino

  • Filter
  • Time
  • Show
Clear All
new posts

  • Matlab Robotino

    Hey! it's the first time I use robotino with matlab, anyone can tell me how can I start to do the robot go to anywhere I want. I think is about put together odometry and Omnidrive but I just can't get the answer.

  • #2
    Hello LuBlue,

    What Version of Robotino are you using and what Version of Matlab?
    Have you already downloaden and installed the right API / API2 from the Robotino Wiki?
    These are you first steps. Afterwards you establish connection. Has this work es already?
    Do you want to usw Matlab Script or Simulink? I sugget normal Scripts for the beginning.

    Let me know Where you stand.


    • LuBlue
      LuBlue commented
      Editing a comment
      Oh my God! thanks for reply !. I am using matlab r2010a and robotino...
      I'm not sure what Version it is but I'm still using the API1 for robotino... is not of the newest.
      Yeah, I'd established the connection with robotino and yes absolutely I did a script.
      Well in fact I made a GUI with buttons where I can say if the robot move to front, back,
      right, left, turn right or turn left with an axes that shows how robot it's moving with the camera.
      I made also the robotino follows a red object but just i cannot get the answer yet of how to move it
      to wherever I want with odomety. Can you give me some clue?

  • #3
    API1 means you are also using a Robotino version 1 or 2.

    I have only experiance with API2 and odometry.
    With odometry you are not moving at all. Odometry is just giving you the current position of the robot. If you compare the current position and the wanted position, you can drive Robotino with the help of Odometry and Omnidrive. You would have to develop a controller. (Just like you did for following a red object)

    There it works like this for example. I cannot test it because I have no Robotino at the moment. But it should look similar to that and you can probably figure out the rest.

    Establishing connection:
    ComId = Com_construct;
    Com_setAddress (ComId,''); % IP of Simulator for testing

    % I alwys check if the connection was succesful or not by these lines:
    disp('Connection established:');
    % Establish connection and show result in Matlab command window
    Com_connect (ComId

    % Create Omnidrive
    OmniDriveId = OmniDrive_construct;
    OmniDrive_setComId (OmniDriveId, ComId);

    % Create Odometry

    OdometryId = Odometry_construct;
    Odometry_setComId (OdometryId, ComId);
    Odometry_set( OdometryId, 0, 0, 0 );

    % elapsed.
    tElapsed = tic;

    % variable for speed and position
    omega = 0;
    phi_plan = 1.57 % rad, Omnidrive is using radiand not degree

    %% turning of Robotino on the spot
    while (toc(tElapsed) <= 10)

    % Set omega into omnidrive
    OmniDrive_setVelocity( OmniDriveId, 0, 0, omega );

    % Read values from odometry
    % ~ surpresses the output of a function
    [ ~, ~, phi ] = Odometry_get( OdometryId );

    % Be careful here, you might need a factor. This is a simple P-controller. You can then devlop an PI-.controller as well for better movement.
    omega = phi_plan - phi


    % The odometry should be reset after each run of the program
    Odometry_set( OdometryId, 0 ,0 ,0 );