NI Home > Community > NI Discussion Forums

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

Reply
Member
kevinoleniczak
Posts: 4
0 Kudos

Documentation on how to decode the RBT binary file format

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?

 

thanks

Active Participant
Jesse_D
Posts: 485
0 Kudos

Re: Documentation on how to decode the RBT binary file format

Hi Kevin, 

 

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? 

Jesse Dennis
Product Support Engineer
National Instruments

Member
kevinoleniczak
Posts: 4
0 Kudos

Re: Documentation on how to decode the RBT binary file format

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.

 

-kevin

Active Participant
Jesse_D
Posts: 485
0 Kudos

Re: Documentation on how to decode the RBT binary file format

Hi Kevin, 

 

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. 

 

Jesse Dennis
Product Support Engineer
National Instruments

Member
kevinoleniczak
Posts: 4
0 Kudos

Re: Documentation on how to decode the RBT binary file format

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?

 

Kind Regards,

Kevin

Active Participant
Jesse_D
Posts: 485
0 Kudos

Re: Documentation on how to decode the RBT binary file format

Hi Kevin, 

 

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.

 

Jesse Dennis
Product Support Engineer
National Instruments

Member
kevinoleniczak
Posts: 4
0 Kudos

Re: Documentation on how to decode the RBT binary file format

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.

 

-kevin

Active Participant
Jesse_D
Posts: 485
0 Kudos

Re: Documentation on how to decode the RBT binary file format

Hi Kevin,

 

I will not be able to do that.

 

Jesse Dennis
Product Support Engineer
National Instruments

Member
Paul Glaubitz
Posts: 1
0 Kudos

Re: Documentation on how to decode the RBT binary file format

I too am coaching an FLL team (#1063 Moderately Confused). I don't know if this will provide an alternate solution, but it has helped my teams reduce the number of guess-and-check iterations for movement. Once they have the base built I have them run the motors 5 rotations and measure the distance. From this they can get a degrees per inch (or cm if preferred). You can then measure how far you want to go and convert it to motor commands. A similar technique can be applied to turns. This doesn't eliminate the tweak iterations, but makes the process more controlled. Another team I know creates my blocks based on this and enters every thing as distance.
Active Participant
Jesse_D
Posts: 485
0 Kudos

Re: Documentation on how to decode the RBT binary file format

Hi Paul, 

 

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. 

 

Jesse Dennis
Product Support Engineer
National Instruments