11-15-2011 11:29 PM
Looking to write a simple NXT robot simulator for FLL. I have binary file reading/writing experience, but need to know how the data structures are defined for NXT 2.0. Any clues out there?
11-17-2011 09:55 AM
Can you give us some more details about this simulator? Are you trying to make a simulator that tests programs before they are downloaded to the NXT? Are you using LabVIEW or LegoMINDSTORMS?
11-17-2011 11:17 AM
The simulator would ideally take a file saved in the mindstorms nxt 2.0 tool and read it to determine motor and senor actions. Given this i would like to approximate the location of the robot on an image of the FLL playing field. This would of course require some calibration to know how how much distance is traveled for a given robot design. The goal is to enable the kids to see a 2D picture of the playing field and determine approximately whether the robot is going where it's intended. I find that my younger team is spending a lot of time testing their program on the real robot which is fine if you have enough of them, but would like to enable them to get started at home on their own. Then fine tune with the real robot later. I'm comfortable reading binary files if the data structures that are packed within are documented and shared.
11-17-2011 12:03 PM
Thanks for the clarification, I see what you are trying to do. However, because the mindstorms nxt tool is based on labview it will be non-trivial to accomplish. Furthermore the documentation doesn't exist to parse a rbt file like you are talking about.
Labview robotics has a robotics simulator that may be able to work for you. Labview also has a NXT programming module. You could put these two together and use the simulator to test your nxt robot. You would need to switch from the NXT Tool to labview but for more complex programs this would be a good step anyway.
11-17-2011 12:08 PM
That's very good to know, but if i'm not mistaken FIRST FLL doesn't allow the use of Labview for competition related work which is what we are doing. I think what you provided would be interesting to pursue for the "off season" but really want to take a stab at decoding RBT files. Can this format be shared?
11-17-2011 12:46 PM
There is no set simple format for the files, outside of re-engineering the source code it will not be possible to do what you are trying to.
11-17-2011 01:01 PM
ok i hear you. One last suggestion though... not certain what language it was written in, but code snipits of data structure definitions would likely get me what i need to move forward. I imagine there is defined header record and from looking at a smaple file with a hex editor, there are repeating "ti" sections if i recall right. Each of those probably supports variable lengths depending on what is being done within that section. The code this was written with would have to have those structures defined in order to repeatably write a RBT file that other NXT programs could read back in. This would be useful in my endeavor if it could be made available.
11-28-2011 01:20 PM
11-29-2011 01:24 PM
Thanks for the input, creating blocks based off the distances you measure is actually a really good idea. Increasing the number of rotations you use to calibrate will also increase accuracy.