I found the algorithm of path finding under forum ofRobotC:viewtopic.php?f=15&t=5616&hilit=mapAzhari put it in. It was written by Tim Friez.I modified it as I needed it.It is very easy to modify the matrix/grid and change the starting point of robot and the goal.I coded it for my LEGO NXT REM-Bot, which works with a HT-Gyro. I didn't use the sonar or touchsensor.

Video:

I tried the movings with synchronised motors, but it works better without it.

A further improvement it would be, if the robot detects new obstacles e.g by its sonar or touch sensor and implement it into the matrix. And after doing so to recalculate the path.

The code (the algorithm isn't coded by myself!! I used it as you can read at the top.)

/* Credits :Special thanks to to Xander Soldaat for gyro drivers and example codes!I found the algorithm of path finding under forum from RobotC:http://www.robotc.net/forums/viewtopic.php?f=15&t=5616&hilit=mapAzhari put it in, but I don't know who made it.I modified it as I needed it.*/

// Calculate the new heading by adding the amount of degrees // we've turned in the last 20ms // If our current rate of rotation is 100 degrees/second, // then we will have turned 100 * (20/1000) = 2 degrees since // the last time we measured. heading += rotSpeed * 0.02;

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum