0% found this document useful (0 votes)
90 views12 pages

Project 2

This document describes work done on mapping for a robot using a laser sensor. It discusses 3 questions: 1) Creating a 2D occupancy grid map from laser scan data. An algorithm is presented that processes the data to identify obstacles and clear areas. 2) Analyzing 3D point cloud data to classify surfaces as horizontal, ramps, or obstacles. Vectors are used to calculate surface angles. 3) Displaying terrain type classifications like ramps on the occupancy grid based on point coordinates and angles. The results show the generated occupancy grid map and classified surfaces. Room for improvement is discussed, like reducing noise and using more sophisticated algorithms.

Uploaded by

Ashish Lal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views12 pages

Project 2

This document describes work done on mapping for a robot using a laser sensor. It discusses 3 questions: 1) Creating a 2D occupancy grid map from laser scan data. An algorithm is presented that processes the data to identify obstacles and clear areas. 2) Analyzing 3D point cloud data to classify surfaces as horizontal, ramps, or obstacles. Vectors are used to calculate surface angles. 3) Displaying terrain type classifications like ramps on the occupancy grid based on point coordinates and angles. The results show the generated occupancy grid map and classified surfaces. Room for improvement is discussed, like reducing noise and using more sophisticated algorithms.

Uploaded by

Ashish Lal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Ashish Lal

Project 2
MTRN3100
Ashish Lal 9/16/2010

Ashish Lal

Contents
Introduction ............................................................................................................................................. 3 Equipment and experimental method ..................................................................................................... 4 Question 1 ....................................................................................................................................... 5 Question 2 ....................................................................................................................................... 7 Question 2 ....................................................................................................................................... 8 Question 3 ....................................................................................................................................... 8 Results ..................................................................................................................................................... 9 Discussion ............................................................................................................................................. 11 Conclusion ............................................................................................................................................ 12

Ashish Lal

Introduction
Creating a robot does not just involve with design of the physical components of the circuits and motor to be used, it also needs a software which will help the robot to do certain task. A very important aspect of this software design is implementing the map of the surrounding terrain. Without a map a robot is limited to be moving around. This report focuses on the design of a map, defined by the data read through the sensor LMS200 laser. Question 1 required the programmer to create a 2D map (OG grid) based on the data received from a standstill LMS200 laser in real time processing and display the obstacles and safe and unsafe area on the map for the robot Question 2 required the programmer to use the 3D images produced in project 1 to determine triangular flat patches defined by the 3 neighbouring points. These surfaces were then classified as: a) Almost horizontal (~180 degrees) b) A valid ramp (< 15 degrees) c) Obstacles (> 15 degrees) Question 3 required the programmer to display the information of the type of terrain such as if it was a ramp on the occupancy grid respective of the coordinates.

Ashish Lal

Equipment and experimental method


The equipment used was the LMS200 laser, an encoder of a motor of a nodding laser and various computers equipped with the program Matlab, which was used to write the functions that perform the required tasks. Matlab files that collect the data read by the sensors and the sensor reading program possum were also given. From here, the functions were created through experimentation, research from the internet, and consultation with the lecturer-incharge and tutors.

Ashish Lal

Question 1

This problem required to design of a 2D map from the data provided from the laser scan. To implement the solution for this mapping problem, an occupancy grid was defined in the function.
OG = zeros(150,150); %%% Creating a 150 by 150 matrix f zeros OG = OG+5; %%% Value is set to 5 for all the elements

The next step was to determine logically a way of accessing certain parts of the matrix OG.

l = Y(i); ANGLE = atan(X(i)/Y(i));

The above figure shows the basic idea followed to access the reference cell. In order to access the area in front or behind of the reference cell a vector is created with a specified ANGLE. This vector is then accessed in loop where l 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.

Ashish Lal

The next step was to determine the state of the reference cell and setting a value to it. A part of the algorithm used in this part is shown below
while l > 0.1 XVEC = floor((5+l*tan(ANGLE))*15); YVEC = floor(l*15); %in front of obstable assume clear if XVEC>0 && XVEC<151 && YVEC>0 && YVEC<151 % checking within the OG OG(151-YVEC,XVEC) = 0; end l = l-0.01;

This first segment of algorithm clears the cells in front of the obstacle since the laser has scanned this area and is aware of the surrounding. The XVEC and YVEC are in a loop with l increasing and decreasing to look at every cell in the direction of the vector i.e. in the direction of the reference cell. It then clear the cells setting OG value to 0. The reason XVEC and YVEC are multiplied by 15 is to get the correct scale on the occupancy grid. It is scaling from the 10m by 10m grid to a 150 by 150 grid.

XVEC = floor((X(i)+5)*15); YVEC = floor((Y(i))*15); %obstacle detected if XVEC>0 && XVEC<151 && YVEC>0 && YVEC<151 % checking within the OG OG((151-YVEC),XVEC) = 20; end

The above segment of code sets the XVEC and YVEC to the value of the obstacle and similar to the first segment of code it sets the OG cell value to 20 which is the value of an obstacle.

OG(OG > 10) = OG(OG > 10) - 1; OG(OG < 10) = OG(OG < 10)+ 1;

