Anda di halaman 1dari 11

Ashish Lal

Project 3
MTRN3100
Ashish Lal 10/22/2010

Ashish Lal

Contents
1. Introduction ......................................................................................................................................... 3 2. Generating a real map from a mobile robots laser scans .................................................................... 3 3. Path finding ......................................................................................................................................... 5 a) Dijkstras Algorithm ................................................................................................................... 5

4. Fail-Safe Methods for the Robot......................................................................................................... 5 a) Implementation of the Barrier and Rings Method ................................................................... 5

5. Discussion ........................................................................................................................................... 7 6. Conclusion .......................................................................................................................................... 8 7. Appendix ............................................................................................................................................. 8 a) b) c) Appendix 1 .................................................................................................................................. 8 Appendix 2 .................................................................................................................................. 9 Appendix 3 ................................................................................................................................ 10

Ashish Lal

1. Introduction
The objective of this project is to design a map which takes real time simulated data from the robots scan. A path finding technique should also be developed, where a user can specify a desired destination along with fail-safe measures. It is also essential to take in account of the robot size.

2. Generating a real map from a mobile robots laser scans

To create a 2D map (OG grid) for the robot, data is collected from the LMS200 laser. This data is further processed in real time displaying the obstacles, safe and unsafe area on the map for the robot. The figure below shows the complete map of the area with obstacle information once the robot has moved around the room scanning the area.

200 180 50 160 140 120 150 100 80 200 60 250 40 20 300 0

100

50

100

150

200

250

300

Fig 1 and Fig 2 (different colour map) shows the occupancy grid with each grid resolution of 10cm by 10 cm and the dimensions of the grid as 300 by 300 (cells).

The occupancy grid (Fig 1 & Fig 2) is obtained after a devised algorithm is applied. When a single beam of laser hits and obstacle it stops there and that is how an obstacle is

Ashish Lal

determined. Since the area the laser travelled through before hitting obstacle is seen as an empty area a certain way is devised to clear this area in the OG.
Firstly, while considering the robot to be stationary (Fig XX) a vector is defined with a

specified ANGLE. This vector is then accessed in loop where l (the y value) is set to increase and decrease, this way all the cells can be accessed in front of the reference cell and given a value depending if its and obstacle, unknown or known areas on the map.

Fig 2 shows vector from the a stationary robot

Fig 3 shows vector from the a mobile robot

However, since the robot is moving in the 2-D space, problems occur when the robot scans a location that is behind it due to the actual vector (i.e. vector which normally is defined from laser sensor to the location of the obstacle it scanned.) Becoming inverted and pointing the wrong way and clearing spaces behind the robot. To overcome this dilemma, the directions of the vectors are checked before the spaces are declared as clear. If the vector is negative, its direction is inverted to the correct orientation as shown in Fig 3, so it points from the reference point toward the obstacle.

Ashish Lal

3. Path finding
a) Dijkstras Algorithm
It works for a given point in a map; the algorithm finds the path with lowest cost (i.e. the shortest path) between the two specified points. However this technique accounts for points only. Designing fully functional autonomous software for the robot would require considering the volume of the trolley itself. There are two ways of applying the solution, one is to modify the map, taking in account of the robot size and the other more difficult approach is modifying the algorithm. Modifying the algorithm would require the process to be performed on a series of different cells of the occupancy grid (which define the robot) increasing the time taken to find a feasible path to the desired destination. Therefore more feasible approach would be constructing barriers around the obstacles in the OG.

4. Fail-Safe Methods for the Robot


a) Implementation of the Barrier and Rings Method

Click at desired Initial Point 300 200 180 250 160 140 120 150 100 80 100 60 40 20 0
50 50
Click Here to END

Click at desired Initial Point 300 200 180 250 160 140 120 150 100 80 100 60 40 20 0

Click Here to END

200

200

50

50

100

150

200

250

300

100

150

200

250

300

Fig 4 The OG with Barriers(199) only

Fig 5 The OG with Rings and Barriers

Ashish Lal

The implementation of the barriers and rings (fig 5) occur before the path finding function is called. The obstacle (200) and the barrier (199) are set in the OG with a high value so that under no circumstances the path finding algorithm will travel though that area. However to be cautious, the implementation of the rings is essential since these essentially provide more safety feature for the robot to navigate around an obstacle. The level of safety can be set according to how many rings surround the barriers. The source code for the implementation of the barriers and rings are provided in appendix 2 and appendix 3 respectively. The dimensions of the barrier will be consistent to the dimensions of the robot. Specifically, the barrier will be half the width of the robot because this is the distance from the centre of the robot to its edge. However if the robot is not a perfect square, it can get very close to the wall or obstacles. To avoid this situation the maximum dimension of the robot can be chosen, but this will restrict the robot going through narrow corridors where it would actually fit in reality (e.g. navigating in a crowded hallway of the hotel). A better solution is to implement rings (fig 6 & 7) around the barriers which has a cost low enough to be a feasible path when there is no other path.

300

200 180

200 95 180 160 90 140 120 85 100 80 80 60 40 75 125 130 135 140 145 150 20 0

250

160 140 120

200

150

100 80

100

60 40 20 0

50

50

100

150

200

250

300

Fig 6 Shows the path generated on the OG

Fig 7 shows the robot moving through the narrow space.

Ashish Lal

300

100
250

90
200

80
150

70
100

60
50

50

50

100

150 x (index)

200

250

300

110

120

130 x (index)

140

150

160

Fig 8 shows topographic map i.e. the cost function with destination where red = expensive and blue = cheap route.

Fig 9 is a zoomed in version of the topographic map.

