R4. Kinematics of mobile robots

Table of Contents

1 Info

The assignment presents properties of mobile robot kinematics.

The points marked with (*) are optional (not obligatory).

2 Preparation

Before the classes recall (from the lecture notes if possible) kinematic models of most common mobile robots: unicycle, differential wheeled robot, kinematic car.

Recall also methods of solving ODE's in Matlab.

3 Tasks

Task 1: Basic motions of unicycle mobile robot

  1. Write the differential equations of the unicycle.
  2. Write Matlab script to solve the unicycle equations (you can use and modify the code from the appendix).
  3. Apply constant values for whole motion time, test the behaviour of the model for various inputs (first or second non-zero, both non-zero)
  4. Calculate the control value to rotate π/2 within a period of 1s and to move forward 0.5 unit at the same time.
  5. Change the control from the previous point to rotate π/2 during 1s first, and then to move forward 0.5 unit in another 1s.
  • To report:
    1. What is a final pose of the robot if we start from x=1, y=0, θ=0 and the controls for time T=1 are u1=1, u2=0.2?
    2. Include the control values set (for all time periods) to make a movement along a square with side length 2 within Tmax=4s.

Task 2: Differential wheeled robot

  1. Modify the script from the task 1 to use differential drive robot model (hint: add new function with the second model to the same script so the results may be compared)
  2. Compare the final poses of the robot after applying for 1s 3 types of control:
    • both wheels moving with velocity 0.5 for 1s,
    • left wheel moving with vl=1 for 0.5s (vr=0) and switched velocities for the next 0.5s,
    • like previously, but starting with the right wheel first.

    What does it say about the model?

  3. (*) Find a transformation between the controls from differential drive and unicycle model so that for given task the solutions of the functions for this model and the unicycle are the same.
  • To report:
    1. What is the model of the differnetial drive robot?
    2. (*) How to transform controls between the unicycle and the differential drive robot?
    3. What can be concluded from the example in the second item?

Task 3: Kinematic car

  1. Prepare a script to solve kinematic car equations.
  2. Analyse the kinematic car behaviour for some simple control inputs and initial conditions.
  3. Verify the behaviour of the model for various inputs in simulations (check if it is as expected).
  4. (*) Define a set of commands to obtain a parallel parking motion (check that the final orientation is the same as the initial one how it should be)
  5. (*) Take the set of commands for a parallel parking solution and repeat them twice, using half of time in each cycle; observe the final pose after each cycle. Then use k cycles, 1/k time each and note the final poses after each cycle.
  • To report:
    1. Attach the implementation of the model
    2. Describe the characteristics of the model motion
    3. (*) Include motion set to obtain parallel parking
    4. (*) Describe the conclusions from cyclic motion

4 Summary

  • The report should include the result of the tasks and answers to the questions.
  • Please do not forget to indicate the author of the report!
  • The report in PDF format should be submitted before the beginning of next classes using a method defined by the instructor.

5 (appendix) Exemplary implementation of the unicycle

Save the following code in unicycle_ex.m file in a folder in Matlab path and run it with

>> unicycle_ex
function unicycle_ex
    global Tmax
    Tmax=1;
    [t,q] = ode45( @unicycle, 0:Tmax, [0 0 0] )
    plot( q(:,1), q(:,2) )
end

function dq = unicycle( t, q )
u=control(t);
x = q(1);
y = q(2);
th = q(3);
v = u(1);
om = u(2);
dq = [ v*cos(th) ; v*sin(th) ; om ];
end

function u=control(t)
    global Tmax
    if t<0.5*Tmax
	u=[0;1];
    else
	u=[1;0];
    end
end