Difference between revisions of "Robotics-2010"

From Earlham CS Department
Jump to navigation Jump to search
(nxt.compass)
(Lab 6)
 
(39 intermediate revisions by 6 users not shown)
Line 1: Line 1:
= NXT-Python Documentation =
+
= Resources for CS282 - Robotics =
Largely a work in-progress, please add/edit as you learn the details.  Note that this page is documenting the NXT-Python v1.1 release (http://code.google.com/p/nxt-python/), not the NXT_Python v0.7 release which appears to have gone dormant (note hyphen vs underscore).
+
== Hardware ==
 +
* [[change-NXT-settings|How to change the name of your NXT]]
  
=== nxt.locator ===  
+
== Software Stack ==
The function of this module is to locate NXT brick(s). Returns an <code>nxt.bluesock.BlueSock</code> object for robots connected by Bluetooth and a <code>nxt.usbsock.USBSock</code> object for robot connected by USB, and throws <code>nxt.locator.BrickNotFoundError</code> if none can be found.
+
* [http://cs.earlham.edu/~charliep/courses/cs282/packages/ Software Packages (nxt-python, etc)]
 +
* [[nxt-python-iso|Ubuntu with Brad's Live ISO]]
 +
* [[nxt-python-osx|OSX]]
  
* Status: incomplete as of 2010-02-14
+
== Python ==
 +
* [[nxt-python-doc|NXT-Python Documentation]]
 +
* [[nxt-python-hints|Programming Hints]]
 +
* [[nxt-python-threads|Thread Notes]]
  
* Objects
+
== Sensor Notes ==
** <code>nxt.bluesock.BlueSock</code> - The object returned by <code>find_one_brick()</code> when a brick is found on a Bluetooth connection.
+
* [[bots-hitechnic-compass|HiTechnic Compass]]
  
* Methods
+
== Non-local Resources ==
** <code>connect()</code> - Try to connect to the brick.
+
* Bluetooth - NXT [http://vikram.eggwall.com/computers/nxt-bluetooth-setup.html setup notes]
** <code>close()</code> - Close connection to brick.
 
** <code>host</code> - Returns the address of the brick.  
 
** generator object <code>find_bricks()</code>
 
*** <code>next()</code> - Find the next brick in the sequence, returns the same thing as <code>find_one_brick()</code>.
 
** <code>find_one_brick()</code>
 
** <code>find_bricks(host=None, name=None)</code> - Find all the bricks in the area, returns a generator object <code>find_bricks</code>.  
 
  
* Example
+
= Lab 6 =
import nxt.locator
+
* [http://cs.earlham.edu/~charliep/courses/cs282/mapping.pdf The Official Assignment]
sock = nxt.locator.find_one_brick()
+
* [[robotics-lab6-tasks|Task Analysis - Original]]
brick = sock.connect()
+
* [[Robotics-lab6-newversion|Task Analysis - Second Go 'Round]]
print brick.host
+
* [http://github.com/Sleemanmunk/Magnetic-Mapping Software Repository]
brick.close()
+
* [http://cs.earlham.edu/~carrick/courses/cs282/lab6/visualization Visualization]
 
 
=== nxt.motor ===
 
 
 
* Status: incomplete as of 2010-02-14
 
 
 
* Objects
 
 
 
* Methods
 
 
 
* Example
 
 
 
=== nxt.sensor ===
 
 
 
* Status: incomplete as of 2010-02-14
 
 
 
* Objects
 
 
 
* Methods
 
 
 
* Example
 
 
 
=== nxt.compass ===
 
 
 
* Status: incomplete as of 2010-02-14
 
 
 
* Objects
 
**UltrasonicSensor
 
The compass sensor is a digital sensor, and, albeit clumsily, can be interfaced as if it were another digital sensor, like the Ultrasonic sensor.
 
 
 
* Methods
 
**UltrasonicSensor(bot,port)
 
**get_sample() returns a value between zero and 180 depending on the heading of the sensor. There is a one-to-two ratio between degrees from due North and get_sample() values.
 
 
 
* Example
 
compass = UltrasonicSensor(bot, PORT_1) #declare the sensor plugged into port 1 "compass"
 
heading = compass.get_sample()*2 # get the current heading in degrees from due north
 
 
 
=== Scripts ===
 
Located in <code>$DISTRIBUTION/scripts</code>.
 
* nxt_filer
 
* nxt_push
 
* nxt_test
 
 
 
=== Server Mode and nxt.server ===
 

Latest revision as of 20:48, 15 April 2010