Author Topic: adaptive mapping with lego  (Read 3869 times)

0 Members and 1 Guest are viewing this topic.

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,176
  • Helpful? 5
adaptive mapping with lego
« on: January 04, 2008, 12:20:32 PM »
I was wondering if it would be possible to do adaptive mapping with the lego mindstorms nxt set using nqc.
Robots are awesome!

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: adaptive mapping with lego
« Reply #1 on: January 04, 2008, 01:52:06 PM »
I think I can replicate the adaptive mapping robot and algorithm using one Lego RCX, 3 Lego geared motors, 3 rotation sensors, one custom Active Sensor Multiplexor and one custom IR Range Sensor. Maybe a compass too. I have all these, so I can test this out. I find it easier to do it the Lego way than the regular way.

There is absolutely no reason why it couldn't be done using a NXT set. It's a lot easier than using the RXC kit, because the motors have rotation sensors integrated, and you have all sensor ports free. The only thing that needs to be done is build a custom IR Range Sensor, since the Ultrasonic sensor beam is too wide. That should not be hard, since there are adaptors for the old Lego active sensors, which are analog. There are companies that build custom sensors for NXT. But the most important thing is that Lego RCX and NXT are using multitasking software (NQC)!

I don't have a NXT set yet to do it, so feel free to do it yourself!
Check out the uBotino robot controller!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: adaptive mapping with lego
« Reply #2 on: January 04, 2008, 03:27:37 PM »
Quote
There is absolutely no reason why it couldn't be done using a NXT set.
Im too lazy to look at the NXT datasheets, but perhaps it doesn't have enough memory?

I maxed out with a 15x15 map using the ATmega168 . . .

something to look in to . . .

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,176
  • Helpful? 5
Re: adaptive mapping with lego
« Reply #3 on: January 04, 2008, 04:17:26 PM »
If i can figure it out this would definently be cool to do.
Robots are awesome!

Offline Del

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 0
Re: adaptive mapping with lego
« Reply #4 on: January 04, 2008, 04:52:40 PM »

This article doesn't exactly answer your question,
but it may be a part of the solution.

At least, it gives some idea of what it possible with the NXT brick:

http://www.itee.uq.edu.au/%7Ewyeth/NXT/#Localisation_with_a_Particle_Filter

hth

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: adaptive mapping with lego
« Reply #5 on: January 05, 2008, 06:29:46 AM »
Im too lazy to look at the NXT datasheets, but perhaps it doesn't have enough memory?
I maxed out with a 15x15 map using the ATmega168 . . .
something to look in to . . .

I was thinking about the memory limitations. What if we use a (I2C) serial EEPROM to store the big map an pull parts of it in the internal (ram) memory of the MCU? Say we can hold a 10x10 grid in memory and 100x100 in the eeprom, every time we reach close to a side of the small grid we update it to the big grid and load the neighbour 10x10 in ram... Would this be possible? How big should be the eeprom?
Check out the uBotino robot controller!

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,176
  • Helpful? 5
Re: adaptive mapping with lego
« Reply #6 on: January 05, 2008, 08:40:54 AM »
On the lego website http://shop.lego.com/product/?p=9841&LangId=2057&ShipTo=US it says that it has a 32-bit microprocessor.
Robots are awesome!

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: adaptive mapping with lego
« Reply #7 on: January 05, 2008, 09:24:31 AM »
Mindsensors are building lots of sensors for NXT, like NXTcam, accelerometers, compass and so on. Even a few Sharp IR sensors, like this one:
http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=72
Check out the uBotino robot controller!

Offline TrumpkinTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,176
  • Helpful? 5
Re: adaptive mapping with lego
« Reply #8 on: January 06, 2008, 01:38:54 PM »
I will probably try that after my current project
Robots are awesome!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: adaptive mapping with lego
« Reply #9 on: January 06, 2008, 03:24:57 PM »
Quote
I was thinking about the memory limitations. What if we use a (I2C) serial EEPROM to store the big map an pull parts of it in the internal (ram) memory of the MCU? Say we can hold a 10x10 grid in memory and 100x100 in the eeprom, every time we reach close to a side of the small grid we update it to the big grid and load the neighbour 10x10 in ram... Would this be possible? How big should be the eeprom?
I think that should work, although I've never used an NXT so not sure how hard that will be.

So for my mapping I used an 8 bit int (byte) in each matrix location.

So thats 15 x 15 x 1 byte = 225 bytes for my 15x15 map. So if for example you have 1k available, you can get a 31x31 map . . . I think a good accurate map would be at least 100x100 . . . but then processing gets kinda crazy for large maps . . .

I really should learn more about memory usage when it comes to code . . .

Offline hazzer123

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: adaptive mapping with lego
« Reply #10 on: January 06, 2008, 04:10:41 PM »
To store the maps for my mazes i use just 2 bits. 1 for the existance of a south wall, and one for the existance of an east wall. That means that for a 16x16 maze it uses up (16x16x2)/8  = 64 bytes. The north wall of a cell is the same as a south wall for the cell above it, so i don't have to record it again.

If then the problem is storage for the flooding values, well instead of having the number of moves away from the destination cell stored in each place, you can have the same number mod 4. The algorithm still works like this, you just have to look for a cell with number 4 in it if the current cells value is 0.

Hazzer
Imperial College Robotics Society
www.icrobotics.co.uk

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: adaptive mapping with lego
« Reply #11 on: January 09, 2008, 12:16:51 PM »
Ok, so 100x100 map will need 10,000 bytes to be stored. That's about 10 kbytes (a little less).

I have bought a 24LC256 I2C serial eeprom. It has 32 kbytes or 256 kbits. So it can store a map 3 times that big. And it works at a speed of 400khz on the serial bus... It has 3 address pins, and up to 8 devices per bus can be linked. The cost: about a dollar a piece.

Check out the uBotino robot controller!