A brief intro to robots Spring 2018yiannisr/790/2018/Lectures/01-Robot.pdf · A brief intro to...

Preview:

Citation preview

Ioannis Rekleitis

AbriefintrotorobotsSpring2018

Presentation: Marios Xanthidis

RobotSensors

•  Sensorsaredevicesthatcansenseandmeasurephysicalpropertiesoftheenvironment,•  e.g.temperature,luminance,resistancetotouch,weight,size,etc.

•  Thekeyphenomenonistransduction•  Transduction(engineering)isaprocessthatconvertsonetypeofenergytoanother

•  Theydeliverlow-levelinformationabouttheenvironmenttherobotisworkingin.–  Returnanincompletedescriptionoftheworld.

CSCE 790 Machine Learning in Robotics 2

RobotSensors

•  Thisinformationisnoisy(imprecise).•  Cannotbemodelledcompletely:–  Reading=f(env)wherefisthemodelofthesensor–  Findingtheinverse:

•  illposedproblem(solutionnotuniquelydeEined)•  collapsingofdimensionalityleadstoambiguity

CSCE 790 Machine Learning in Robotics 3

Typesofsensor

•  GeneralclassiEication:– activeversuspassive• Active:emitenergyinenvironment– Morerobust,lessefEicient

• Passive:passivelyreceiveenergyfromenv.– Lessintrusive,butdependsonenv.e.g.lightforcamera

• Example:stereovisionversusrangeEinder.– contactversusnon-contact

4 CSCE 790 Machine Learning in Robotics

Sensors

CSCE 790 Machine Learning in Robotics 5

•  ProprioceptiveSensors(monitorstateofrobot)–  IMU(accels&gyros)– Wheelencoders–  Dopplerradar…

•  ExteroceptiveSensors(monitorenvironment)–  Cameras(single,stereo,omni,FLIR…)

–  Laserscanner– MWradar–  Sonar–  Tactile…

TypesofsensorSpeciEicexamples–  tactile–  close-rangeproximity–  angularposition–  infrared–  Sonar–  laser(varioustypes)–  radar–  compasses,gyroscopes–  Force–  GPS–  vision

6 CSCE 790 Machine Learning in Robotics

AngularPosi6on:RotaryEncoder•  Potentiometer– UsedintheServoontheboebots

•  OpticalDisks(Relative)– Countingtheslots– Directionbyhavingparsofemitters/receiversoutofphase:Quadraturedecoding

– Canspinveryfast:500kHz

7 CSCE 790 Machine Learning in Robotics

Whatisanactuator?

•  Deviceformovingorcontrollingasystem.

•  “RobotMuscles”

CSCE 790 Machine Learning in Robotics 8

HydraulicActuators

•  Pros:– Powerful– Fast– Stiff

•  Cons– Messy– Maintenance– ExternalPump

CSCE 790 Machine Learning in Robotics 9

Pneuma6cActuators

•  Pros:– Powerful– Cheap

•  Cons– Soft/Compliant– ExternalCompressor

CSCE 790 Machine Learning in Robotics 10

ShapeMemoryAlloyActuators

•  WorksbywarmingandcoolingNitinolwires.

•  Pros:– Light– Powerful

•  Cons:– Slow(cooling)

CSCE 790 Machine Learning in Robotics 11

ElectricActuators

•  Pros– Betterpositionprecision– Wellunderstood– Noseparatepowersource– Cheap

•  Cons– Heavy– Weaker/slowerthanhydraulics– Coolingissue

CSCE 790 Machine Learning in Robotics 12

DCmotortorqueτ

I∝τ

torque=τcurrent =I

CSCE 790 Machine Learning in Robotics 13

VehicleLocomo6on

•  Objective:convertdesiretomoveAàBintoanactualmotion:

– Howtoarrangeactuators(mechanicaldesign)

– actuatoroutputßàIncrementalmotion:Forwardkinematicsandinversekinematics

14 CSCE 790 Machine Learning in Robotics

VehicleLocomo6on

•  ForwardKinematics:– (actuatorsactions)àpose

•  InverseKinematics(inverse-K):– poseà(actuatorsactions)

},,{ pose θyx=

15 CSCE 790 Machine Learning in Robotics

WheeledVehicles

16 CSCE 790 Machine Learning in Robotics

Differen6aldrive

Basicdesign:•  2circularwheels•  inEinitelythin•  samediameter•  mountedalongacommonaxis•  vehiclebodyisirrelevant(intheory).

17 CSCE 790 Machine Learning in Robotics

Idealizeddifferen6aldrive

w1 w2

axle

w2w1

axle

top view

side view

18 CSCE 790 Machine Learning in Robotics

Differen6alDriveIntui6on

•  Drivestraightahead?

•  Turninplace?

•  (thesearequestionsofkinematics)

19 CSCE 790 Machine Learning in Robotics

Differen6alDriveObserva6on

•  Vehiclerotationcanbedescribedrelativetoanaxisrunningthoughthetwowheels.

Instantaneous Center of Curvature

20 CSCE 790 Machine Learning in Robotics

ForwardKinema6csofDifferen6alDrive•  Wheelrotationbyangleφ1,φ2•  DistanceofwheelmotionDi=φir

21 CSCE 790 Machine Learning in Robotics

WalkingRobots:RHex:TripodGait

22 CSCE 790 Machine Learning in Robotics

•  Presentedactuatorsandsensors,e.g.:–  Electricalmotor–  Angularpositionencoder

•  Howtogetthebestprecision/performance?

Actuators+Sensors

Electric Motor

CSCE 790 Machine Learning in Robotics 23

Potentiometer Optical Encoder

Open-loop

Power Amplifier

Electric Motor

Computer

Volta

ge

Angular Velocity

CSCE 790 Machine Learning in Robotics 24

•  Goal:moveadifferentialdriverobot–  spinmotorsatagivenangularvelocity

•  How:applyaEixedvoltagetoit,–  andneverchecktoseeifitisrotatingproperly…

•  Let’smeasuretheactualangularvelocities.•  Compensateforchangesinloadbyfeedingbacksomeinformation.

Closingtheloop

Power Amplifier

Electric Motor

Computer

Vol

tage

AngularVelocity

PositionEncoder

CSCE 790 Machine Learning in Robotics 25

ComponentsofFeedbackSystems

•  PowerampliEication–  Neuralsignalpower(µW)vs.musclepoweroutput(tensofW)– Meansitisanactivesystem,asopposedtopassive.

•  Actuator•  Feedback– measurement(sensor)

•  Errorsignal•  Controller

26 CSCE 790 Machine Learning in Robotics

EffectofControllerFunc6ons

•  ProportionalAction– SimplestControllerFunction

•  IntegralAction– Eliminatessteady-stateerror– Cancauseoscillations

•  DerivativeAction(“ratecontrol”)– Effectiveintransientperiods– Providesfasterresponse(highersensitivity)– Neverusedalone

27 CSCE 790 Machine Learning in Robotics

LineFollowing

•  Considera2Drobotwithpose(x,y,θ)followingaline.Therobotismovingwithconstantspeedv,andwecontroltheangularvelocityω (turnrate).

CSCE 790 Machine Learning in Robotics 28

d

φ

Calcula6ngtheerror

•  Considertwoerrormeasures,– d– φ

•  Theorientationerrorisusedtoestimatewhenweareheadingtoomuchinthewrongdirection– 

•  Thedistanceerroriswhatwefeedtoourcontroller.

CSCE 790 Machine Learning in Robotics 29

bounded is 90 if ωφ °<

P-Controller

CSCE 790 Machine Learning in Robotics 30

0 20 40 60 80 100 120 140 160 180 200

0

20

40

60

80

Casaded control kp=1 ki=0 kd=0

0 50 100 150-10

0

10

Time (s)Rot

atio

n C

omm

and

(deg

/s)

Gain too low

P-Controller

CSCE 790 Machine Learning in Robotics 31

0 20 40 60 80 100 120 140 160 180 200

0

20

40

60

80

Casaded control kp=4 ki=0 kd=0

0 100 200 300 400 500 600-50

0

50

Time (s)Rot

atio

n C

omm

and

(deg

/s)

Gain high

P-Controller

CSCE 790 Machine Learning in Robotics 32

0 20 40 60 80 100 120 140 160 180 200

0

20

40

60

80

Casaded control kp=10 ki=0 kd=0

0 100 200 300 400 500 600-100

-50

0

50

Time (s)Rot

atio

n C

omm

and

(deg

/s)

Gain too high

Pd-Controller

•  Weareusingalsothederivativeoftheerror:–  tocalculatetheturnrateω:

CSCE 790 Machine Learning in Robotics 33

dtdde tt 1−−

=!

ekdk dtp !⋅+⋅=ω

Pd-Controller

CSCE 790 Machine Learning in Robotics 34

0 20 40 60 80 100 120 140 160 180 2000

20

40

60

80

Casaded control kp=4 ki=0 kd=4

0 50 100 150 200 250 300 350 400-100

0

100

Time (s)Rot

atio

n C

omm

and

(deg

/s)

Pd-Controller

CSCE 790 Machine Learning in Robotics 35

0 20 40 60 80 100 120 140 160 180 2000

20

40

60

80

Casaded control kp=4 ki=0 kd=10

0 50 100 150 200 250 300 350-100

-50

0

50

Time (s)Rot

atio

n C

omm

and

(deg

/s)

Pd-Controller

CSCE 790 Machine Learning in Robotics 36

0 20 40 60 80 100 120 140 160 180 2000

20

40

60

80

Casaded control kp=4 ki=0 kd=20

0 50 100 150 200 250 300 350-100

-50

0

50

Time (s)Rot

atio

n C

omm

and

(deg

/s)

Pd-Controller

CSCE 790 Machine Learning in Robotics 37

0 20 40 60 80 100 120 140 160 180 200

0

20

40

60

80

Casaded control kp=20 ki=0 kd=50

0 50 100 150 200 250 300 350-100

0

100

Time (s)Rot

atio

n C

omm

and

(deg

/s)

Posi6onRepresenta6on

•  Positionrepresentationis:

CSCE 790 Machine Learning in Robotics 38

X

Y

Z

⎥⎥⎥

⎢⎢⎢

=

z

y

xA

ppp

PPA

Orienta6onRepresenta6ons

•  Describestherotationofonecoordinatesystemwithrespecttoanother

CSCE 790 Machine Learning in Robotics 39

XA

YA

ZA

XB

YB

ZB

A

B

Rota6onMatrix•  WritetheunitvectorsofBinthecoordinatesystemofA.

•  RotationMatrix:

CSCE 790 Machine Learning in Robotics 40

XA

YA

ZA

A

AXB

AYB

AZB

B [ ]

⎥⎥⎥

⎢⎢⎢

⋅⋅⋅

⋅⋅⋅

⋅⋅⋅

=

⎥⎥⎥

⎢⎢⎢

==

ABABAB

ABABAB

ABABAB

BA

BA

BAA

B

ZZZYZXYZYYYXXZXYXX

rrrrrrrrr

ZYXR

ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ

ˆˆˆ

333231

232221

131211

EulerAngles

•  TraditionallythethreeanglesalongtheaxisarecalledRoll,Pitch,andYaw

CSCE 790 Machine Learning in Robotics 41

X

Y

Z

EulerAngles

•  TraditionallythethreeanglesalongtheaxisarecalledRoll,Pitch,andYaw

Roll

CSCE 790 Machine Learning in Robotics 42

X

Y

Z

EulerAngles

•  TraditionallythethreeanglesalongtheaxisarecalledRoll,Pitch,andYaw

Pitch

CSCE 790 Machine Learning in Robotics 43

X

Y

Z

EulerAngles

•  TraditionallythethreeanglesalongtheaxisarecalledRoll,Pitch,andYaw

Yaw

CSCE 790 Machine Learning in Robotics 44

X

Y

Z

Axis-AngleRepresenta6on

•  Representanarbitraryrotationasacombinationofavectorandanangle

CSCE 790 Machine Learning in Robotics 45

X

Y

Z

V θ

Quaternions•  Aresimilartoaxis-anglerepresentation•  Twoformulations–  Classical– BasedonJPL’sstandardsW.G.Breckenridge,“Quaternions-ProposedStandardConventions,”JPL,Tech.Rep.INTEROFFICEMEMORANDUMIOM343-79-1199,1999.

•  AvoidsGimballock

•  Seealso:M.D.Shuster,“Asurveyofattituderepresentations,”JournaloftheAstronauticalSciences,vol.41,no.4,pp.439–517,Oct.–Dec.1993.

CSCE 790 Machine Learning in Robotics 46

QuaternionsClassicnotation JPL-based

CSCE 790 Machine Learning in Robotics 47

kqjqiqqq 3214 +++=

jikkiikjjkkjiijkji

==−==−==−

−===

,,1222

jikkiikjjkkjiijijkkji

=−==−==−=

−====

, ,1222

kqjqiqqq 3214 +++=

( )( )( )

( )2cos ,

2sin2sin2sin

, 44

θ

θ

θ

θ

=

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

⎡= q

k

k

k

qq

z

y

x

qq

⎣ ⎦××⊗= qpq , , , ,1 Iqpqq

( )( ) ( )( ) ( )( ) ( )⎥

⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥

⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

=

z

y

x

qqq

q

qqqq

q

βθβθβθ

θ

cos2sin

cos2sin

cos2sin

,2cos ,

3

2

1

0

3

2

1

0

Vect

or

Not

atio

n

See also: N. Trawny and S. I. Roumeliotis, “Indirect Kalman Filter for 3D Attitude Estimation,” University of Minnesota, Dept. of Comp. Sci. & Eng., Tech. Rep. 2005-002, March 2005.

ThreeMainChallengesinRobo6cs

1.  WhereamI?(Localization)2.  Whattheworldlookslike?(Mapping)– Together1and2formtheproblemofSimultaneousLocalizationandMapping(SLAM)

3.  HowdoIgofromAtoB?(PathPlanning)–  Moregeneral:WhichactionshouldIpicknext?

(Planning)

48 CSCE 790 Machine Learning in Robotics

Robot

Reason

ActSense

49 CSCE 790 Machine Learning in Robotics

Mo6onPlanning•  TheabilitytogofromAtoB–  Knownmap–Off-lineplanning–  UnknownEnvironment–Onlineplanning–  Static/DynamicEnvironment

CSCE 790 Machine Learning in Robotics 50

qgoalqinit

qgoal

qgoalqinit

qinit

PathPlanning

Robot Map

World

• Topological • Metric • Feature Based • 1D,2D,2.5D,3D

• Mobile Ø Indoor/Outdoor Ø Walking/Flying/Swimming

• Manipulator • Humanoid • Abstract

• Indoor/Outdoor • 2D/2.5D/3D • Static/Dynamic • Known/Unknown • Abstract (web)

51 CSCE 790 Machine Learning in Robotics

PathPlanning:Assump6ons•  KnownMap•  Roadmaps(Graphrepresentations)•  PolygonalRepresentation

qgoal

qinit

52 CSCE 790 Machine Learning in Robotics

Local techniques Potential Field methods

•  compute a repulsive force away from obstacles

•  compute an attractive force toward the goal

let the sum of the forces control the robot

key advantages?CSCE 790 Machine Learning in Robotics 53

Ioannis Rekleitis

Configuration Space

Ioannis Rekleitis

Configuration Space

Definition

 A robot configuration is a specification of the positions of all robot points relative to a fixed coordinate system  Usually a configuration is expressed as a “vector” of position/orientation parameters

CSCE 790 Machine Learning in Robotics 56

What is a Path?

CSCE 790 Machine Learning in Robotics 57

Tool: Configuration Space (C-Space C)

q1

q1

q2

q2

CSCE 790 Machine Learning in Robotics 58

Probabilis6cRoadmapsPRMs

ThebasicideabehindPRMistotakerandomsamplesfromtheconfigura:onspaceoftherobot,tes:ngthemforwhethertheyareinthefreespace,andusealocalplannertoa>empttoconnecttheseconfigura:onstoothernearbyconfigura:ons.Thestar:ngandgoalconfigura:onsareaddedin,andagraphsearchalgorithmisappliedtotheresul:nggraphtodetermineapathbetweenthestar:ngandgoalconfigura:ons.Kavraki,L.E.;Svestka,P.;Latombe,J.-C.;Overmars,M.H.(1996),"Probabilis:croadmapsforpathplanninginhigh-dimensionalconfigura:onspaces",IEEETransac:onsonRobo:csandAutoma:on12(4):566–580.

CSCE 790 Machine Learning in Robotics 59

Rapidly-exploringRandomTrees

•  ApointPinCisrandomlychosen.•  ThenearestvertexintheRRTisselected.•  AnewedgeisaddedfromthisvertexinthedirectionofP,atdistanceε.

•  Thefurtherthealgorithmgoes,themorespaceiscovered.

CSCE 790 Machine Learning in Robotics 60

FundamentalProblemsInRobo6cs

•  HowtoGoFromAtoB?(PathPlanning)•  Whatdoestheworldlookslike?(mapping)

–  sensefromvariouspositions–  integratemeasurementstoproducemap–  assumesperfectknowledgeofposition

•  WhereamIintheworld?(localization)–  Sense–  relatesensorreadingstoaworldmodel–  computelocationrelativetomodel–  assumesaperfectworldmodel

•  Together,theabovetwoarecalledSLAM (SimultaneousLocalizationandMapping)

61 CSCE 790 Machine Learning in Robotics

Introduc6ontoMapping

•  Whattheworldlookslike?•  Knowledgerepresentation–  Robotics,AI,Vision

•  Whoistheend-user?–  HumanorMachine

•  EaseofPathPlanning•  Uncertainty!

62 CSCE 790 Machine Learning in Robotics

SimultaneousLocaliza6onAndMapping

SLAMistheprocessofbuildingamapofanenvironmentwhile,atthesametime,usingthatmaptomaintainthelocationoftherobot.

•  ProblemsforSLAMinlargescaleenvironments:–  Controllinggrowthofuncertaintyandcomplexity–  Achievingautonomousexploration

63 CSCE 790 Machine Learning in Robotics

Localiza6on

•  Tracking:Knowninitialposition•  GlobalLocalization:Unknowninitialposition•  Re-Localization:Incorrectknownposition–  (kidnappedrobotproblem)

64 CSCE 790 Machine Learning in Robotics

Uncertainty

Centraltoanyrealsystem!

65 CSCE 790 Machine Learning in Robotics

Localiza6on

Initial state detects nothing:

Moves and detects landmark:

Moves and detects nothing:

Moves and detects landmark:

66 CSCE 790 Machine Learning in Robotics

BayesianFilter

•  EstimatestatexfromdataZ– Whatistheprobabilityoftherobotbeingatx?

•  xcouldberobotlocation,mapinformation,locationsoftargets,etc…

•  Zcouldbesensorreadingssuchasrange,actions,odometryfromencoders,etc…)

