Author Topic: A* (A-star) based pathfinding with the ER1 robot.  (Read 11603 times)

0 Members and 1 Guest are viewing this topic.

Offline SciTech02Topic starter

  • Robot Overlord
  • ****
  • Posts: 136
  • Helpful? 3
  • Life's but a green duck with soy sauce. -MegaHAL
A* (A-star) based pathfinding with the ER1 robot.
« on: October 29, 2008, 08:23:56 PM »
I have finally finished my pathfinding system.  It is divided between 4 programs, all written in Python.  The first one is slightly modified version of the original A* (A-star) program I wrote.  That program analyzes a created map, finds a path and then marks said path.  The second program "move_ER1_across_path.py" looks at this marked map by starting at the start cell.  It looks for surrounding cells that are marked (and therefore, part of the path), turns in the direction of that cell if needed or adds that cell to a move forward variable, if it's heading the correct direction.  When it detects that it must turn, it moves forward the amount of cells stored in the forward variable and then turns changes direction as needed.  So, my program executes movement commands while it is still "figuring out" what movement commands to be sent next (as opposed to finding every movement command first and then executing them all in order).  The third program stores variables that travel among the other 3 programs and the fourth program is a prompt that asks for what start cell is the robot at, what is its current heading etc.  It basically ties the other programs together.

