390 likes | 514 Vues
Agenda. Path smoothing PID Graph slam. Path smoothing. Until now we have worked with straight motions. Path smoothing. Straight line. Path smoothing. Smooth line. How do we smooth paths ?. X 0. X 0. X 1. X 1. X 2. X 2. How do we smooth paths ?. X 0. X 1.
E N D
Agenda • Pathsmoothing • PID • Graph slam
Pathsmoothing • Untilnowwe have workedwithstraight motions
Pathsmoothing • Straight line
Pathsmoothing • Smooth line
How do wesmoothpaths? X0 X0 X1 X1 X2 X2
How do wesmoothpaths? X0 X1 As we move X1 in we reduce the distance between X1 and X0 and X1 and X2. In other words as we move X1 the length of the red lines get smaller. So how do we figure out how to move X1 to reduce the length of the red lines? X2
How do wesmoothpaths? We subtract X1 from each of its neighbours and add the difference to X1 . In other word: X0 X1 X2 where α is a weight term that is used to control how quickly we move away from X1
How do wesmoothpaths? Quiz: what will happen if we repeatedly apply this update to our path? X0 X1 X2 We will end up with a straigth line
How do wesmoothpaths? Therefore we need a constraint to control the update to make it balance! To do this we will iteratively move the point back towards the original point X0 X1 Lets call the moving point Y1 to distinguish it from the original point X1 X2
How do wesmoothpaths? We now define the counter weight, which drags the point Y1 back to the original position X1 X0 X1 X2
Additional terms • Distance to wall • Fixed points • Similarity of twofollowing segments
Pathsmoothing Demo using gradient descent D:\Skole\AU-TekniskIT\Kalman\Min præsentation\Eksempel\Pathsmoothdemo\Pathsmooth.m
PID controlling Cross trackerror Desiredpath Use the error to control the steering
Closed loop control systems • Use a measurement of output to control the input (Feedback)
PID control P depends on the present error, I on the accumulation of past errors, D is a prediction of future errors, e(t) = set point - process value
P-controlling Marginallystability unstable Cross trackerror Perfectlydamped Desiredpath
Error term • The error term is derived by subtracting the feedback (i.e. current position) from the set point (i.e. desired position). • e(t) = u(t) – y(t)
Proportional Term • Simple proportional coefficient Kp is multiplied by the error term. • Provides linear response to the error term.
Integral Term • Integral coefficient Ki is multiplied by the error term and added to the sum of all previous integral terms. • Provides response to accumulated error.
Derivative Term • Derivative coefficient Kd is multiplied by the difference between the previous error and the current error. • The derivative term slows the rate of change of the controller output
Discrete PID algorithm previous_error = setpoint - process_feedback integral = 0 while(1) { wait(dt) error = setpoint - process_feedback integral = integral + (error*dt) derivative = (error - previous_error)/dt output = (Kp*error) + (Ki*integral) + (Kd*derivative) previous_error = error }
Ziegler-Nichols • Gains are first set to zero. • P gain is increased until it reaches the ultimate gain, Ku, at which the output of the loop starts to oscillate. • The oscillation period, Pu, are used to set the gains as shown:
Demo 2D • D:\Skole\AU-TekniskIT\Kalman\Min præsentation\Eksempel\PID demo\ PIDdemo.py • D:\Skole\AU-TekniskIT\Kalman\Min præsentation\Eksempel\PIDsmooth\ PIDSmooth.py
= to be able to build a map of an environment and simultaneously localize within this map
Graph slam • Is to use a graph whose nodes correspond to the poses of the robot at different points in time and whose edges represent constraints between the poses.
Graph slam problem • To estimatethe posterior probability of the robot’s path and the map given all the measurements plus an the initial position • Assumption: The world is static
Constraints for graph slam: • Initial localizationconstraint • Relative motion constraints • Relative measurementconstraints • QUIZ: howmanyconstraints do we have in thisfigure i 1D? 6
Implementation of Graph based slam The bestestimate for all the robot locations and landmark locations
Quiz: 1D Slam Which cells will be modified? What will the values in the cells then be?
Quiz: 1D Slam Which cells will be modified? What will the values in the cells then be?
Quiz: 1D Slam Whichfieldsarenotmodifies?
Quiz: 1D slam • Find the location of the landmarks
Graph slam • Finds the most likelypathalongwith the measured location of landmarks X0 X1 • Maximize the probability!
Simplifying the probabilitymaximization Finds the most likelypathalongwith the measured location of landmarks Z1 X0 X1 +
Demo withdifferentmeasurementconfidences T0 T1 D:\Skole\AU-TekniskIT\Kalman\Min præsentation\Eksempel\Slam\slam.py
References • https://www.udacity.com • http://www.comp.dit.ie/jkelleher/rtf/classmaterial/week10/PathSmoothing.pdf