Log in

View Full Version : Can the robot read a text file?


CyDrive
03-09-2007, 12:51
Hello, I was just wondering whether or not the robot is capable of reading a text file. Or maybe is it possible to upload a single .c file to the robot at a time? Thank you for any help.

bear24rw
03-09-2007, 12:52
What do you mean by a text file? What would this file have in it?

CyDrive
03-09-2007, 12:55
Can it open a file and parse information in it if the file has a .txt extension

bear24rw
03-09-2007, 13:12
Um not directly, i guess theoretically you could store a file in eeprom and parse it from there or you could get somthing like (http://www.sparkfun.com/commerce/product_info.php?products_id=7955) where you could put a .txt file on a SD card and read it from the RC.. if your looking for like autonomous scripting there is a way to do that too using an array of commands, it know it was popular in 2005 but i dont know where to find a link to it now..

AdamHeard
03-09-2007, 13:55
Um not directly, i guess theoretically you could store a file in eeprom and parse it from there or you could get somthing like (http://www.sparkfun.com/commerce/product_info.php?products_id=7955) where you could put a .txt file on a SD card and read it from the RC.. if your looking for like autonomous scripting there is a way to do that too using an array of commands, it know it was popular in 2005 but i dont know where to find a link to it now..

kevinwatson.org has the code w/ autonomous scripting.


Also, CyDrive; It seems like you have something you want to do, why not tell us what you're trying to accomplish and we can reccomend the best way to do that within what the Robot controller can do.

Billfred
03-09-2007, 14:02
kevinwatson.org has the code w/ autonomous scripting.


Also, CyDrive; It seems like you have something you want to do, why not tell us what you're trying to accomplish and we can reccomend the best way to do that within what the Robot controller can do.
Right person, wrong URL:

http://kevin.org/frc/

CyDrive
03-09-2007, 14:06
My idea is to create a program that almost any team can use to create an autonomous mode in under 2 minutes. Of course they would have to pre-configure the software with certain variables. Though i think it would be a great idea. I can write all the code i just need to know really how to deliver it to the robot without constantly having to do a re-compile. I believe an upload and reading of a text file would be much better.

bear24rw
03-09-2007, 14:29
Actually this idea has been mentioned here before i know one kid ( i think he has a thread a couple down from yours) that is trying to use a game boy to kinda like what your talking about and if you do a search for USB or mass storage or SD card in the programming forum you will find a thread discussing exactly what your trying to accomplish

CyDrive
03-09-2007, 14:37
Yes I was reading his thread and i thought it was quite interesting and the idea is not my own by any means. Actually it is an accumulation of ideas that i thought would be useful. Imagine on screen of your computer is a picture of the playing field from a top down view of the playing field you just click to place a dot. You can edit the actions your robot does when it reaches that spot or a many multiple things. Though what other people have tried to accomplish isn't very all-around friendly. They are all good ideas but i think it would be easier to use if you just had to upload say a text file with equipment you already have and you already understand. I also think it will make integration with any robot easier.

AdamHeard
03-09-2007, 14:44
Yes I was reading his thread and i thought it was quite interesting and the idea is not my own by any means. Actually it is an accumulation of ideas that i thought would be useful. Imagine on screen of your computer is a picture of the playing field from a top down view of the playing field you just click to place a dot. You can edit the actions your robot does when it reaches that spot or a many multiple things. Though what other people have tried to accomplish isn't very all-around friendly. They are all good ideas but i think it would be easier to use if you just had to upload say a text file with equipment you already have and you already understand. I also think it will make integration with any robot easier.

Talk to team 40 about their 2006 autonomous.

they had an app on a pocket pc in which you literally drew the autonomous path of the robot and the robot did it. Very impressive. We went to the practice field with them (we were together in the next match) and they watched our autonomous. Right away, they made the perfect custom autonomous to go with ours. Best implementation of autonomous scripting I have ever seen.

CyDrive
03-09-2007, 14:52
I heard about that i heard it was done in Java. It sounded really cool. I will see if they will tell me anything.

Alan Anderson
03-09-2007, 15:06
Hello, I was just wondering whether or not the robot is capable of reading a text file. Or maybe is it possible to upload a single .c file to the robot at a time? Thank you for any help.

The IFI robot controller does not have access to a filesystem. I think the best alternative for your purpose is to implement your own protocol to read characters from the serial port and store them in EEPROM for later retrieval.

CyDrive
03-09-2007, 15:12
Now i see why team 40 used a hand held device. Thanks everyone for the help. I believe i have finally figured out how im gonna go about it. When i figure it all out i will definitely post all my code and the project.

AdamHeard
03-09-2007, 15:23
I heard about that i heard it was done in Java. It sounded really cool. I will see if they will tell me anything.

The pocket pc side was done in Java. From there I don't know what they did. It could've generated scripting for something like Kevin Watson's that needed to be copied and pasted. Or, more ideally they probably had the SD card plug into something on the robot like thunderchickens has (or at least crosstheroad electronics).

CyDrive
03-09-2007, 15:29
My theory is actually quite simple write directly to the EEPROM from my laptop with a custom program. Then use a custom scripting engine in the autonomous section. This will give me the 2 things i want. Ease of use and a fast way to create new autonomous modes.

Greg Marra
03-09-2007, 15:31
The pocket pc side was done in Java. From there I don't know what they did. It could've generated scripting for something like Kevin Watson's that needed to be copied and pasted. Or, more ideally they probably had the SD card plug into something on the robot like thunderchickens has (or at least crosstheroad electronics).

I am not familiar with any flash memory reader for FRC robots. Can you provide a URL?

AdamHeard
03-09-2007, 15:40
I am not familiar with any flash memory reader for FRC robots. Can you provide a URL?

http://www.crosstheroadelectronics.com/Chicken%20AID.htm

I know it's not for sale by them yet.... but it is something that is possible, and I've heard of teams doing it before....

Greg Marra
03-09-2007, 20:20
http://www.crosstheroadelectronics.com/Chicken%20AID.htm

I know it's not for sale by them yet.... but it is something that is possible, and I've heard of teams doing it before....

Do you know what teams have done it? I know people who have implemented reading from SD cards on PICs before, but not on FIRST robots, and I would love to find out how their procedure works.

Tom Bottiglieri
04-09-2007, 01:18
Do you know what teams have done it? I know people who have implemented reading from SD cards on PICs before, but not on FIRST robots, and I would love to find out how their procedure works.
If I remember correctly, SD/MMC cards run on an SPI connection. The IFI RC is using SPI on the user processor for something else.

This could be fixed by using an auxiliary PIC (although I would prefer an AVR.. woo GCC!), connecting the card via SPI, and using a serial connection between the aux board and the IFI controller. Also, I suppose if you wanted to get really fancy, you could emulate SPI by bit banging through the available i/o.

bear24rw
04-09-2007, 01:54
The module i linked to above from spark fun has SPI or TTL interface

Kevin Watson
04-09-2007, 18:31
My theory is actually quite simple write directly to the EEPROM from my laptop with a custom program. Then use a custom scripting engine in the autonomous section. This will give me the 2 things i want. Ease of use and a fast way to create new autonomous modes.Why not do everything on the RC? You could provide a terminal interface like:

1) Display command list (list number)
2) Set current command list (list number)
3) Delete command (command number)
4) Insert command (insertion point)
5) Modify command (command number)
6) ...

