We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › SLAM robotic search-BETA
Page Index Toggle Pages: 1
SLAM robotic search-BETA (Read 1256 times)
SLAM robotic search-BETA
Mar 13th, 2009, 7:54pm
 
Hi,
I was introduced to Processing as a part of a course taught by Dr.Fishwick a couple of months ago. Its an amazing programming software!! I've tried some very basic stuff of simulating some basic 2D Simultaneous localization and mapping (SLAM) with a robot with side-scanning distance sensors (much the popular side-scanning Laser sensors eg. by Sick).

Its in it beta stage and the robot gets stuck at some corners in the room, so in case it does happen you can reset its position with a mouse click. I am working on using the image panning hack by matt.patey to incorporate surveillance of larger floor plans.

I'm a bit fascinated for having implemented a SLAM algorithm(simplistic version of it actually) right now so have put it on my homepage Smiley

http://milindshastri.googlepages.com/

Milind
Re: SLAM robotic search-BETA
Reply #1 - Mar 14th, 2009, 8:34pm
 
I like watching the algorithm do it's thing, but can you give us an overview of how it works? What's the general repeated process it follows in terms of finding a direction to move to?

I noticed it doesn't get trapped in tight spaces easily. Specifically ,in the bathroom that has the 1/2 closed door it seemed to do alright in getting out.
Re: SLAM robotic search-BETA
Reply #2 - Mar 14th, 2009, 9:13pm
 
Mapping: The objective is to make the robot traverse through an unknown floor map and be able to generate a map based on the vector V1 + V2; where V1=position vector of robot & V2=position vector of obstacle. To put it very simply, this is the coarse algorithm for generating the map on the right side of the screen.

Obstacles: The obstacles are defined as colored pixels which lie a 3D distance within a threshold from a specified color. In this case Ive defined the obstacle color to be (50,50,50) and the threshold distance as 90.

Sensor: The sensor is a made by rays casts from the robots front up to a fixed range and checking pixel values matching the obstacles color. The rays are drawn from -theta to +theta, in fixed angular intervals, relative to the rotational orientation of the robot.

Avoidance rule: The most essential avoidance rule is
ThetaDirectionRobot+= thetaObstacle/radiusObstacle*30*0.6*random(0.5,1.5);
Acceleration=0.3/(100-radiusObstacle);
Speed+=Acceleration; //max and min speeds are defined so that it doesn't go too fast (front & back)

With this avoidance logic, the robot avoids dark pixels( obstacles) and if it gets close to one it rotates proportional to angular position of obstacle and inversely proporitonal to distance of obstacle and decelerates too (AceFace: This is why it gets out of the bathroom door most of the time). Once it moves away from obstacles within visible range it moves straight and gains speed.

Image Panning: For panning through a large image floor plan I followed http://processing.org/hacks/hacks:offscreen?s=pan%20image . It worked wonders :)


Re: SLAM robotic search-BETA
Reply #3 - Mar 14th, 2009, 9:56pm
 
I am thinking of how to implement a path search algorithm: which can find the shortest distance from startPoint to endPoint by avoiding obstacles (some colored pixels on a plain background). So in a typical situation, the user can click at a point on the SLAM generated map and the robot will try to find a shortest path to it. (based on already implemented logic, it will also dynamically continue marking obstacles and keep trying till a path is found). This is a simulation of a typical reconnaissance mission.

If anyone has any ideas on an easy and elegant way to implement the the shortest path search please feel free to discuss it.
Re: SLAM robotic search-BETA
Reply #4 - Apr 13th, 2009, 9:01am
 
Ive finally got the path finding A* search implemented! The AI library by Aaron Steed http://www.robotacid.com/PBeta/AILibrary/  was very helpful. Thanks.

You can hover your mouse over the grid on a region you want the robot to reach and the robot will find a way, keep updating the obstacles it has seen and continue to calculate the shortest path with the latest available information. Pretty much like a surveillance/ reconnaissance mission  where the user can only see the sensor acquired data (right half of the screen) .

I will cleanup the code and publish a better version soon.
Cheers

Milind

update> I've shifted the applet inside the website. It would need some exploring on http://milindshastri.googlepages.com/projects to find. Sorry for the inconvenience.
Page Index Toggle Pages: 1