Perception, Planning and Control F1/10 th Racing Perception, - - PowerPoint PPT Presentation

perception planning and control
SMART_READER_LITE
LIVE PREVIEW

Perception, Planning and Control F1/10 th Racing Perception, - - PowerPoint PPT Presentation

Perception, Planning and Control F1/10 th Racing Perception, planning and control Localization IMU and PID Control LIDAR 2 Perception Sensors: specifications, placement and data Inertial Measurement Unit An I nertial M


slide-1
SLIDE 1

Perception, Planning and Control

F1/10th Racing

slide-2
SLIDE 2

Perception, planning and control

2

IMU and LIDAR Localization PID Control

slide-3
SLIDE 3

Perception

Sensors: specifications, placement and data

slide-4
SLIDE 4

Inertial Measurement Unit

Razor IMU from Sparkfun 28 mm 41 mm

An Inertial Measurement Unit (IMU) provides acceleration, velocity and attitude measurements.

ሶ 𝑦 = 𝑤 ሶ 𝑤 = 𝑏

4

slide-5
SLIDE 5

Inertial Measurement Unit: Attitude

ROLL YAW PITCH X Z Y

5

slide-6
SLIDE 6

Inertial Measurement Unit

Razor IMU from Sparkfun

  • Three gyroscopes

measure the roll, pitch and yaw of the car.

  • Three accelerometers

measure the linear and rotational acceleration of the car.

  • Three magnetometers

6

slide-7
SLIDE 7

Inertial Measurement Unit: Placement

7

slide-8
SLIDE 8

IMU: ROS message

# File: sensor_msgs/Imu.msg # This is a message to hold data from an IMU (Inertial Measurement Unit) # # Accelerations should be in m/s^2 (not in g's), and rotational velocity should be in rad/se c # Header header geometry_msgs/Quaternion orientation float64[9] orientation_covariance # Row major about x, y, z axes geometry_msgs/Vector3 angular_velocity float64[9] angular_velocity_covariance # Row major about x, y, z axes geometry_msgs/Vector3 linear_acceleration float64[9] linear_acceleration_covariance # Row major x, y z

8

slide-9
SLIDE 9

LIDAR

70mm

Depth information (how far are objects and

  • bstacles around me)

9

slide-10
SLIDE 10

10

LIDAR

slide-11
SLIDE 11

Distance to obstacle = (speed of light * time traveled)/2

11

slide-12
SLIDE 12

270 degrees horizontal field

  • f view

Step 0 Step 1079 Step 1 Step k Step k+1 Angular resolution 0.25 degrees Hokuyo UST-10LX

12

slide-13
SLIDE 13

LIDAR: a simple scan sequence

TOP VIEW

Moving person Whiteboard What LIDAR “sees” LIDAR

13

slide-14
SLIDE 14

LIDAR: ROS message structure

# File: sensor_msgs/LaserScan.msg Header header # timestamp in the header is the acquisition time of # the first ray in the scan. float32 angle_min # start angle of the scan [rad] float32 angle_max # end angle of the scan [rad] float32 angle_increment # angular distance between measurements [rad] float32 time_increment # time between measurements [seconds] float32 scan_time # time between scans [seconds] float32 range_min # minimum range value [m] float32 range_max # maximum range value [m] float32[] ranges # range data [m] (Note: values < range_min or > range_max # should be discarded) float32[] intensities # intensity data [device-specific units].

14

slide-15
SLIDE 15

LIDAR: range data

Array ranges[1080]: ranges[i] is distance measurement of (i+1)st step. Measurements beyond the min and max range (like inf) should be discarded.

15

slide-16
SLIDE 16

Localization

Know (where is) thyself: Localization by LIDAR

slide-17
SLIDE 17

Odometry with LIDAR

  • Odometry = Estimation of position 𝑦, 𝑧, 𝑨

and attitude 𝜄, 𝜒, 𝜔

  • In what follows, will use “position” as short

for “position and attitude”

17

slide-18
SLIDE 18

LIDAR for odometry: Scan matching

Left Wall Right Wall

18

slide-19
SLIDE 19

LIDAR for odometry: Scan matching

Scan 1

Left Wall Right Wall

19

slide-20
SLIDE 20

LIDAR for odometry: Scan 1

x

World reference frame Car reference frame A1 y y x

20

slide-21
SLIDE 21

LIDAR for odometry: Scan 1

x y

World reference frame Car reference frame A1 y x

21

slide-22
SLIDE 22

World reference frame Car reference frame A1

x y

y x

22

slide-23
SLIDE 23

y x

World reference frame Car reference frame A1 y x

23

slide-24
SLIDE 24

World reference frame Car reference frame A1

Premise: most likely car position at Scan 2 is the position that gives best overlap between the two scenes x y

y x

24

slide-25
SLIDE 25

World reference frame Car reference frame A1 Matching

x y

y x

25

slide-26
SLIDE 26

