For research in Knuthlab, I am interested in controlling the Lego NXT Bricks with Mathworks MATLAB. MATLAB is a high-level mathematical language structured much like C. The main benefit is that many sophisticated mathematical algorithms are available for immediate use in MATLAB, and that these algorithms are fast and easily developed. Furthermore, much signal processing research is performed in MATLAB; including most of my own algorithms.
The most promising solution is to have MATLAB send commands to the NXT Brick and to receive sensor readings from the NXT Brick. In both cases Bluetooth is the obvious means of communication.
At this stage, we have found three possible solutions:
- Incorporate Java Classes into MATLAB and then employ either iCommand or LeJOS NXT which both use the Java Programming Language to control the NXT Brick.
- Adopt the solution engineered by Gregory Gutt for the George Mason Neural Dynamics Laboratory, which employs RealTerm as a server to pass commands to the NXT via Bluetooth in the form of a Byte Stream. This is a very attractive solution, but would require the writing of more detailed NXT commands in MATLAB…an endeavor possibly worth the effort. Crucial to this effort are the steps of using RealTerm from MATLAB and understanding the Byte Streams used by NXT.
- The last possibility would be interfacing MATLAB to one of the various C or C-like interfaces to NXT. This would require the writing of MEX files, which I am not very excited about doing.
We will have to make some decisions in the near future, but the prospect of interfacing MATLAB directly to the Brick via Byte Streams sent by RealTerm seems to me to be the most robust and flexible solution. I will keep you posted.