My system right now is ER1 robot specific, but by reading the movement code, you could modify it for any robot.  However, if there are still some ER1 robot owners out there, they can try this out (we're still alive).

Because I do not have a YouTube account, I put the video I made of me demonstrating my robot using this system and the 4 related programs into a single zip folder.  The video is actually 2 videos I edited together in WMM with music (my camera couldn't hold the amount of data for 1 video, so I shot 2 almost back to back).  Please download it from the download link at the bottom of this post and tell me what you think (the video is in wmv format).  Thank you for reading.

SciTech02

http://www.mediafire.com/download.php?j4ammz3myjm
« Last Edit: October 31, 2008, 11:20:07 AM by SciTech02 »
Check out the Evolution Robotics, ER1 robot, and ERSP Resource Page: http://www.societyofrobots.com/member_tutorials/node/336

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: A* (A-star) based pathfinding with the ER1 robot.
« Reply #1 on: October 30, 2008, 10:09:40 PM »
I don't see any download links . . . does it require one to register?

(use Youtube, silly :P)

Offline SciTech02Topic starter

  • Robot Overlord
  • ****
  • Posts: 136
  • Helpful? 3
  • Life's but a green duck with soy sauce. -MegaHAL
Re: A* (A-star) based pathfinding with the ER1 robot.
« Reply #2 on: October 31, 2008, 09:21:47 AM »
I knew someone would get confused eventually.  You do not have to register, but it is confusing at first to download anything.  Alright, when you goto the link, it sometimes leads to an advertisement.  To continue to the download area, look towards the top-right corner of the screen to see a "continue to..." button.  Then, you'll reach a page with a large advertisement (describing the website) right in the middle of the page.  Again, at the top-right corner of the screen, you'll see 3 letters and a place to type them (it's some security code thing).  After that, you'll reach a download page, where you have to wait for a given amount of time (a timer is the middle of the screen).  Finally, that timer turns into a download button, press it, and you'll get the data (kind of a hassle, I know).  I only discovered all of the crap you had to jump through after I uploaded my file.  :-\

I know, a YouTube account would be very helpful, but I don't have one.  :( I may get one soon and repost the video.

Sorry about the trouble.

EDIT: Changed the download site.  It should be easier now (goto the link and a page with the download link should be right there).
« Last Edit: October 31, 2008, 06:17:43 PM by SciTech02 »
Check out the Evolution Robotics, ER1 robot, and ERSP Resource Page: http://www.societyofrobots.com/member_tutorials/node/336

Offline ArcMan

  • Supreme Robot
  • *****
  • Posts: 519
  • Helpful? 4
  • Mmmm... Plasma
Re: A* (A-star) based pathfinding with the ER1 robot.
« Reply #3 on: October 31, 2008, 01:34:03 PM »
LOL.  You could have registered with YouTube and uploaded the video in the time it took to write those instructions   ::)

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: A* (A-star) based pathfinding with the ER1 robot.
« Reply #4 on: November 02, 2008, 08:52:31 PM »
I've rebuilt my ER1 today. I still have to get a battery and a transformer for the charger. Also I need to build a box to house the motherboard, since I am not using a laptop. No arm for now, just the basic kit. I will look into adding a micro and a pan/tilt for the camera. After all is working, I'll see about the arm again. I hope to be able to make a video of it soon...
Check out the uBotino robot controller!

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: A* (A-star) based pathfinding with the ER1 robot.
« Reply #5 on: November 02, 2008, 09:46:51 PM »
I tired to buy an ER1 a year ago from some store. They delayed on the order for 6 months and ended up calling me to tell me that they were out of stock. Bastards. Since the ER1 was discontinued unless you buy a 3000 dollar package, I went along and built Chives.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline SciTech02Topic starter

  • Robot Overlord
  • ****
  • Posts: 136
  • Helpful? 3
  • Life's but a green duck with soy sauce. -MegaHAL
Re: A* (A-star) based pathfinding with the ER1 robot.
« Reply #6 on: November 02, 2008, 11:22:29 PM »
I tired to buy an ER1 a year ago from some store. They delayed on the order for 6 months and ended up calling me to tell me that they were out of stock. Bastards. Since the ER1 was discontinued unless you buy a 3000 dollar package, I went along and built Chives.

I understand what you mean.  I discovered the ER1 right after they stopped making it (go figure).  Until recently, I thought the only robot in the world that had speech capabilities, computer vision, object recognition and voice recognition was the ER1 robot.  When I finally got one off eBay, I found people who built there own PC bots that had these capabilities (Chives was one of them).  What I would like to do sometime in the future is create an ER1 clone, that is, a PC bot with all the same features of the ER1, but built with standard hardware and available software (all open source if possible).  Then people who still want an ER1 can research mine and eventually have their own, custom "ER1".

To Ro-Bot-X: I know your robot has a pan and tilt head.  A first upgrade I wanted for my ER1 was a pan and tilt head, but I don't know which one to try.  If you could post some details about yours, it would be helpful.
« Last Edit: November 02, 2008, 11:23:34 PM by SciTech02 »
Check out the Evolution Robotics, ER1 robot, and ERSP Resource Page: http://www.societyofrobots.com/member_tutorials/node/336

Offline SciTech02Topic starter

  • Robot Overlord
  • ****
  • Posts: 136
  • Helpful? 3
  • Life's but a green duck with soy sauce. -MegaHAL
Re: A* (A-star) based pathfinding with the ER1 robot.
« Reply #7 on: November 21, 2008, 07:16:13 PM »
UPDATE:

I have improved the "move_ER1_across_path.py" script significantly.  Before, the program paused for a calculated amount of time, so it would not execute the next movement before the other one finished (the next movement command would interupt the original command).  The calculation used to find out how long to pause was approximate, sometimes it would wait to long or worse, not long enough, messing up the accuracy.  Also, if you changed the size of each cell, the constants had to be remade in a trial and error method (not very user friendly).

Now, however, my script makes full use of the "events" API command.  Basically, it waits until the robot hardware sends a message through the TPI socket that says "move done" and then executes the next movement.  This should make the path traversing quicker, smoother and much more accurate.

I have attached the new, updated script to this post.  It's a .txt file, so you have to turn it into a .py file to use it and make its name exactly the same as the original.

SciTech02

EDIT: on line 50 of the new script, make timeout equal to 1 (in the "evocon" function), instead of 0.  When it equaled 0, a strange error would occasionally come up; multiple "OK" messages would be sent by the "events" command after finishing a move and an index error would stop the script.
« Last Edit: November 23, 2008, 06:28:13 PM by SciTech02 »
Check out the Evolution Robotics, ER1 robot, and ERSP Resource Page: http://www.societyofrobots.com/member_tutorials/node/336