y x

World reference frame

26

slide-27
SLIDE 27

Scan matching: optimization

S2 S1 Measure of match Impact coordinates of ith step in world frame Total of n steps (n = 1084)

y x

27

slide-28
SLIDE 28

Scan matching: requirements

  • Sufficiently fast scan

rate

  • A slow scan rate can

lead to few matches between scans.

  • Not really a risk for

today’s LIDARs

Left Wall Right Wall

28

slide-29
SLIDE 29

Scan matching : requirements

  • Non-smooth, or

heterogeneous, surfaces.

  • Smooth surfaces all

look the same to the matching algorithm.

29

slide-30
SLIDE 30

30

slide-31
SLIDE 31

Scan matching : requirements

  • Non-smooth, or

heterogeneous, surfaces.

  • Best match between

scans is if car did not move.

31

slide-32
SLIDE 32

Control

Proportional, Integral, Derivative control

slide-33
SLIDE 33

PID control: objectives

Control objective: 1) keep the car driving along the centerline, 2) parallel to the walls. Left Wall Right Wall

33

slide-34
SLIDE 34

PID control: objectives

Control objective: 1) keep the car driving along the centerline, 2) parallel to the walls.

34

slide-35
SLIDE 35

PID control: objectives

Control objective: 1) keep the car driving (roughly) along the centerline, 2) parallel to the walls.

35

slide-36
SLIDE 36

PID control: control objectives

Control objective: 1) keep the car driving along the centerline, y = 0 2) parallel to the walls. Θ = 0 x y Θ

36

slide-37
SLIDE 37

PID control: control objectives

Control objective: 1) keep the car driving along the centerline, y = 0 2) After driving L meters, it is still

  • n the centerline:

Horizontal distance after driving L meters Lsin(Θ) = 0

37

x y Θ Lsin(Θ) L A B

slide-38
SLIDE 38

PID control: control inputs

Control input: Steering angle Θ We will hold the velocity constant. How do we control the steering angle to keep x = 0, Lsin(Θ) = 0 as much as possible?

38

x y Θ Lsin(Θ) L

slide-39
SLIDE 39

PID control: error term

Want both y and Lsin(Θ) to be zero Error term e(t) = -(y + Lsin(Θ)) We’ll see why we added a minus sign

39

x y Θ Lsin(Θ) L

slide-40
SLIDE 40

PID control: computing input

When y > 0, car is to the left of centerline  Want to steer right: Θ < 0 When Lsin(Θ) > 0, we will be to the left of centerline in L meters  so want to steer right: Θ < 0 Set desired angle to be Θd = Kp (-y –Lsin(Θ))

40

x y Θ Lsin(Θ) L

slide-41
SLIDE 41

PID control: computing input

When y < 0, car is to the right of centerline  Want to steer left Want Θ > 0 When Lsin(Θ) < 0, we will be to the right of centerline in L meters, so want to steer left Want Θ > 0 Consistent with previous requirement: Θd = Kp (-y –Lsin(Θ))

41

x y Θ Lsin(Θ) L

slide-42
SLIDE 42

PID control: Proportional control

Θd = C Kp (-y –Lsin(Θ)) = C Kp e(t) This is Proportional control. The extra C constant is for scaling distances to angles.

42

x y Θ Lsin(Θ) L

slide-43
SLIDE 43

PID control: Derivative control

If error term is increasing quickly, we might want the controller to react quickly  Apply a derivative gain: Θ = Kp e (t) + Kd de(t)/dt

43

x y Θ Lsin(Θ) L

slide-44
SLIDE 44

PID control: Derivative control

In shown scenario, controller tries to nullify y term. Steer right, Θ < 0 and y decreases  y’ < 0 Error derivative –y’ – Lcos(Θ)>0 Trajectory correction takes longer (smoothing out)

44

x y Θ Lsin(Θ) L

slide-45
SLIDE 45

PID control: Integral control

Integral control is proportional to the cumulative error Θ = Kp e (t) + KI E (t) + Kd de (t)/dt Where E(t) is the integral of the error up to time t (from a chosen reference time)

45

x y Θ Lsin(Θ) L

slide-46
SLIDE 46

PID control: tuning the gains

  • Default set of gains, determined

empirically to work well for this car.

– Kp = 14 – Ki = 0 – Kd = 0.09

46

slide-47
SLIDE 47

PID control: tuning the gains

  • Reduce Kp  less responsive to error

magnitude

– Kp = 5 – Ki = 0 – Kd = 0.09

47

slide-48
SLIDE 48

PID control: tuning the gains

  • Include Ki  overly sensitive to

accumulating error  over-correction

– Kp = 14 – Ki = 2 – Kd = 0.09

48

slide-49
SLIDE 49

Perception, Planning and Control

  • At the end of this week, your car will be

driving in a straight line.

  • Next week, we see how to extend these

algorithms to close a loop on a track.

49