After setting the obstacle value and clearing the areas in front, another operation is carried out by the segment of code above. It sets the OG value to increase by one if it is <10 and allows it to decrease by one if it is >10. Overall when the OG is displayed it outlines the different areas of the map with different colour code.

Ashish Lal Question 2

The problem required to determine the surfaces and classify in different categories. The approach taken was looking at 3 points that are 6 units apart and creating two vectors from it.
dx1 dy1 dz1 dv1 = abs(Axx((mod(i,M)+1),(j+deltaB)) Axx(((mod(i,M)+1)+deltaA),j)); = abs(Ayy((mod(i,M)+1),(j+deltaB)) - Ayy(((mod(i,M)+1)+deltaA),j)); = abs(Azz((mod(i,M)+1),(j+deltaB)) - Azz(((mod(i,M)+1)+deltaA),j)); =[dx1, dy1, dz1];

The above segment of algorithm is in a loop and it logically identifies for points 6 units apart for the first half of the data and then identifies points backwards from the end of the data array -6 units distance apart. It is important have this condition so the counter doesnt go over the length of the array to find points. Below is a visual representation of the code for the first for loop with i = 6.

Ashish Lal Question 2

The next step is to take a perpendicular vector to dv1 and dv2 i.e the cross product of the two vectors and then find the angle between the cross product vector and a defined unit vector. This angle determines the slope of the 3 points in space and hence it can be identified as a vertical surface or a safe ramp (< 15 degrees) and a unsafe ramp (>15 degrees). The angle between the opposite negative is also taken to make a comparison for the better angle.
unitvec = [0,0,1]; negunitvec = [0,0,-1]; cp = cross(dv1,dv2); pos = atan2(norm(cross(cp,perp)),dot(cp,perp))*180/pi; neg = atan2(norm(cross(cp,negperp)),dot(cp,negperp))*180/pi;

Question 3

This part of the implementation of the map, a occupancy grid had to be generated according to the different slopes. The algorithm and idea generated here is same as in Question 1, but different values are assigned for differing conditions.
if (Azz(mod(i,M)+1,j)<200) % checks the height to be less then 200 Xx = floor(((Axx(mod(i,M)+1,j)/100)+5)*15); Yy = floor(((Ayy(mod(i,M)+1,j)/100))*15);

The code generated omits any point which is higher than 200 cm, it is because the robot designed would be of a smaller height and doesnt need to be aware of obstacles > 200 cm high. Omitting these points also helps to run the code more efficiency since there is less data.
if Xx>0 && Xx<151 && Yy>0 && Yy<151 if angle(mod(i,M)+1,j)>0 && angle(mod(i,M)+1,j)<11 OG((151-Yy),(151-Xx)) = 13; end if angle(mod(i,M)+1,j)>10 && angle(mod(i,M)+1,j)<21 OG((151-Yy),(151-Xx)) = 15; end if angle(mod(i,M)+1,j)>20 OG((151-Yy),(151-Xx)) = 20; end end

The next step is to assign each type of slope some value which would show on the OG. The conditions used are: - if the angle is between 0 to 11 degrees it assigns value 13 to the OG grid - if the angle is between 10 to 21 degrees it assigns value 15 to the OG grid - if the angle is > 20 degrees it assigns value 20, which is the unsafe areas on the OG.

Ashish Lal

Results

Figure 1 Figure 1 above is the occupancy grid 150 by 150. It shows the obstacles as the maroon blocks and the green area is the known clear area where the robot is allowed to travel. The blue area indicates the unknown space, which is behind the obstacles. The exact information cannot be obtained in this area because the laser hits the obstacle and isnt able to go behind it.

Ashish Lal

Figure 2

Ashish Lal

Discussion
The occupancy grid obtained in this procedure is a reasonably well, but could be perfected in different ways. A very important fact is that the outliers recorded in the grid are largely due to the noise. This noise is generated in the motor when it is nodding as well as surrounding mechanical work contribute towards it. Another way to improve the OG is to have a more efficient and elegant algorithm, using Hough transform would be a better way. Some of the outliers in the part 1 of the developing the OG grid is due to the vector coming in contact with a significantly small object, however according to the algorithm it fills the whole cell to be occupied. Using this cautious approach to the design of the map ensures that the robot navigates around the object regardless of it being there or not, since it could be much more fatal if the robot collides into the obstacle. Another variable was the positioning of the LMS200 laser; it was not on a level platform and this caused some discrepancies in determining the slopes. However this was corrected and the laser was adjusted to be positioned to approximate level platform, which eliminated the errors generated.

Ashish Lal

Conclusion
The task of determining the OG grid is very significant in designing navigating systems for a robot. A more efficient algorithm would prove to run more quickly, having a lesser load on the processor hence maps would be generated quickly. This is a critical point as in a dangerous situation e.g. if a automated robot was to enter a terrain looking for a target moving, it would be quick generate the moving object and can do some calculations to even predict where the target is headed. Determining the slopes of the surrounding is also very helpful for the robot as it generates a path which is would require less work .(such as avoid higher ramps) Overall navigating system i.e OG grids are very important in any design of a automated robot.

You might also like