Robotic Goalkeeper

25
Simulation of a Robotic Goalkeeper Wisit Jirattigalachote Sudeep Pillai ME 567 April 9, 2008 1

description

Robotic Goalkeeper SImulation using realtime tracking of a ball

Transcript of Robotic Goalkeeper

Page 1: Robotic Goalkeeper

Simulation of a Robotic

Goalkeeper

Wisit Jirattigalachote

Sudeep Pillai

ME 567

April 9, 2008

1

Page 2: Robotic Goalkeeper

Overview

Background

Motivations

Objectives

Model Simulation

Machine Vision

Goalkeeping Algorithm

System Integration

Conclusions

Future Works

2

Page 3: Robotic Goalkeeper

Background

RoboCup

◦ “By the year 2050,

develop a team of fully autonomous

humanoid robots that can win against

the human world soccer champion

team.”

3

Picture courtesy of www.robocup.org

Page 4: Robotic Goalkeeper

Motivations

Problems

◦ Past designs were too slow to react

◦ Aerial ball trajectory was not taken into

account

Ball motions are mostly rolling

Ball speed is generally slow

http://www.youtube.com/watch?v=7hVy_YsKAJk

◦ Often failed to protect the goal from being

scored

4

Page 5: Robotic Goalkeeper

Objectives

Simulate a simplified robotic

goalkeeper for effective goalkeeping

Use vision-based system for ball

trajectory prediction

Implement an algorithm that efficiently

prevents the goal from being scored

5

Page 6: Robotic Goalkeeper

Model Simulation

Goalkeeper model simplifications

◦ Two sets of simple kinematics links chain

(one for each body side)

◦ Each set consists of

One prismatic joint (foot)

Two revolute joints (knee and shoulder)

◦ Hands are approximated as circular

cross-sections

6

Page 7: Robotic Goalkeeper

Model Simulation

Model and workspace scaling

◦ Scaling ratio of 2:1

7

Real World Setup Model

Soccer Ball Diameter 8.6 in 4.3

Goal (Width×Height) 288×96 in 144×48

Goalkeeper

Total Height 72 in 36

Knee to Toe Height 24 in 12

Shoulder to Knee Height 48 in 24

Arm Length 28.8 in 14.4

Hand Diameter 8 in 4

Page 8: Robotic Goalkeeper

Model Simulation

MATLAB Robotics Toolbox simulation

◦ DH parameters for robotic goalkeeper

8

Link θ d a α

Right Side 1 90° d1* 12 0

2 θ2* 0 24 0

3 θ3* 0 14.4 -90°

Left Side 1 90° d1* 12 0

2 θ2* 0 24 0

3 θ3* 0 14.4 90°

Page 9: Robotic Goalkeeper

Model Simulation

MATLAB Robotics Toolbox simulation

9

Page 10: Robotic Goalkeeper

Machine Vision

Camera calibration◦ Standard webcam (320x240 res. up to 30fps)

◦ Camera Calibration parameters

Focal length, Principal point, Skew, Distortion, Pixel error

10

X

YO

Image 9 - Image points (+) and reprojected grid points (o)

50 100 150 200 250 300

20

40

60

80

100

120

140

160

180

200

220

240

Page 11: Robotic Goalkeeper

Machine Vision

Ball tracking ◦ Roborealm (RR) – Robotic vision software

Ball tracking done using a specific algorithm

11

Roborealm (RR)

Machine vision

algorithm

Page 12: Robotic Goalkeeper

Machine Vision

Ball tracking video demonstration

12

1/32 of actual speedActual speed

Time of flight ~ 1 second

• The COG coordinates are then ported to MATLAB for

ball positioning and robotic simulation

• RoboRealm API (C++) calls ENGINE fn accessed by

MATLAB

Page 13: Robotic Goalkeeper

Machine Vision

Ball positioning ◦ COG data returned by RR do not describe the

actual ball position in world coordinates

◦ Normalizing function: Converts the (x,y)

coordinates recorded by the camera into a

normalized image projection vector

i.e. 2D projection of the 3D ball on the goal plane

