P545 – Embedded & Real-Time Systems Obstacle Avoidance by Yasir Ibrahim
Execution per clock tick One loop on the following: Heading control Path following Laser reading Avoid obstacles Adjust speed Check corridor boundaries
Heading PID Continuous control Cart turns when the error in the feed back is not ZERO. Actually it is not even checking against zero, it continuously feeds back inputs and issues turn commands.
waypoint2 waypoint3 waypoint1
waypoint2 waypoint3 waypoint1
waypoint2 waypoint3 Supposed heading Actual heading (compass) waypoint1
waypoint2 waypoint3 Supposed heading Actual heading (compass) error waypoint1
waypoint2 waypoint3 Supposed heading Actual heading (compass) Error=supposed heading – actual heading Turn_command_inverse=p*error P=1/(smallest_turn_radius*suitable_angle) P=1/(2.0*90.0) error waypoint1
waypoint2 waypoint3 Supposed heading Actual heading (compass) Error=supposed heading – actual heading Turn_command_inverse=p*error P=1/(smallest_turn_radius*suitable_angle) P=1/(2.0*90.0) error waypoint1
GPS follower When to pick the next waypoint. Two cases: 1) The distance to the next waypoint is getting shorter. (till it is less than LBO) 2) The distance from the previous waypoint is getting longer. (till it is larger than distance between the two waypoints) The heading is working continuously.
waypoint2 waypoint3 waypoint1
waypoint2 waypoint3 length waypoint1
waypoint2 waypoint3 LBO length waypoint1
waypoint2 waypoint3 LBO r length r < LBO Or d >= length d waypoint1
waypoint2 waypoint3 LBO r length r < LBO Or d >= length d waypoint1
waypoint2 waypoint3 r LBO d length r < LBO Or d >= length waypoint1
waypoint2 waypoint3 d length r < LBO Or d >= length waypoint1
waypoint2 waypoint3 waypoint1
waypoint2 waypoint3 waypoint1
Obstacle Avoidance Reading the laser device. Filtering the list (taking only what is in the cart’s path). Averaging the list of obstacles Adjusting the output obstacle’s LBO. Keeping history of obstacles, specially the previous one.
waypoint2 waypoint3 waypoint1
waypoint2 waypoint3 waypoint1
a Obstacle GPS c a=b*(sin(alpha)) b Outside when a > c/2 + O_lbo alpha GPS
Obstacle GPS a c a=b*(sin(alpha)) b Inside when a<=c/2 + O_lbo alpha GPS
Obstacle GPS a c a=b*(sin(alpha)) b Inside when a<=c/2 + O_lbo alpha GPS
a Obstacle GPS c a=b*(sin(alpha)) b Inside when a<=c/2 + O_lbo alpha GPS
a Obstacle3 Obstacle1 c Obstacle2 Obstacle4 b 1 clock tick
a Obstacle1 c a=b*(sin(alpha)) b Inside when a<=c/2 + O_lbo alpha GPS
Obstacle2 a c a=b*(sin(alpha)) b Inside when a<=c/2 + O_lbo alpha GPS
Obstacle3 a c a=b*(sin(alpha)) b Inside when a<=c/2 + O_lbo alpha GPS
Obstacle4 a c a=b*(sin(alpha)) b Outside when a>c/2 + O_lbo alpha GPS
Obstacle3 Obstacle1 Obstacle2 c 1 clock tick
Obstacle3 Obstacle1 Obstacle2 c 1 clock tick
1 clock tick AO=0 AO=∑(Oi + AO )/i ALBO=(LBOk-1+d+LBOk)/2 Obstacle3 Obstacle1 Obstacle2 c AO=0 AO=∑(Oi + AO )/i ALBO=(LBOk-1+d+LBOk)/2 d=distance(AO,Oj) 1 clock tick
c Obstacle 1 1 clock tick
waypoint2 waypoint3 waypoint1
waypoint2 waypoint3 Next heading of corridor Current heading of corridor waypoint1
waypoint2 waypoint3 Next heading of corridor Current heading of corridor Next turn is left Optimal avoidance from the right of obstacles waypoint1
waypoint2 waypoint3 Does not fit waypoint1
waypoint2 waypoint3 Fits waypoint1
waypoint2 waypoint3 Fits Synthesized waypoint waypoint1
waypoint2 waypoint3 Becomes my next waypoint waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
More obstacles Other configurations
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 Does not fit waypoint4 waypoint1
waypoint2 waypoint3 Fits waypoint4 waypoint1
waypoint2 waypoint3 Fits waypoint5 waypoint4 Synthesized waypoint waypoint1
waypoint2 waypoint3 Becomes my next waypoint waypoint5 waypoint4 waypoint1
waypoint2 waypoint3 Becomes my next waypoint waypoint5 waypoint4 If overlaps with my current waypoint, replace. waypoint1
waypoint2 waypoint3 Becomes my next waypoint waypoint5 waypoint4 If overlaps with my current waypoint, replace. waypoint1
waypoint2 waypoint3 Becomes my next waypoint waypoint5 waypoint4 If overlaps with my current waypoint, replace. waypoint1
waypoint2 waypoint3 Becomes my next waypoint waypoint5 waypoint4 If overlaps with my current waypoint, replace. waypoint1
waypoint2 waypoint3 waypoint6 Becomes my next waypoint waypoint5 waypoint1
waypoint2 waypoint3 waypoint6 Becomes my next waypoint waypoint5 waypoint1
waypoint2 waypoint3 waypoint6 Becomes my next waypoint waypoint5 waypoint1
waypoint2 waypoint3 STOP STOP waypoint6 Becomes my next waypoint waypoint5 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 waypoint4 waypoint1
waypoint2 waypoint3 fits waypoint4 waypoint1
waypoint2 waypoint3 waypoint5 Synthesize waypoint waypoint4 waypoint1
waypoint2 waypoint3 waypoint5 Synthesize waypoint waypoint4 Average waypoint4 and waypoint5 waypoint1
waypoint2 waypoint3 waypoint5 Synthesize waypoint waypoint4 Average waypoint4 and waypoint5 waypoint1
waypoint2 waypoint3 waypoint5 Synthesize waypoint waypoint4 Average waypoint4 and waypoint5 waypoint1
waypoint2 waypoint3 waypoint5 Synthesize waypoint waypoint4 Average waypoint4 and waypoint5 waypoint1
waypoint2 waypoint3 waypoint5 Synthesize waypoint waypoint4 Average waypoint4 and waypoint5 waypoint1
waypoint2 waypoint3 waypoint5 Synthesize waypoint waypoint4 Average waypoint4 and waypoint5 waypoint1
Staying inside corridor Synthesized collision bubble. How far it is synthesized depends on cart’s speed. It can be used to control speed (accelerate, decelerate, and stop) and help in heading control (pushing bigger error to the heading control to force on turning if the cart is going out the corridor).
waypoint2 waypoint3 waypoint1
?
It Is a synthesized point. Same as if it were a synthesized waypoint Or an obstacle. ?
It Is a synthesized point. Same as if it were a synthesized waypoint Or an obstacle. ? Speed
It Is a synthesized point. Same as if it were a synthesized waypoint Or an obstacle. ? Speed (D)istance from GPS to the cart’s font
It Is a synthesized point. Same as if it were a synthesized waypoint Or an obstacle. How far = Speed/2.0+D Speed (D)istance from GPS to the cart’s font
It Is a synthesized point. Same as if it were a synthesized waypoint Or an obstacle. How far = Speed/2.0+D Speed 3.0 m/s (D)istance from GPS to the cart’s font 1.6764 m
It Is a synthesized point. Same as if it were a synthesized waypoint Or an obstacle. How far = Speed/4.0+D How far = 3.0/4.0+1.6764= 2.4264 m From the GPS. Or How far= 2.4264 – 1.6764= 0.75m From the front of the cart. Speed 3.0 m/s (D)istance from GPS to the cart’s font 1.6764 m
waypoint2 waypoint3 0.5 2 waypoint1
waypoint2 waypoint3 0.75 3 waypoint1
waypoint2 waypoint3 1.0 4 The cart is going out waypoint1
waypoint2 waypoint3 1.0 4 The cart is going out Signal to slow down waypoint1
waypoint2 waypoint3 0.75 3 Slowed down waypoint1
2 50 waypoint2 waypoint3 Slowed down waypoint1
3 0.75 waypoint2 waypoint3 Slowed down waypoint1
Also, Collision bubble can be used to know if the cart is going out from the side of corridor.
waypoint2 waypoint3 2 0.5 waypoint1
waypoint2 waypoint3 3 0.75 waypoint1
Bubble LBO a a=b*(sin(alpha)) b Outside when a + Bubble LBO > LBO alpha LBO
Bubble LBO a a=b*(sin(alpha)) b Outside when a + Bubble LBO > LBO alpha LBO
Bubble LBO a b a=b*(sin(alpha)) Inside when a + Bubble LBO<= LBO alpha LBO
Path planning At each cycle, an algorithm iterates through all the waypoints and obstacles together. The algorithm adds two more waypoints at each existing waypoint. One before and one after the waypoint. The algorithm synthesizes the best waypoint around obstacles.
Previous Labs
Safety
try : adjust_speed() if (signal_stop == False): read_laser() follow_path() if(panic==True): self.which_side_of_obstacle() self.synthesize_waypoint() self.put_synthesized_waypoint() self.panic=False catch:
Default value for speed. Always storing the previous value. If one of the following sensors are providing unacceptable values (same value for along time or empty values), exception is thrown: GPS, Compass, or Laser.
TheEND