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 kinematic models of most common mobile robots: unicycle, differential drive, kinematic car.
Recall also methods of solving ODE's in Matlab.
3 Tasks
Task 1: Basic motions of unicycle mobile robot
- Write the differential equations of the unicycle.
- Write Matlab script to solve the unicycle equations (you can use and modify the code from the appendix).
- Apply constant values for whole motion time, test the behaviour of the model for various inputs (first or second non-zero, both non-zero)
- Calculate the control value to rotate π/2 during 1s time period and to move forward 0.5 unit in the same time.
- To report:
- 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?
- Include the control values set (for all time periods) to make a movement along a square with 0.7 side length in Tmax=4.
Task 2: Differential drive
- 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)
- 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 switch velocities for the next 0.5s
- like the previous, but starting with the right wheel first
what does it say about the model?
- (*) 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:
- What is the model of the differnetial drive model?
- (*) How to transform controls between the unicycle and the differential drive model?
- What can be concluded from the example in the second item?
Task 3: Kinematic car
- Prepare a script to solve kinematic car equations
- Verify the behaviour of the model for various inputs (check if it is as expected)
- (*) Define a set of commands to obtain a parallel parking motion (check that the final orientation is the same as the initial one)
- (*) 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:
- Attach the implementation of the model
- Describe the characteristics of the model motion
- (*) Include motion set to obtain parallel parking
- (*) 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