Difference between revisions of "Myro Hardware"

From IPRE Wiki
Jump to: navigation, search
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Myro currently supports two robots, with the plans to add many more. To see the current parts list, see [[Myro Development]].
+
Myro currently supports a single robot, but with the plans to add more. To see the current parts list, see [[Myro Development]]. To see details on the Fluke, see [[Hacking the Fluke]].
  
== Parallax's Scribbler ==
+
You need the following items:
  
[[Image:Scribbler and Bluetooth.jpg]]
+
* Scribbler or Scribbler2 - purchase from http://parallax.com or http://betterbots.com
 +
* Fluke - purchase from http://betterbots.com
  
The [http://scribblerrobot.com/ Scribbler] from [http://parallax.com/ Parallax] has the following properties:
+
== Scribbler ==
* line (2 IR, binary)
+
* obstacle (2 front IR, binary)
+
* stall
+
* light (3 front, continuous)
+
* two-frequency tone generator (cannot handle commands while playing tones)
+
* 6 AA batteries (not included; no recharger included)
+
* can hold a pen in center of robot
+
* no odometry
+
* no side range sensors
+
  
Combined with our [http://www-static.cc.gatech.edu/~kjohara/winxp-08-10-2006/scribbler-hardware.html hardware enhancements], it becomes a wireless Bluetooth robot (see [[USB/Bluetooth Adapters]] and [[Myro Development]] for more information).
+
{{:IPRE_Scribbler}}
  
All of our documentation and software written so far applies specifically to the Scribbler. See [[Introduction to Computer Science via Robots]] and the [[Myro Reference Manual]].
+
== Other Myro supported hardware ==
 +
Myro supports most generic USB gamepads (for the gamepad() function).
  
== Surveyor's SRV-1 ==
+
Gamepads known to work with Myro (without needing drivers) on Windows & Linux:
 +
* [http://www.superwarehouse.com/Logitech_Precision_USB_Game_Pad/963335-0403/p/1487096 Logitech Precision USB Gamepads] (Superwarehouse at one point offered a $20 off coupon for orders of $200 or more, code: SUPER20 )
 +
* Thrustmaster FireStorm Digital 3 Gamepad
  
[[Image:srv-1.jpg]]
+
Microsoft USB X-Box gamepads will work, but only on windows computers and you MUST install the driver software that comes with them before Myro will recognize them.
 
+
The [http://www.surveyor.com/SRV_info.html SRV-1] from [http://surveyor.com/ Surveyor] has a camera, and therefore has additional functions not (yet) found on the Scribbler. In addition, it doesn't have line sensors, but does have 4 IR sensors facing front, left, back, and right.
+
 
+
* Camera (up to 320x240 resolution; 640x480 is possible, but wireless communication doesn't support it yet)
+
* Zigbee 802.15.4 wireless communications
+
* dual tread
+
* 4 IR (front, left, back, right, continuous)
+
 
+
 
+
Before you can connect to the SRV-1, you'll need to find your com-port number.
+
To find your com-port number, do the following (on a P.C.):
+
 
+
# On the Start Menu, go to the Control Panel.
+
# This will get you to the System icon:
+
--A. If you're in Category View (it says "Pick a Category" at the top of the file, and the file background is periwinkle color):
+
*Click on Performance and Maintenance.
+
*Click the System icon.
+
--B. If you're in Classic View (there are many icons and the file background is white):
+
*Double-click the System icon.
+
# In the System Properties menu, click on the Hardware Tab (at the top).
+
# Now click on the "Device Manager" button.
+
# Click on the 'plus' sign beside "Ports (COM & LPT)".
+
# Find the COM port number that's next to the "Bridge Controller".
+
 
+
That's your COM port number - with it, you'll be able to open a connection between the computer and your robot.
+
 
+
 
+
You can use the SRV-1 in Myro like:
+
 
+
<pre>
+
>>> from myro import *
+
>>> robot = Surveyor("com4")
+
>>> robot.watch()
+
</pre>
+
 
+
or with the standard functional Myro interface:
+
 
+
<pre>
+
>>> from myro import *
+
>>> Surveyor("com4")
+
>>> joyStick(1)
+
>>> turnLeft(.5)
+
>>> forward(.7, 5)
+
</pre>
+
 
+
From the '''watch''' window you can click and drag a rectangle with the left, right, or middle mouse buttons. Each button is connected to an associated color set (left = 0, right = 2, middle = 1). By clicking and dragging a rectangle over a color, you will store that color into the associated set number. This will allow you to track an object by that color.
+
 
+
Here is the watch window showing a view of an orange golf ball.
+
 
+
[[Image:srv1-camera.JPG]]
+
 
+
Clicking on the golf ball with the left mouse button and dragging just a bit will select the colors of the golf ball and store them in the 0 color set location. That will then trigger the blob tracking, show here:
+
 
+
[[Image:srv1-camera-blob.JPG]]
+
 
+
=== Standard Myro Commands ===
+
 
+
Standard commands that also work with the SRV-1:
+
 
+
<pre>
+
>>> robot.get("all")
+
>>> robot.get("ir") # returns [front, left, back, right]
+
>>> robot.get("config")
+
>>> robot.get("name")
+
>>> robot.get("version")
+
>>> robot.beep(1, freq)  # plays through computer
+
>>> robot.speak("Hello")  # plays through computer
+
</pre>
+
 
+
=== Additional SRV-1 Commands ===
+
 
+
The SRV-1 adds the following commands to Myro in addition to those described in [[Introduction to Computer Science via Robots]] and the [[Myro Reference Manual]]:
+
 
+
'''robot.watch()''' or '''watch()''' - open a window for view live camera images
+
 
+
'''robot.getBlob(colorset)''' - return the x1, y1, x2, y2, matchcount of the blob that goes with colorset. Click and drag in the watch window to sample colors and store in colorset location (0, 1, or 2 for left, right, and center mouse buttons)
+
 
+
'''robot.sampleGroundColor()''' - resample the background colors for the "scan" command
+
 
+
'''robot.get("image")''' or '''robot.getImage()''' - returns a JPG (should return a XxYx3 matrix)
+
 
+
'''robot.get("resolution")''' - default value is (160,128), the width, height of camera view
+
 
+
'''robot.get("scan")''' or '''robot.getScan()''' - returns a list of "distances" to objects that have changed in image
+
 
+
'''robot.set("resolution",(ROWS, COLS))''' or '''robot.setResolution((ROWS, COLS)) ''' - changes the dimensions of the images.
+
 
+
'''robot.setSwarmMode("on"|"off")''' - puts the Scribbler in "swarm" mode
+
 
+
=== Differences ===
+
 
+
One difference in the SRV-1 is that the infrared readings are continuous values between 0 and 1, rather than just binary 0 or 1 as with the Scribbler.
+
 
+
=== Watch Window Commands ===
+
 
+
The watch window is mostly used as a GUI for displaying and selecting blob-tracking colors. However, there is also an experimental mode that displays the window in non-continuous mode and allows you to enter Python commands.
+
 
+
<pre>
+
>>> robot.watch(0) # non-continuous mode allows
+
                  # Python commands with window in view
+
# Leave window opened
+
>>> s= robot.getScan()
+
>>> robot.window.updateScan(s) # draws scan in window
+
>>> robot.update()  # or
+
>>> robot.window.update()
+
</pre>
+
 
+
=== Sample SRV-1 Brain ===
+
 
+
Here is a sample control program that will turn left or right to track something:
+
 
+
<pre>
+
from myro import *
+
robot = Surveyor("com4")
+
robot.watch()
+
# click and drag on something to track with left mouse button
+
# close window
+
while True:
+
    x1, y1, x2, y2, count = robot.getBlob(0)
+
    centerx = (x1 + x2) / 2
+
    centery = (y1 + y2) / 2
+
    if centerx < 80: # on left
+
        robot.turnLeft(.6)
+
    elif centerx > 80: # on right
+
        robot.turnRight(.6)
+
    wait(.1)
+
</pre>
+
 
+
Change the program to stop when close and move forward when far from an object.
+
 
+
=== Additional Information ===
+
 
+
Support for the SRV-1 is under development. Please see http://www.surveyor.com/SRV_protocol.html for more information on what the SRV-1 is capable of doing.
+
 
+
Here is a sample of how you can send raw protocol commands to the SRV-1:
+
 
+
<pre>
+
robot.ser.write("dr\n")
+
robot.ser.readline()
+
</pre>
+
 
+
There are also some functions defined in the myro.robot.surveyor package to help in raw robot communication:
+
 
+
<pre>
+
>>> from myro.robot.surveyor import *
+
>>> encode(15)
+
'\x0f'
+
>>> dec2hex(32)
+
'20'
+
>>> hex2dec("0FA2")
+
4002
+
</pre>
+

Latest revision as of 13:53, 20 September 2011

Myro currently supports a single robot, but with the plans to add more. To see the current parts list, see Myro Development. To see details on the Fluke, see Hacking the Fluke.

You need the following items:

Scribbler

Ipre-fluke.jpg

The Scribbler from Parallax has the following properties:

  • line (2 IR, binary)
  • obstacle (2 front IR, binary)
  • stall
  • light (3 front, continuous)
  • two-frequency tone generator (cannot handle commands while playing tones)
  • 6 AA batteries (not included; no recharger included)
  • can hold a pen in center of robot
  • no odometry
  • no side range sensors

Combined with our IPRE Fluke (which can be purchased here under license from Georgia Tech) it becomes a wireless Bluetooth robot. In addition to the bluetooth connectivity, the IPRE Fluke has:

  • the capability to program the scribbler with the IPRE firmware
  • extra LEDs (front and back)
  • 3 infrared obstacle detectors
  • a battery voltage sensor
  • a color camera

The scribbler+fluke combination is sold for $180 with educational discount. See the Georgia Robotics website for details.

All of our documentation and software written so far applies specifically to the Scribbler and uses Python. There are community efforts to adapt the material to C++ and Scheme as well as other robots. See Introduction to Computer Science via Robots and the Myro Reference Manual. Also, see USB/Bluetooth Adapters and Myro Development for more information.

Other Myro supported hardware

Myro supports most generic USB gamepads (for the gamepad() function).

Gamepads known to work with Myro (without needing drivers) on Windows & Linux:

  • Logitech Precision USB Gamepads (Superwarehouse at one point offered a $20 off coupon for orders of $200 or more, code: SUPER20 )
  • Thrustmaster FireStorm Digital 3 Gamepad

Microsoft USB X-Box gamepads will work, but only on windows computers and you MUST install the driver software that comes with them before Myro will recognize them.