Commands could be something like:

1) Drive Arc (arc parameters)
2) Drive straight (distance)
3) Turn in place (radians)
4) Set arm position (3-d position)
5) Catch fire
6) Inflate flotation device
7) End command list
8) ...

The bells and whistles camera code might give you some ideas.

-Kevin

JimGRobot
06-09-2007, 11:59
If I remember correctly, SD/MMC cards run on an SPI connection. The IFI RC is using SPI on the user processor for something else.

This could be fixed by using an auxiliary PIC (although I would prefer an AVR.. woo GCC!), connecting the card via SPI, and using a serial connection between the aux board and the IFI controller. Also, I suppose if you wanted to get really fancy, you could emulate SPI by bit banging through the available i/o.

I'm glad to see some interest in this topic, reading files from SD chips would be handy...

Last year I posted some information about using an SD module for holding autonomous scripting files. I used a module from DOSonChip (http://dosonchip.com/), but I think it uses the same chip as the sparkfun model. I wrote some test code that runs on an SX28, but never tried it on an RC.

The code uses bit-banging on some port pins for SPI, and includes some simple file parsing examples. I intended to write some higher-level functions, but never got there.

All of the information is in multiple blog entries here (http://www.techranch.com/blog/index.php?category=6).

Have fun,
Jim

CyDrive
07-09-2007, 15:43
I agree it is awesome to see people interested in this. I mean the use of these ideas can be very valuable.