◦ Normalized data scaled down to desired

workspace

i.e. 320x240 pixels scaled to 144x48

13

Page 14: Robotic Goalkeeper

Machine Vision

14

RR API (C++)

interfaceMatlab workspace

where COG can be

accessed

RoboRealm

detecting blobs

COG coordinates

sent to MATLAB

through program

Page 15: Robotic Goalkeeper

Goalkeeping Algorithm

Path generation of our model

15

Page 16: Robotic Goalkeeper

Goalkeeping Algorithm

Inverse kinematics

◦ Law of cosiner2+s2 = 242+14.42+2(24)(14.4)cos(α)

16

24

14.4

α

θ3

θ2

r

s

Page 17: Robotic Goalkeeper

Goalkeeping Algorithm

Inverse kinematics (cont.)

◦ Define

D=((r2+s2)-(242+14.42))/(2*24*14.4)

◦ Thus,

α = atan2(±sqrt(1-D2),D)

θ3 = π/2 + α

θ2 = -(π/2-(atan2(s,r)-

atan2(14.4*sin(α),24+14.4*cos(α))))

17

Page 18: Robotic Goalkeeper

Goalkeeping Algorithm

For each (x, y) coord. of the ball, there

is only one set of possible joint angles

solution (d1, θ2, θ3r, θ3l)

When the ball moves from (xa, ya) to

(xb, yb), the robot will move from (d1a,

θ2a, θ3ra, θ3la) to (d1b, θ2b, θ3rb, θ3lb)

18

Page 19: Robotic Goalkeeper

System Integration

MATLAB Demo

19

Page 20: Robotic Goalkeeper

20

MATLAB

Goalkeeper AI

RoboRealm(RR) – Machine vision implementation

Real-time tracking of the ball using color thresholdingand blob tracking

(center of gravity – COG) modules

Camera

Decision making(Inverse mapping)

Actuating the robot to move based on ball

position

Main Goalkeeping Algorithms

2D projection of the ball

on the goal plane

Robot simulation

Model

Actuate joints of the robot using

the Robotic Toolbox

RoboRealmAPI C++ script

Relays COG (x,y) coordinates to variable cog_data using MATLAB’s engine function

Retrieves the COG coordinates (x,y) from RoboRealm (RR) using the RR API

ScriptScript Script

Visual feed of 320x240 at 30 fps is used to detect rapid movement

MATLAB workspace

Cog_datarelayed is updated at greater than 10 Hz and is accessed

by other matlab scripts

Output visualization

Plot showing position and orientation of goalkeeper, the 2D

position of the ball

Robotic Goalkeeper Simulator Algorithm flowchart

Camera calibration Toolbox

Normalization function

Computes the vector projection of the ball in world coordinates using the camera calibration

Toolbox

Camera calibration parameters

Actuation commands call

functions described in the

robot model

Script

Relays the 2D position of the

ball in world coordinates

COG (x,y) coords.

Real-time testing involving throwing the ball towards the workspace

Ball captured by camera

Page 21: Robotic Goalkeeper

Conclusions

Model of simple robotic goalkeeper was used as a framework for developing an agile goalkeeper

Machine vision implemented was adequate but not highly robust

◦ Aerial ball trajectory prediction could not be implemented

◦ 2D projection of the ball was successfully implemented instead

◦ Limited camera frame rate restricted accuracy of ball position

21

Page 22: Robotic Goalkeeper

Conclusions

Algorithm utilizing machine vision

information was successfully

implemented

◦ A simple goalkeeping algorithm was

developed

◦ Robust operation within the workspace

◦ Delayed response time due to cross-

platform interface

22

Page 23: Robotic Goalkeeper

Future Works

Model Simulation

◦ Increasing degree of freedoms (e.g.

elbows, knees)

◦ Considering realistic dynamics

Machine Vision

◦ Stereo-vision for 3D trajectory prediction

◦ Improved camera frame rate

Ball movement prediction algorithm

23

Page 24: Robotic Goalkeeper

Questions

?

24

Page 25: Robotic Goalkeeper

More videos!!!

25