•  Thisisageneralformalismthatdoesnotdependontheparticularprobabilityrepresentation

•  BayesEilterrecursivelycomputestheposteriordistribution:

CSCE 790 Machine Learning in Robotics 67

)|()( TTT ZxPxBel =

Deriva6onoftheBayesianFilter

CSCE 790 Machine Learning in Robotics 68

)|()( Ttt ZxpxBel =

),...,,,,|()( 0211 oaoaoxpxBel tttttt −−−=

),...,|(),...,|(),...,,|()(

01

0101

oaopoaxpoaxopxBel

tt

tttttt

−−=

Estimation of the robot’s state given the data:

The robot’s data, Z, is expanded into two types: observations oi and actions ai

Invoking the Bayesian theorem

Deriva6onoftheBayesianFilter

CSCE 790 Machine Learning in Robotics 69

),...,|(/1 01 oaop tt −=η

),...,|(),...,,|()( 0101 oaxpoaxopxBel tttttt −−=η

),...,|()|()( 01 oaxpxopxBel ttttt −=η

1011011 ),...,|(),...,,|()|()( −−−−−∫= ttttttttt dxoaxpoaxxpxopxBel η

Denominator is constant relative to xt

First-order Markov assumption shortens first term:

Expanding the last term (theorem of total probability):

Deriva6onoftheBayesianFilter

CSCE 790 Machine Learning in Robotics 70

101111 ),...,|(),|()|()( −−−−−∫= ttttttttt dxoaxpaxxpxopxBel η

1111 )(),|()|()( −−−−∫= tttttttt dxxBelaxxpxopxBel η

First-order Markov assumption shortens middle term:

Finally, substituting the definition of Bel(xt-1):

The above is the probability distribution that must be estimated from the robot’s data

Itera6ngtheBayesianFilter•  Propagatethemotionmodel:

•  Updatethesensormodel:

CSCE 790 Machine Learning in Robotics 71

∫ −−−−− = 1111 )(),|()( tttttt dxxBelxaxPxBel

)()|()( tttt xBelxoPxBel −=η

Compute the current state estimate before taking a sensor reading by integrating over all possible previous state estimates and applying the motion model

Compute the current state estimate by taking a sensor reading and multiplying by the current estimate based on the most recent motion history

DifferentApproachesDiscreteapproaches(’95)•  Topologicalrepresentation(’95)•  Uncertaintyhandling(POMDPs)•  occas.globallocalization,recovery•  Grid-based,metricrepresentation(’96)•  globallocalization,recovery

ParticleEilters(’98)• Condensation(IsardandBlake’98)• Sample-basedrepresentation• Globallocalization,recovery• Rao-BlackwellizedParticleFilter

KalmanEilters(Early-60s?)• Gaussians• approximatelylinearmodels• positiontrackingExtendedKalmanFilterInformationFilterUnscentedKalmanFilter

Multi-hypothesis(’00)• MixtureofGaussians• MultipleKalmanEilters• Globallocalization,recovery

72 CSCE 790 Machine Learning in Robotics

BayesianFilter:RequirementsforImplementa6on

•  Representationforthebelieffunction•  Updateequations•  Motionmodel•  Sensormodel•  Initialbeliefstate

73 CSCE 790 Machine Learning in Robotics

Recommended