Difference between revisions of "RGB Swarm Robot Quickstart Guide"

From Mech
Jump to navigationJump to search
Line 32: Line 32:
====Programming the e-puck====
====Programming the e-puck====
:''Taken from:'' [[Swarm_E-puck_Quickstart_Guide#Programming_the_e-puck|''Swarm E-puck Quickstart Guide: Programming the e-puck'']]
:''Taken from:'' [[Swarm_E-puck_Quickstart_Guide#Programming_the_e-puck|''Swarm E-puck Quickstart Guide: Programming the e-puck'']]
A bootloader is a type of program that is loaded onto a microcontroller which allows one to re-program the microcontroller in the field without having to use an special flash programmer (the programmer is still needed to load the bootloader onto the microcontroller in the first place). The Bootloader has two components: a programmer that runs on your computer, and a program that runs on the e-puck's PIC. When the PIC is turned on, bootloader will check to see if someone is attempting to re-program the PIC; if yes, the bootloader will overwrite its old program with the new program; if not, or if it times out while waiting for the new data stream, it will simply run the current program.
Programming the e-puck requires a specific program, called a ''bootloader'', in order to (re)program the microcontroller. The bootloader makes use of the bluetooth/serial port connection, allowing for wireless programming, as opposed to connecting a specific serial port connector directly to the microcontroller. This expedites the reprogramming process. The bootloader is comprised of two parts, one which operates on the e-puck, writing code to the e-puck microcontroller, and the other, which operates on the computer as user interface. On the e-puck side, the bootloader quickly checks to see if something is trying to re-program the PIC. If so, the bootloader will simply write the new software over the old, and then run the new software. If not, the bootloader simply allows the PIC to run the program currently loaded. The computer side allows a user to select which COM port to program over (allowing one to select which e-puck to program), and selecting what HEX file to program to the e-puck.


To program the e-puck with a bootloader, follow these instructions:
To program the e-puck, start the Tiny Bootloader program on your computer. (Although you can also use a flash programmer such as the ICD2 to program the e-puck, it will take much longer and can't be done wirelessly.) Click on '''Browse''' and select the .hex file that you want to load. The .hex file is the compiled code from Microchip's C compiler. Under '''Comm''', use 115200 for the baud rate, and type in the outgoing COM port assigned to this e-puck (e.g. COM10, COM11, etc.). Turn on the e-puck, and click on the Write Flash button. The blue bar underneath the button should start counting down. Now, hit the blue reset button on the e-puck, before the blue bar reaches zero and times out. If the e-puck is successfully connected, an orange LED on the e-puck will turn on, and the bootloader will start to program the PIC on the e-puck.
*'''Note''': you will have to compile and build the C code from the Microchip C compiler, as the .hex file is needed to install onto the e-puck
#Start the Tiny Bootloader program on your computer
#Click the '''Browse''' button and select the .hex file that corresponds to the e-puck code that you want to program
#Set '''115200''' under the '''Comm''' dropdown menu, and select the COM port that corresponds with the OUTGOING COM port of the e-puck
#Click the '''Write Flash''' button
#Immediately click the blue reset button on the e-puck
#*'''Note''': The reset button must be clicked before the blue status bar on the Tiny Bootloader dialog screen reaches zero, representing the program timing out.
#Once the bootloader starts writing software, the blue status bar will grow, representing code being uploaded and programmed
#*'''Note''': In addition to the blue status bar, a orange LED on the e-puck will light up, signaling that a connection has been made


====e-puck Troubleshooting====
====e-puck Troubleshooting====

Revision as of 14:04, 9 September 2009

This guide was written as a quickstart guide for the RGB Swarm Robot Project, but contains general information about programming e-pucks and using the vision system.

Checklist

  • Physical Set up
    • Projector
    • Tent
  • Computer Programs needed

Computer Setup

  • Download this
  • Set up that

e-puck

e-puck Setup

Preparing the code

  • if you have the HEX file, skip down
  • compiling
  • getting HEX file

Connecting the e-puck

  1. Go to start menu >> control panel >> Bluetooth Devices
  2. Click the 'Add...' button in the lower left of the dialog window
    • Turn on the e-puck that you wish to configure/connect to the computer
    • Check the box next to 'My device is set up and ready to be found.'
    • Continue with the Next button, and the computer will search for your e-puck
  3. Once the computer finds your e-puck, select the appropriate e-puck (should be ID'd by the 4 digit ID number), and assign the 4 digit ID number as the 'passkey' for that e-puck
    • This process reserves a pair of COM(serial) port for that specific e-puck, one as Incoming and the other as Outgoing; each e-puck will have a different pair of ports
  4. Return to the Bluetooth Devices Dialog screen, and click on the COM Ports tab
  5. Check which COM ports are assigned to your e-puck, specifically the Outgoing COM port; this COM port will be used when programming this e-puck with the TinyBootloader program
  • Note: if using a USB Bluetooth dongle, when the dongle is unplugged and replugged it into a different USB port, or a different dongle altogether is used, it may be necessary to repeat these steps for each e-puck that you wish to use
  • Note: these instructions are for using Windows XP Professional Edition. The exact command paths and dialog boxes may differ from OS to OS

Programming the e-puck

Taken from: Swarm E-puck Quickstart Guide: Programming the e-puck

Programming the e-puck requires a specific program, called a bootloader, in order to (re)program the microcontroller. The bootloader makes use of the bluetooth/serial port connection, allowing for wireless programming, as opposed to connecting a specific serial port connector directly to the microcontroller. This expedites the reprogramming process. The bootloader is comprised of two parts, one which operates on the e-puck, writing code to the e-puck microcontroller, and the other, which operates on the computer as user interface. On the e-puck side, the bootloader quickly checks to see if something is trying to re-program the PIC. If so, the bootloader will simply write the new software over the old, and then run the new software. If not, the bootloader simply allows the PIC to run the program currently loaded. The computer side allows a user to select which COM port to program over (allowing one to select which e-puck to program), and selecting what HEX file to program to the e-puck.

To program the e-puck with a bootloader, follow these instructions:

  • Note: you will have to compile and build the C code from the Microchip C compiler, as the .hex file is needed to install onto the e-puck
  1. Start the Tiny Bootloader program on your computer
  2. Click the Browse button and select the .hex file that corresponds to the e-puck code that you want to program
  3. Set 115200 under the Comm dropdown menu, and select the COM port that corresponds with the OUTGOING COM port of the e-puck
  4. Click the Write Flash button
  5. Immediately click the blue reset button on the e-puck
    • Note: The reset button must be clicked before the blue status bar on the Tiny Bootloader dialog screen reaches zero, representing the program timing out.
  6. Once the bootloader starts writing software, the blue status bar will grow, representing code being uploaded and programmed
    • Note: In addition to the blue status bar, a orange LED on the e-puck will light up, signaling that a connection has been made

e-puck Troubleshooting

Machine Vision Localization System

  • Machine Vision Localization System Code

Machine Vision Localization System Setup

Vision System Troubleshooting

Additional Tools

Matlab Tools

Visual Studio Tools