The cost to go function in Fig 8 & 9 shows the topographical cost map to go to each location. The scale is set where the blue indicates the easy to go to place therefore the cheaper place, while the red indicate the places its hard to get to i.e. more expensive. The blue areas can be seen close to the point since this area is easier and faster to get to and the robot has to avoid fewer obstacles. The red areas are further away from the origin of the robot since it would take longer to get to those points and it would have to avoid a greater number of obstacles to get to that point.

5. Discussion

This software developed for the robot is capable of running on a real-life robot; however its processing time is not as quick as expected in the real world industrial application. As development goes on for this software in the future, one could look into implementing software which considers the robot size in the Dijkstras algorithm, this would be a difficult task but if successful it will increase the efficiency of the robot. Another

Ashish Lal

limitation for this software is it doesnt take in account for the driving and manoeuvring capabilities of the robot and only gives a straight lined path (fig 9).

6. Conclusion
The project was a success where a consistent map was generated from the mobile robots laser scans. Dijkstras algorithm was used in combination to determine path finding. Fail-safe measures such as the applying barriers and rings around obstacles were successfully in implemented and was fully functional. The robots size was also taken into consideration and it could also travel through narrow spaces within the map without causing any damage to the robot itself and the surroundings.

7. Appendix
a) Appendix 1
This source code outlines the reversing of the vector and converting the map to a global axis.
timeLaser =double(Data.time); a = MyAPI.ReadPose() ; % read all new position records since last reading if a.n>1, % any new records? % yes, there are 'n' new readings timePose = a.Data(1:a.n,1) ; % timestamps of the readings. % estimate (in this case just interpolate) the robot's pose at % the time of the laser measurement if timeLaser<timePose(1), continue ; end ; if timeLaser>timePose(end), continue ; end ; % [Lx,Ly,Lh] are (x,y,heading) at time=timeLaser Lx = interp1(timePose,a.Data(1:a.n,2),timeLaser) ; Ly = interp1(timePose,a.Data(1:a.n,3),timeLaser) ; Lh = interp1(timePose,a.Data(1:a.n,7),timeLaser) ; % however the position corresponds to the centre of the back % axis, ==> I need to translate it to the laser position (front % of the robot) Lx = Lx + H*cos(Lh) ; % translate the point to the laser the robot's position)

position (H meters ahead

Ashish Lal
Ly = Ly + H*sin(Lh) ; else, continue ; end; % I convert the local laser readings --> global. aa2 = aa+Lh-pi/2+OffsetLaserAngle ; cosaa = cos(aa2) ; sinaa = sin(aa2) ; xx = Lx + Ranges.*cosaa ; yy = Ly + Ranges.*sinaa ; % xx[],yy[] are the laser's points expressed in the global % coordinate frame X = xx; Y = yy; % laser in global

for u=1:length(X); l = abs(Y(u)-(Ly)); %define vector length of laser globally as the distance to the %obstacle minus the robots current heading th = atan((X(u)-Lx)/(Y(u)-Ly)); %angle of laser vector also defined globally a=1; if Y(u)-(Ly) <0 a=-1; % to the left of origin end while l > 0.1 OG_x = floor((Lx+a*l*tan(th))*10+150); OG_y = floor((Ly+a*l)*10); if OG_x>0 && OG_x<301 && OG_y>0 && OG_y<301 OG(OG_y,OG_x) = 0; end l = l-0.01; end %global location of obstacle OG_x = floor((X(u))*10+150); OG_y = floor((Y(u))*10); if OG_x>0 && OG_x<301 && OG_y>0 && OG_y<301 OG(OG_y,OG_x) = 200; end end end;

b) Appendix 2
This source code outlines Implementation of the barriers method.
%% barrier %dimensions OG grids in cm %width grid (left-right) breadth grid (front_back) wg=10; bg=10; %robot dimensions in cm %width robot (left-right) breadth robot(front_back)

Ashish Lal
wr=60; br=60; %create barrier around obstacle left_right=ceil((wr/wg)/2); front_back=ceil((br/bg)/2); i_i=1:left_right; i_j=1:front_back; %create barrier around obstacle for b_i=1+left_right:300-left_right for b_j=1+front_back:300-front_back if OG(b_i,b_j) == 200 %implement barrier %left and right OG(b_i+i_i,b_j)=199; OG(b_i-i_i,b_j)=199; %above below OG(b_i,b_j+i_j)=199; OG(b_i,b_j-i_j)=199; %top left top right OG(b_i-i_i,b_j+i_j)=199; OG(b_i+i_i,b_j+i_j)=199; %bottom left bottom right OG(b_i-i_i,b_j-i_j)=199; OG(b_i+i_i,b_j-i_j)=199; end end end %barrier ends here

c) Appendix 3
This source code outlines Implementation of the rings method.
%% Analogue Bubble %decrementer 3,2,1 for ring = 3:-1:1; %analogue bubble if ring==1 intermediate = 90; elseif ring == 2 intermediate = 50; else intermediate = 10; end for r_i = 1+max(ring):300-max(ring) for r_j = 1+max(ring):300-max(ring) %if barrier if OG(r_i,r_j) == 199 for k = -1:1 if OG(r_i-ring,r_j+k) < intermediate; OG(r_i-ring,r_j+k) = intermediate; end if OG(r_i+ring,r_j+k) < intermediate; OG(r_i+ring,r_j+k) = intermediate; end if OG(r_i+k,r_j-ring) < intermediate; OG(r_i+k,r_j-ring) = intermediate; end

Ashish Lal
if OG(r_i+k,r_j+ring) < intermediate; OG(r_i+k,r_j+ring) = intermediate; end end end end end en %Analogue Bubble ends here

Anda mungkin juga menyukai