| 183 | | == Step-by-step == |
| 184 | | |
| 185 | | === Extract files === |
| 186 | | * Extract the archive anywhere you want, KEEPING DIRECTORY STRUCTURE |
| 187 | | * The destination folder should contain a directory called `RWTHMindstormsNXT` |
| 188 | | |
| 189 | | === Set MATLAB path === |
| 190 | | * In MATLAB, go to "File", "Set Path...", "Add Folder..." |
| 191 | | * Browse to the location you extracted to, and add the folder `RWTHMindstormsNXT` |
| 192 | | * Also add the folder `tools` (it is a sub-directory of `RWTHMindstormsNXT`) to the MATLAB path |
| 193 | | * Press Save to remember settings for future MATLAB sessions |
| 194 | | |
| 195 | | |
| 196 | | === Check NXT Firmware === |
| 197 | | * Make sure you are using a LEGO NXT firmware version 1.26 or higher (1.29 recommended!), otherwise you have to upgrade. |
| 198 | | * Link to download 1.29: http://mindstorms.lego.com/en-us/support/files/Driver.aspx#Firmware |
| 199 | | * You can use the script `FlashNXTWithFirmware1.29.bat` from `/tools/MotorControl` to update your firmware, or any other tool of your choice. |
| 200 | | |
| 201 | | |
| 202 | | === Transfer !MotorControl to NXT === |
| 203 | | * Get `NeXTTool.exe` from http://bricxcc.sourceforge.net/utilities.html and save it to `/tools/MotorControl` (subfolder of the toolbox) |
| 204 | | * Use NeXTool to download !MotorControl*.rxe (there should only be one) to your NXT. On Windows, call `TransferMotorControlBinaryToNXT.bat` |
| 205 | | * Follow the on-screen instructions |
| 206 | | * If this doesn't work, you can try a different method / batch file. You need the NBC compiler for this step, get it here: |
| 207 | | http://bricxcc.sourceforge.net/nbc/, or try the latest version from `test_release.zip` from http://bricxcc.sourceforge.net/ |
| 208 | | |
| 209 | | |
| 210 | | === Check other software requirements === |
| 211 | | * Windows |
| 212 | | * USB: NXT Fantom driver installed? Get it here: http://mindstorms.lego.com/en-us/support/files/Driver.aspx#Driver |
| 213 | | * Bluetooth: Drivers installed, NXT visible etc., COM-Port available? |
| 214 | | |
| 215 | | * Linux: |
| 216 | | * USB: Install libusb |
| 217 | | * See `LinuxReadme.txt` in `/tools/LinuxConnection` |
| 218 | | |
| 219 | | * Mac OS |
| 220 | | * USB: NXT Fantom driver installed? Get it here: http://mindstorms.lego.com/en-us/support/files/Driver.aspx#Driver |
| 221 | | * Bluetooth: See below for Mac OS details, or follow `LinuxReadme.txt` in `/tools/LinuxConnection` |
| 222 | | |
| 223 | | |
| 224 | | === First USB connection === |
| 225 | | * Inside MATLAB, execute `COM_OpenNXT` [[BR]] |
| 226 | | The command should complete without an error! |
| 227 | | |
| 228 | | |
| 229 | | === First Bluetooth connection === |
| 230 | | * Inside MATLAB, execute `COM_MakeBTConfigFile` [[BR]] |
| 231 | | Enter the serial COM-Port of your Bluetooth driver or the rfcomm device you're using |
| 232 | | * Or edit a bluetooth-example ini-file from the toolbox folder to suit your configuration. The most important thing is the correct serial port. |
| 233 | | |
| 234 | | * Establish a Bluetooth connection to your NXT using your adapter's driver software, or using the script btconnect we provide in `/tools/LinuxConnection` |
| 235 | | * Authenticate with the NXT (a passkey request should appear) |
| 236 | | * The BT-icon on the top left of the NXT screen should turn from '''B<''' to '''B< >''', otherwise it won't work! |
| 237 | | * If this doesn't work, use the NXT menu to navigate to Bluetooth, Search, select your computer, connect. Again, you need the symbol '''B< >''' on your NXT screen. |
| 238 | | * If this still doesn't work, your Bluetooth hardware might be incompatible, or maybe you need a different driver! Check http://www.mindstorms.rwth-aachen.de/trac/wiki/BluetoothAdapter |
| 239 | | |
| 240 | | * Disconnect the USB cable from the NXT. |
| 241 | | |
| 242 | | * You can now type the following commands in MATLAB, given that you created a file called bluetooth.ini: [[BR]] |
| 243 | | `COM_CloseNXT('all')`[[BR]] |
| 244 | | `COM_OpenNXT('bluetooth.ini')` [[BR]] |
| 245 | | The commands should complete without an error! |
| 246 | | |
| 247 | | |
| 248 | | === Optimize performance === |
| 249 | | * Only necessary for MATLAB versions prior to Release 2010a (i.e. older versions than 7.10) |
| 250 | | * Inside MATLAB, type `OptimizeToolboxPerformance` |
| 251 | | * Confirm the dialog with yes, the script should complete without an error! |
| 252 | | |
| 253 | | |
| 254 | | === Try the examples === |
| 255 | | * Look inside the folder `demos` of your toolbox directory |
| 256 | | * Enjoy the examples |
| 257 | | |
| 258 | | |
| 259 | | == Alternative installation guide == |
| 260 | | An alternative installation guide by one of our external users is available [http://sites.google.com/site/sienamatlabnxt/getting-started here]. A nice external installation guide in Spanish can be found [http://www.clubderoboticautp.com/index.php?option=com_content&view=article&id=57&Itemid=73 here]. |
| 261 | | |
| 262 | | == Full Installation Guide == |
| 263 | | |
| 264 | | The RWTH - Mindstorms NXT Toolbox is a collection of MATLAB-functions (so called m-files) |
| 265 | | and documentation / help files (mostly HTML). You have received these files in a |
| 266 | | compressed archive, that just needs to be extracted to a directory of your choice. This |
| 267 | | folder can even be on an external hard disk, USB stick or network drive. However it is |
| 268 | | recommended to use a folder on a normal hard disk drive for performance reasons. |
| 269 | | So just uncompress the archive and remember the folder you extracted it to. |
| 270 | | Make sure that the internal sub-directory structure is kept! Also it is important that all |
| 271 | | files are located in a sub-folder called ''RWTHMindstormsNXT'' for identification purposes.[[BR]] |
| 272 | | [[BR]] |
| 273 | | Now inside MATLAB, go to the menu "File" and choose "Set Path...". Inside the new window, |
| 274 | | press "Add Folder...", and browse to the location where you extracted the files from the |
| 275 | | archive to in the previous step. Now select the folder ''RWTHMindstormsNXT'' and confirm. |
| 276 | | Repeat this step, and add the folder called ''demos'', which is a sub-folder of the |
| 277 | | previously added ''RWTHMindstormsNXT''-directory. When done, press "Save" to remember these |
| 278 | | settings for future MATLAB sessions. |
| 279 | | |
| 280 | | || [[Image(http://www.mindstorms.rwth-aachen.de/trac/raw-attachment/wiki/PageTemplates/DownloadToolboxVersion/installguide_setpath1.png, link=)]] || [[Image(http://www.mindstorms.rwth-aachen.de/trac/raw-attachment/wiki/PageTemplates/DownloadToolboxVersion/installguide_setpath2.png, link=)]] || |
| 281 | | || Open the "Set Path" window || Add the ''RWTHMindstormsNXT'' folder and its subfolder ''demos'' || |
| 282 | | |
| 283 | | After adding these 2 folders to the MATLAB search path, the installation is complete. To |
| 284 | | verify the installation, you can type the following line[[BR]] |
| 285 | | {{{ info = ver('RWTHMindstormsNXT') }}} [[BR]] |
| 286 | | inside the MATLAB command window. Also the command '''COM_CloseNXT('all')''' should work and |
| 287 | | complete without an error. |
| 288 | | [[BR]] |
| 289 | | [[BR]] |
| 290 | | |
| 291 | | == The First Bluetooth Connection == |
| 292 | | |
| 293 | | Before you can begin working with Bluetooth connections, you have to create a settings |
| 294 | | file that contains information about your Bluetooth adapter and serial port. |
| 295 | | Either you can use the toolbox-command COM_MakeBTConfigFile inside the command window. A |
| 296 | | dialog window lets you enter the required parameters. The other way is to edit the |
| 297 | | example-files called ''bluetooth-example-windows.ini'' or ''bluetooth-example-linux.ini'', |
| 298 | | that are provided in the toolbox root folder.[[BR]] |
| 299 | | [[BR]] |
| 300 | | You can leave the default values for the beginning, the only thing you will have to enter |
| 301 | | is the COM-Port. The Bluetooth SPP (serial port profile) maps a virtual COM-Port to your |
| 302 | | adapter. Find out which port this is (under Windows you can use the Device Manager) and |
| 303 | | enter it in the dialog window (example: COM4). The other parameters are explained in the |
| 304 | | documentation. Advanced users should refer to the first chapter ''Bluetooth connections and |
| 305 | | serial handles'' of the section ''Functions - Overview''.[[BR]] |
| 306 | | [[BR]] |
| 307 | | If there is more than one additional Bluetooth COM-Port, this is most likely caused by |
| 308 | | the adapter's driver software. Most of the time it is the lowest available COM-Port (above |
| 309 | | the classic "real ports"). The only way to be sure is to try which ports are working. |
| 310 | | (Sometimes there are certain ports that only work for sending OR receiving. The toolbox |
| 311 | | however needs a bidirectional port.)[[BR]] |
| 312 | | |
| 313 | | || [[Image(http://www.mindstorms.rwth-aachen.de/trac/raw-attachment/wiki/PageTemplates/DownloadToolboxVersion/devicemanager-bluetooth-spp-short.png, link=)]] || [[Image(http://www.mindstorms.rwth-aachen.de/trac/raw-attachment/wiki/PageTemplates/DownloadToolboxVersion/BT_MakeConfigFile-screenshot.png, link=)]] || |
| 314 | | || Device manager with correct Bluetooth serial port || Dialog window of '''COM_MakeBTConfigFile''' command || |
| 315 | | |
| 316 | | Linux users should use the bluez Bluetooth stack. The serial port will then be called ''/dev/rfcomm0'' or similar. |
| 317 | | This is the parameter that has to be added instead of ''COM3'' for example. The sample ini-file for Linux does not contain all |
| 318 | | settings as they are not needed here.[[BR]] |
| 319 | | [[BR]] |
| 320 | | Once the correct ini-file is created, it can be put inside the toolbox root path or anywhere inside the MATLAB search path |
| 321 | | for better convenience.[[BR]] |
| 322 | | You can now try the demos (which require a correct configuration file called ''bluetooth.ini'') or start opening connections |
| 323 | | using the toolbox command '''COM_OpenNXT'''. Note that before this works, you have to establish a physical connection to your NXT. Depending on your Bluetooth adapter's driver software, this can be different. Once successful, the NXT and driver software will prompt you for a passkey. The authentification is then complete, and the toolbox should work properly.[[BR]] |
| 324 | | [[BR]] |
| 325 | | |
| 326 | | |
| 327 | | For further details see the included ''readme.txt'' file located in the toolbox directory. |